lensmcp 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/dashboard.js +35 -35
- package/bundled/main.js +14 -14
- package/lib/cli.js +17 -16
- package/lib/mem-command.d.ts +8 -1
- package/lib/mem-command.js +3 -3
- package/lib/upgrade.d.ts +14 -0
- package/lib/upgrade.js +2 -2
- package/package.json +4 -4
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugins/lensmcp/.codex-plugin/plugin.json +1 -1
package/bundled/dashboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var s5=Object.defineProperty;var s=(e,t)=>s5(e,"name",{value:t,configurable:!0});var qm=Object.defineProperty,o=s((e,t)=>qm(e,"name",{value:t,configurable:!0}),"a"),ut=s((e,t)=>{for(var r in t)qm(e,r,{get:t[r],enumerable:!0})},"mt");import"reflect-metadata";import{createHash as a5}from"node:crypto";import{existsSync as Zm,readFileSync as Lm,statSync as Vm}from"node:fs";import{createServer as o5}from"node:http";import{basename as l5}from"node:path";var Jm="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Wm(e,t){let r="",i=e;for(let u=t-1;u>=0;u--){let n=i%32;r=Jm[n]+r,i=(i-n)/32}return r}s(Wm,"IS"),o(Wm,"encodeTime");function Gm(e){let t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let r="";for(let i=0;i<e;i++)r+=Jm[(t[i]??0)&31];return r}s(Gm,"RS"),o(Gm,"encodeRandom");function lt(e=Date.now()){return Wm(e,10)+Gm(16)}s(lt,"Fe"),o(lt,"ulid");var Km=class{static{s(this,"mr")}static{o(this,"EventBus")}constructor(e={}){this.subs=new Set,this.dropped=0,this.capacity=e.capacity??1e4,this.onDrop=e.onDrop,this.transform=e.transform}publish(e){if(this.subs.size>this.capacity){this.dropped++,this.onDrop?.(1);return}let t=e;if(this.transform)try{t=this.transform(e)??e}catch{t=e}for(let r of this.subs)if(!(r.filter&&!r.filter(t)))try{let i=r.handler(t);i&&typeof i.then=="function"&&i.catch(()=>{})}catch{}}subscribe(e,t){let r={handler:e,filter:t};return this.subs.add(r),()=>{this.subs.delete(r)}}droppedCount(){return this.dropped}subscriberCount(){return this.subs.size}},eu="REDACTED",d5=["token","secret","password","passwd","apikey","credential","assertion","signature"],c5=new Set(["key","auth","authorization","jwt","code","sig","pwd","pass","session","sid","bearer","otp","cookie","set-cookie"]),p5=/^(?:(?:prompt|completion|total|input|output|cache|cached|cacheread|cachewrite|reasoning|thinking|max|min|remaining|used|billed)tokens|tokens?(?:count|used|limit|remaining))$/;function sa(e){let t=e.toLowerCase();if(p5.test(t.replace(/[-_.]+/g,"")))return!1;if(d5.some(r=>t.includes(r)))return!0;for(let r of t.split(/[-_.]+/))if(r&&c5.has(r))return!0;return!1}s(sa,"Gb"),o(sa,"isSecretParam");var m5=/^([a-z][a-z0-9+.-]*:\/\/)[^/?#@\s]*@/i,f5=/([?&#])([^=&#\s]+)=([^&#\s]*)/g;function Hm(e){return e&&e.replace(m5,`$1${eu}@`).replace(f5,(t,r,i)=>sa(i)?`${r}${i}=${eu}`:t)}s(Hm,"OS"),o(Hm,"redactUrlParams");var h5=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]*/g,g5=/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi,v5=/\b(authorization|x-api-key|api-key|cookie|set-cookie|proxy-authorization)\b(\s*[:=]\s*)(["']?)((?:(?:bearer|basic)\s+)?[^\s"',;]{4,})\3/gi;function dt(e){return Hm(e).replace(v5,(t,r,i,u)=>`${r}${i}${u}${eu}${u}`).replace(h5,eu).replace(g5,(t,r)=>`${r} ${eu}`)}s(dt,"ht"),o(dt,"redactText");function aa(e,t){return e.length<=t?e:`${e.slice(0,t)}\u2026[lensmcp truncated: ${e.length-t} more chars]`}s(aa,"Jb"),o(aa,"clip");function Xm(e,t=4096){if(e!==void 0)return aa(dt(e),t)}s(Xm,"Wb"),o(Xm,"safeText");function Ym(e){return aa(dt(e),300)}s(Ym,"Kb"),o(Ym,"safeTitle");var y5=6,E5=64,b5=/^TS\d{1,5}$/,w5=o((e,t)=>e==="code"&&typeof t=="string"&&b5.test(t),"isDiagnosticCode");function Zu(e,t=0,r=y5){if(typeof e=="string")return dt(e);if(e===null||typeof e!="object"||t>=r)return e;if(Array.isArray(e)){let n=!1,a=e.map((l,d)=>{if(d>=E5)return l;let c=Zu(l,t+1,r);return c!==l&&(n=!0),c});return n?a:e}let i=!1,u={};for(let[n,a]of Object.entries(e)){let l=sa(n)&&a!==void 0&&a!==null&&!w5(n,a)?eu:Zu(a,t+1,r);l!==a&&(i=!0),u[n]=l}return i?u:e}s(Zu,"gr"),o(Zu,"redactDeep");var D5=12;function oa(e={}){let t=e.maxDepth??D5,r=0,i=0;return{redact(u){r+=1;let n=u.title===void 0?void 0:Ym(dt(u.title)),a=u.message===void 0?void 0:Xm(dt(u.message),4096),l=u.raw===void 0?void 0:Zu(u.raw,0,t),d=n!==u.title,c=a!==u.message,p=l!==u.raw;return!d&&!c&&!p?u:(i+=1,{...u,...n!==void 0?{title:n}:{},...a!==void 0?{message:a}:{},...l!==void 0?{raw:l}:{}})},stats:o(()=>({inspected:r,redacted:i}),"stats"),reset:o(()=>{r=0,i=0},"reset")}}s(oa,"ri"),o(oa,"createEventRedactor");var Qm=class{static{s(this,"vr")}static{o(this,"ResourceStore")}constructor(){this.entries=new Map,this.subs=new Map}register(e,t){if(this.entries.has(e))throw new Error(`Resource already registered: ${e}`);return this.entries.set(e,{uri:e,produce:t,revision:0}),()=>{this.entries.delete(e),this.subs.delete(e)}}async read(e){let t=this.entries.get(e);if(!t)throw new Error(`Unknown resource: ${e}`);return t.produce()}list(){return[...this.entries.keys()]}async markDirty(e){let t=this.entries.get(e);if(!t)return;let r=await t.produce(),i=JSON.stringify(r);if(i===t.lastJson)return;t.lastJson=i,t.revision+=1;let u=this.subs.get(e);if(u)for(let n of u)try{n(e,t.revision)}catch{}}revision(e){return this.entries.get(e)?.revision}subscribe(e,t){let r=this.subs.get(e);return r||(r=new Set,this.subs.set(e,r)),r.add(t),()=>{r?.delete(t)}}},e4=class{static{s(this,"yr")}static{o(this,"GraphStore")}constructor(){this.nodes=new Map,this.edges=new Map,this.byParent=new Map,this.byFlow=new Map,this.byLogical=new Map,this.byInstance=new Map,this.byRequest=new Map,this.outByAxis=new Map,this.inByAxis=new Map}addNode(e){this.nodes.set(e.id,e),e.parentTraceNodeId&&this.addToIndex(this.byParent,e.parentTraceNodeId,e.id),e.context.flowId&&this.addToIndex(this.byFlow,e.context.flowId,e.id),e.logicalId&&this.addToIndex(this.byLogical,e.logicalId,e.id),e.instanceId&&this.addToIndex(this.byInstance,e.instanceId,e.id),e.context.requestId&&this.addToIndex(this.byRequest,e.context.requestId,e.id)}updateNode(e,t){let r=this.nodes.get(e);if(!r)throw new Error(`Unknown node: ${e}`);let i={...r,...t,id:r.id};return this.nodes.set(e,i),i}getNode(e){return this.nodes.get(e)}addEdge(e){this.edges.set(e.id,e);let t=this.outByAxis.get(e.axis);t||(t=new Map,this.outByAxis.set(e.axis,t)),this.addToIndex(t,e.from,e.id);let r=this.inByAxis.get(e.axis);r||(r=new Map,this.inByAxis.set(e.axis,r)),this.addToIndex(r,e.to,e.id)}getEdge(e){return this.edges.get(e)}childrenOf(e){return this.materialiseNodes(this.byParent.get(e))}nodesInFlow(e){return this.materialiseNodes(this.byFlow.get(e))}nodesByLogical(e){return this.materialiseNodes(this.byLogical.get(e))}nodesByInstance(e){return this.materialiseNodes(this.byInstance.get(e))}nodesByRequest(e){return this.materialiseNodes(this.byRequest.get(e))}traverse(e){let t=this.nodes.get(e.from);if(!t)return{nodes:[],edges:[]};let r=Array.isArray(e.lens)?e.lens:[e.lens],i=e.direction??"both",u=e.depth??4,n=e.maxNodes??1e3,a=new Set,l=new Set,d=[{id:t.id,d:0}];for(;d.length&&!(a.size>=n);){let{id:c,d:p}=d.shift();if(!a.has(c)&&(a.add(c),!(p>=u)))for(let m of r){if(i==="out"||i==="both"){let f=this.outByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.to)||d.push({id:g.to,d:p+1})}}if(i==="in"||i==="both"){let f=this.inByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.from)||d.push({id:g.from,d:p+1})}}}}return{nodes:this.materialiseNodes(a),edges:[...l].map(c=>this.edges.get(c)).filter(c=>!!c)}}nodeCount(){return this.nodes.size}edgeCount(){return this.edges.size}addToIndex(e,t,r){let i=e.get(t);i||(i=new Set,e.set(t,i)),i.add(r)}materialiseNodes(e){if(!e)return[];let t=[];for(let r of e){let i=this.nodes.get(r);i&&t.push(i)}return t}};function t4(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}s(t4,"ZS"),o(t4,"fnv1a32");function u4(e){let t=[e.kind,e.identity,e.file??"",e.detail??""];return`${e.kind}:${t4(t.join("|"))}`}s(u4,"Xb"),o(u4,"fingerprint");var $5=class{static{s(this,"ni")}static{o(this,"ReducerRegistry")}constructor(){this.reducers=[]}register(e,t){if(this.reducers.some(r=>r.name===e))throw new Error(`Reducer already registered: ${e}`);this.reducers.push({name:e,reducer:t})}list(){return this.reducers}async dispatch(e){for(let{reducer:t}of this.reducers)try{let r=t(e);r&&typeof r.then=="function"&&await r}catch{}}};function la(e,t={}){let r,i;if(t.flowId)i=t.flowId,r=e.filter(m=>m.context.flowId===i);else{let m=e.find(f=>f.context.flowId);if(!m)return;i=m.context.flowId,r=e.filter(f=>f.context.flowId===i)}if(r.length===0)return;r.sort((m,f)=>m.timestamp-f.timestamp);let u=1e3;r.length>u&&(r=[r[0],...r.slice(r.length-(u-1))]);let n=r[0],a=[],l,d;for(let m of r){let f=r4(m);if(f){if(a.push(f),f.kind==="render"||f.kind==="final-render"){let h=m.raw;h?.render&&(l={id:h.render.id,page:h.render.page,route:h.render.route,componentName:h.render.componentName})}else if(m.source==="visual"&&f.kind==="visual-violation"){let h=m.raw;h?.frame&&(d=h.frame.id)}}}for(let m=a.length-1;m>=0;m--)if(a[m].kind==="render"){a[m]={...a[m],kind:"final-render"};break}let c=r[0].timestamp,p=r[r.length-1].timestamp;return{flowId:i,origin:{type:n.context.originType,nodeId:n.context.originNodeId,at:n.timestamp},phases:a,finalState:l?{page:l.page,route:l.route,componentName:l.componentName,renderId:l.id,visualFrameId:d}:void 0,startedAt:c,endedAt:p,eventCount:r.length}}s(la,"oi"),o(la,"compileStory");function r4(e){let t=(e.raw??null)?.kind;if(t==="flow-origin"||e.source==="client-runtime"&&t==="user-action"){let r=e.raw;return{kind:"user-action",at:e.timestamp,label:r?.origin?.label??e.title,eventIds:[e.id]}}if(e.source==="react"&&t==="render"){let r=e.raw;return{kind:"render",at:e.timestamp,label:`render ${r?.render?.componentName??"?"}`,eventIds:[e.id],details:r?.render?{componentName:r.render.componentName,durationMs:r.render.actualDurationMs}:void 0}}if(e.source==="react"&&t==="slot-content-changed"){let r=e.raw,i=r?.slot?.toComponent??"?";return{kind:/spinner|loader|loading/i.test(i)?"loading-ui":"idle-ui",at:e.timestamp,label:`slot ${r?.slot?.slotLogicalId??""} \u2192 ${i}`,eventIds:[e.id]}}if(e.source==="client-runtime"&&t==="route"){let r=e.raw;return{kind:"route-transition",at:e.timestamp,label:`route ${r?.from??""} \u2192 ${r?.url??""}`,eventIds:[e.id]}}if(e.source==="valtio"&&t==="state-update"){let r=e.raw;return{kind:"state-update",at:e.timestamp,label:`${r?.update?.storeId??"?"}.${r?.update?.path??"?"}`,eventIds:[e.id],details:r?.update}}if(e.source==="nestjs"&&t==="server-request"){let r=e.raw;return{kind:"backend-request",at:e.timestamp,label:`${r?.request?.method??"?"} ${r?.request?.route??"?"} \u2192 ${r?.request?.status??"?"}`,eventIds:[e.id],details:r?.request}}if(e.source==="chrome"&&e.category==="network")return{kind:"backend-request",at:e.timestamp,label:e.title,eventIds:[e.id]};if(e.source==="visual"&&t==="visual-violation"){let r=e.raw;return{kind:"visual-violation",at:e.timestamp,label:`${r?.violation?.ruleType??"rule"} ${r?.violation?.ruleId??""}`,eventIds:[e.id]}}}s(r4,"qS"),o(r4,"classifyEvent");var i4={phaseGapMs:1500,burstGapMs:250,attachWindowMs:400,maxSegmentEvents:400,occurrenceSlackMs:10},B5=new Set(["subscription-added","subscription-removed","hook-run","store-created","singleton-instance","visual-frame"]),da="db-request-account",x5=new Set(["react","valtio","client-runtime","chrome","visual"]),tu=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),le=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),De=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function n4(e){let t=tu(e.raw)?e.raw:{},r=tu(t.request)?t.request:{},i=tu(t.span)?t.span:{},u=e.context??{},n=le(t.kind)??"",a=n===da,l=(a?De(t.lastEndedAt):void 0)??De(e.timestamp)??0,d=De(r.startedAt)??De(i.startTime)??De(t.startedAt)??(a?De(t.firstStartedAt):void 0),c=De(r.endedAt)??De(i.endTime)??(d!==void 0&&De(t.durationMs)!==void 0?d+t.durationMs:void 0),p=Math.min(l,d??l),m=Math.max(l,c??l),f=tu(t.render)?t.render:{},h=tu(t.update)?t.update:{},g=n==="render"?le(f.componentName):n==="state-update"?le(h.path)?.split(".").slice(0,2).join("."):void 0,b=le(t.queue),x=le(t.jobId),$=String(e.source),w=le(t.project)??le(u.projectName);return{event:e,id:e.id,ts:l,from:p,to:m,kind:n,source:$,...le(u.requestId)?{requestId:le(u.requestId)}:{},...le(u.parentRequestId)?{parentRequestId:le(u.parentRequestId)}:{},...b&&x?{queueKey:`${b}#${x}`}:{},browser:x5.has($)||$==="memory"&&w===void 0,bookkeeping:B5.has(n),...w?{project:w}:{},...g?{subject:g}:{},...n==="fetch-start"||n==="fetch-done"?{route:ca(le(t.url)),method:le(t.method)}:n==="server-request"?{route:le(r.route),method:le(r.method)}:n==="gateway-request"?{route:ca(le(t.url)),method:le(t.method)}:{}}}s(n4,"JS"),o(n4,"readItem");function ca(e){if(!e)return;let t=e.search(/[?#]/),r=t===-1?e:e.slice(0,t),i=/^[a-z][a-z0-9+.-]*:\/\/[^/]*(\/.*)?$/i.exec(r);return i?i[1]??"/":r}s(ca,"Hb"),o(ca,"pathOnly");var C5=o(e=>e.split(".")[0],"rootOf"),s4=o((e,t)=>e.reduce((r,i)=>Math.min(r,t(i)),1/0),"minOf"),a4=o((e,t)=>e.reduce((r,i)=>Math.max(r,t(i)),-1/0),"maxOf"),pa=o((e,t)=>e.ts-t.ts||(e.id<t.id?-1:e.id>t.id?1:0),"compare"),ma=o(e=>e.requestId&&!e.requestId.startsWith("job:")?C5(e.requestId):void 0,"directFamilyOf");function o4(e){if(e.requestId?.startsWith("job:"))return e.requestId.slice(4);if(e.queueKey&&e.kind!=="queue-enqueued"&&!e.requestId)return e.queueKey}s(o4,"KS"),o(o4,"jobKeyOf");function l4(e,t){let r=e.filter(n=>!n.parentRequestId&&(n.kind==="server-request"||n.kind==="gateway-request"||n.kind==="fetch-start"||n.kind==="fetch-done")).sort((n,a)=>n.from-a.from||pa(n,a));if(r.length<2)return[e];let i=[];for(let n of r){let a=i[i.length-1];a&&n.from<=a.to+t?a.to=Math.max(a.to,n.to):i.push({from:n.from,to:n.to})}if(i.length<2)return[e];let u=i.map(()=>[]);for(let n of e){let a=i.findIndex(l=>n.ts>=l.from-t&&n.ts<=l.to+t);if(a===-1){a=0;for(let l=0;l<i.length;l+=1)i[l].from<=n.ts&&(a=l)}u[a].push(n)}return u.filter(n=>n.length>0)}s(l4,"XS"),o(l4,"occurrencesOf");var d4={debug:0,info:1,warning:2,error:3,fatal:4};function fa(e,t){let r=[],i=[];for(let u of e){let n=i[i.length-1];n&&u.ts-n.ts>=t&&(r.push(i),i=[]),i.push(u)}return i.length&&r.push(i),r}s(fa,"Qb"),o(fa,"runs");function c4(e,t={}){let r={...i4};for(let[w,k]of Object.entries(t))typeof k=="number"&&Number.isFinite(k)&&(r[w]=k);let i=new Set,u=[];for(let w of e)i.has(w.id)||(i.add(w.id),u.push(n4(w)));u.sort(pa);let n=le(u[0]?.event.context?.flowId)??le(u[0]?.event.raw?.flowId)??"",a=new Map;for(let w of u)w.kind==="queue-enqueued"&&w.queueKey&&w.requestId&&!w.requestId.startsWith("job:")&&!a.has(w.queueKey)&&a.set(w.queueKey,w);let l=new Map,d=new Map,c=[];for(let w of u){let k=o4(w),C=ma(w);if(k!==void 0){let M=d.get(k);M?M.push(w):d.set(k,[w])}else if(C!==void 0){let M=l.get(C);M?M.push(w):l.set(C,[w])}else c.push(w)}let p=[],m=new Map;for(let[w,k]of l)l4(k,r.occurrenceSlackMs).forEach((C,M)=>{let y={id:`${n}~r:${w}${M===0?"":`@${M+1}`}`,kind:"request",items:C,requestId:w};p.push(y);for(let D of C)m.set(D,y)});for(let[w,k]of d){let C=a.get(w),M=C?m.get(C):void 0;M?M.items.push(...k):p.push({id:`${n}~r:job:${w}`,kind:"request",items:k,requestId:`job:${w}`})}let f=u.filter(w=>w.kind==="fetch-done"&&ma(w)!==void 0),h=new Map;for(let w of p)w.requestId&&h.set(w.requestId,[...h.get(w.requestId)??[],w]);let g=o((w,k)=>{let C=h.get(w);if(C)return C.find(M=>M.items.some(y=>y.kind==="fetch-done"&&y.ts===k))??C[C.length-1]},"owningUnit"),b=c.filter(w=>w.browser);for(let w of fa(b,r.burstGapMs)){let k=w[0].ts,C=f.filter(D=>D.ts<=k&&k-D.ts<=r.attachWindowMs),M=[...new Set(C.map(D=>ma(D)))];if(M.length===1){let D=g(M[0],C[C.length-1].ts);if(D){D.items.push(...w);continue}}let y=w.some(D=>D.kind==="flow-origin");p.push({id:`${n}~${y?"o":"u"}:${w[0].id}`,kind:y?"origin":"ui",items:w,...M.length>1?{after:M.sort()}:{}})}for(let w of fa(c.filter(k=>!k.browser),r.phaseGapMs))p.push({id:`${n}~a:${w[0].id}`,kind:"ambient",items:w});let x=p4(n,u.length,p,r),$=xi(u.map(w=>w.event));return $?{...x,sql:$}:x}s(c4,"nw"),o(c4,"segmentFlow");function p4(e,t,r,i){for(let f of r)f.items.sort(pa);let u=r.map(f=>({unit:f,from:s4(f.items,h=>h.from),to:a4(f.items,h=>h.to)}));u.sort((f,h)=>f.from-h.from||(f.unit.id<h.unit.id?-1:1));let n=new Map,a=0,l=-1/0;for(let f of u)(a===0||f.from-l>=i.phaseGapMs)&&(a+=1),l=Math.max(l,f.to),n.set(f.unit,a);let d=[];for(let f of u){let h=m4(f.unit.items,i.maxSegmentEvents),g=f.unit.kind==="request"?xi(f.unit.items.map(b=>b.event)):void 0;h.forEach((b,x)=>{let $=f4(e,f.unit,b,n.get(f.unit),h.length>1?{index:x+1,total:h.length}:void 0);d.push(g&&x===0?{...$,sql:g}:$)})}let c={};for(let f of d)for(let h of f.eventIds)c[h]=f.id;let p=[];for(let f of d){let h=p[f.phase-1];h||(h={index:f.phase,start:f.start,end:f.end,segmentIds:[]},p[f.phase-1]=h),h.start=Math.min(h.start,f.start),h.end=Math.max(h.end,f.end),h.segmentIds.push(f.id)}let m=d.reduce((f,h)=>f+h.counts.signal,0);return{flowId:e,segments:d,phases:p.filter(Boolean),assignment:c,stats:{events:t,signal:m,bookkeeping:t-m,segments:d.length,phases:p.filter(Boolean).length,largestSegment:d.reduce((f,h)=>Math.max(f,h.counts.total),0)}}}s(p4,"HS"),o(p4,"assemble");function m4(e,t){if(e.filter(n=>!n.bookkeeping).length<=t)return[e];let r=[],i=[],u=0;for(let n of e)!n.bookkeeping&&u===t&&(r.push(i),i=[],u=0),i.push(n),n.bookkeeping||(u+=1);return i.length&&r.push(i),r}s(m4,"YS"),o(m4,"chunk");function f4(e,t,r,i,u){let n={total:r.length,signal:0,bookkeeping:0,errors:0,warnings:0},a=new Set,l="debug";for(let h of r){h.bookkeeping?n.bookkeeping+=1:n.signal+=1;let g=String(h.event.severity);g==="error"||g==="fatal"?n.errors+=1:g==="warning"&&(n.warnings+=1),(d4[g]??1)>(d4[l]??0)&&(l=g),h.project&&a.add(h.project)}let d=t.kind==="ui"||t.kind==="origin"?g4(r):[],c=s4(r,h=>h.from),p=a4(r,h=>h.to),m=h4(t.items),f=t.id;return{id:u&&u.index>1?`${f}#${u.index}`:f,flowId:e,kind:t.kind,label:v4(t,r,m,u,d),phase:i,start:c,end:p,durationMs:p-c,eventIds:r.map(h=>h.id),counts:n,projects:[...a].sort(),...m.route?{route:m.route}:{},...m.method?{method:m.method}:{},...t.requestId?{requestId:t.requestId}:{},...t.after?{after:t.after}:{},...d.length?{hot:d}:{},...u?{part:u}:{},worstSeverity:l}}s(f4,"QS"),o(f4,"toSegment");function h4(e){let t=e.find(r=>r.kind==="fetch-start"&&r.route)??e.find(r=>r.kind==="server-request"&&!r.parentRequestId&&r.route)??e.find(r=>r.kind==="gateway-request"&&r.route)??e.find(r=>r.kind==="fetch-done"&&r.route);return{...t?.route?{route:t.route}:{},...t?.method?{method:t.method.toUpperCase()}:{}}}s(h4,"eI"),o(h4,"routeOf");function g4(e){let t=new Map;for(let r of e)r.subject&&!r.bookkeeping&&t.set(r.subject,(t.get(r.subject)??0)+1);return[...t.entries()].sort((r,i)=>i[1]-r[1]||(r[0]<i[0]?-1:1)).slice(0,3).map(([r,i])=>i>1?`${r} \xD7${i}`:r)}s(g4,"tI"),o(g4,"hotOf");function v4(e,t,r,i,u){let n=i?` (part ${i.index}/${i.total})`:"";if(e.kind==="request"){if(r.route)return`${r.method?`${r.method} `:""}${r.route}${n}`;let a=t.find(l=>l.queueKey);return a?`job ${a.queueKey}${n}`:`request ${e.requestId??""}${n}`}return e.kind==="origin"?`${t.find(a=>a.kind==="flow-origin")?.event.title||"start"}${u.length?` \xB7 ${u.join(", ")}`:""}${n}`:e.kind==="ui"?`UI update${u.length?` \xB7 ${u.join(", ")}`:""}${n}`:`background${n}`}s(v4,"rI"),o(v4,"labelOf");var y4=50;function xi(e){let t=new Map,r=new Map,i=new Set;for(let g of e){if(i.has(g.id))continue;i.add(g.id);let b=tu(g.raw)?g.raw:{},x=le(b.kind),$=le(g.context?.requestId);if(!$)continue;let w=le(b.project)??le(g.context?.projectName);if(x==="db-query"&&g.source==="db"){let k=r.get($)??{count:0,workMs:0,...w?{project:w}:{}};k.count+=1,k.workMs+=De(b.durationMs)??0,r.set($,k)}else if(x===da){let k=le(b.accountId)??g.id,C=De(b.seq)??0,M=t.get(k);if(M&&M.seq>=C)continue;t.set(k,{requestId:$,...w?{project:w}:{},seq:C,basis:b.basis==="end"?"end":"settled",statements:De(b.statements)??0,failed:De(b.failed)??0,workMs:De(b.workMs)??0,recorded:De(b.recorded)??0,suppressed:De(b.suppressed)??0,unwritten:De(b.unwritten)??0})}}let u=new Map;for(let g of t.values()){let b=u.get(g.requestId);if(!b){u.set(g.requestId,{...g});continue}g.basis==="settled"&&(b.basis="settled"),b.statements+=g.statements,b.failed+=g.failed,b.workMs+=g.workMs,b.recorded+=g.recorded,b.suppressed+=g.suppressed,b.unwritten+=g.unwritten}let n=[...new Set([...r.keys(),...u.keys()])].sort();if(n.length===0)return;let a={statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0},l={statements:0,workMs:0},d=[];for(let g of n){let b=r.get(g),x=u.get(g),$=b?.count??0;l.statements+=$,l.workMs+=b?.workMs??0;let w=!x||$>x.statements?"unverified":$===x.statements?"complete":"incomplete";x&&w!=="unverified"&&(a.statements+=x.statements,a.failed+=x.failed,a.workMs+=x.workMs,a.recorded+=x.recorded,a.suppressed+=x.suppressed,a.unwritten+=x.unwritten);let k=b?.project??x?.project;d.push({requestId:g,...k?{project:k}:{},status:w,observed:$,observedWorkMs:b?.workMs??0,...x?{basis:x.basis,statements:x.statements,failed:x.failed,workMs:x.workMs,recorded:x.recorded,suppressed:x.suppressed,unwritten:x.unwritten}:{}})}let c=o(g=>d.filter(b=>b.status===g).length,"tally"),p=c("unverified"),m=c("incomplete"),f=o(g=>(g.statements??0)-g.observed,"missing"),h=d.filter(g=>g.status!=="complete").sort((g,b)=>(g.status==="incomplete"?0:1)-(b.status==="incomplete"?0:1)||f(b)-f(g)||(g.requestId<b.requestId?-1:g.requestId>b.requestId?1:0));return{status:p>0?"unverified":m>0?"incomplete":"complete",requests:d.length,complete:c("complete"),incomplete:m,unverified:p,settled:d.filter(g=>g.status!=="unverified"&&g.basis==="settled").length,observed:l,accounted:a,gaps:h.slice(0,y4),gapsTruncated:h.length>y4}}s(xi,"si"),o(xi,"sqlAccountingOf");var v={};ut(v,{$brand:s(()=>D4,"$brand"),$input:s(()=>rv,"$input"),$output:s(()=>uv,"$output"),NEVER:s(()=>w4,"NEVER"),TimePrecision:s(()=>nv,"TimePrecision"),ZodAny:s(()=>cl,"ZodAny"),ZodArray:s(()=>yl,"ZodArray"),ZodBase64:s(()=>wn,"ZodBase64"),ZodBase64URL:s(()=>Dn,"ZodBase64URL"),ZodBigInt:s(()=>Ar,"ZodBigInt"),ZodBigIntFormat:s(()=>kn,"ZodBigIntFormat"),ZodBoolean:s(()=>kr,"ZodBoolean"),ZodCIDRv4:s(()=>En,"ZodCIDRv4"),ZodCIDRv6:s(()=>bn,"ZodCIDRv6"),ZodCUID:s(()=>pn,"ZodCUID"),ZodCUID2:s(()=>mn,"ZodCUID2"),ZodCatch:s(()=>Gl,"ZodCatch"),ZodCodec:s(()=>Or,"ZodCodec"),ZodCustom:s(()=>Tr,"ZodCustom"),ZodCustomStringFormat:s(()=>mu,"ZodCustomStringFormat"),ZodDate:s(()=>In,"ZodDate"),ZodDefault:s(()=>Ll,"ZodDefault"),ZodDiscriminatedUnion:s(()=>xl,"ZodDiscriminatedUnion"),ZodE164:s(()=>$n,"ZodE164"),ZodEmail:s(()=>ln,"ZodEmail"),ZodEmoji:s(()=>dn,"ZodEmoji"),ZodEnum:s(()=>gu,"ZodEnum"),ZodError:s(()=>lD,"ZodError"),ZodExactOptional:s(()=>Ul,"ZodExactOptional"),ZodFile:s(()=>Rl,"ZodFile"),ZodFirstPartyTypeKind:s(()=>pd,"ZodFirstPartyTypeKind"),ZodFunction:s(()=>sd,"ZodFunction"),ZodGUID:s(()=>$r,"ZodGUID"),ZodIPv4:s(()=>vn,"ZodIPv4"),ZodIPv6:s(()=>yn,"ZodIPv6"),ZodISODate:s(()=>y0,"ZodISODate"),ZodISODateTime:s(()=>g0,"ZodISODateTime"),ZodISODuration:s(()=>D0,"ZodISODuration"),ZodISOTime:s(()=>b0,"ZodISOTime"),ZodIntersection:s(()=>kl,"ZodIntersection"),ZodIssueCode:s(()=>dD,"ZodIssueCode"),ZodJWT:s(()=>Bn,"ZodJWT"),ZodKSUID:s(()=>gn,"ZodKSUID"),ZodLazy:s(()=>rd,"ZodLazy"),ZodLiteral:s(()=>Ml,"ZodLiteral"),ZodMAC:s(()=>P0,"ZodMAC"),ZodMap:s(()=>Sl,"ZodMap"),ZodNaN:s(()=>Kl,"ZodNaN"),ZodNanoID:s(()=>cn,"ZodNanoID"),ZodNever:s(()=>fl,"ZodNever"),ZodNonOptional:s(()=>On,"ZodNonOptional"),ZodNull:s(()=>dl,"ZodNull"),ZodNullable:s(()=>ql,"ZodNullable"),ZodNumber:s(()=>xr,"ZodNumber"),ZodNumberFormat:s(()=>Pt,"ZodNumberFormat"),ZodObject:s(()=>_r,"ZodObject"),ZodOptional:s(()=>jn,"ZodOptional"),ZodPipe:s(()=>Nr,"ZodPipe"),ZodPrefault:s(()=>Vl,"ZodPrefault"),ZodPreprocess:s(()=>Ql,"ZodPreprocess"),ZodPromise:s(()=>id,"ZodPromise"),ZodReadonly:s(()=>ed,"ZodReadonly"),ZodRealError:s(()=>Ne,"ZodRealError"),ZodRecord:s(()=>hu,"ZodRecord"),ZodSet:s(()=>jl,"ZodSet"),ZodString:s(()=>Dr,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>Jl,"ZodSuccess"),ZodSymbol:s(()=>sl,"ZodSymbol"),ZodTemplateLiteral:s(()=>td,"ZodTemplateLiteral"),ZodTransform:s(()=>Pl,"ZodTransform"),ZodTuple:s(()=>Al,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>fn,"ZodULID"),ZodURL:s(()=>Br,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>ol,"ZodUndefined"),ZodUnion:s(()=>Sr,"ZodUnion"),ZodUnknown:s(()=>ml,"ZodUnknown"),ZodVoid:s(()=>hl,"ZodVoid"),ZodXID:s(()=>hn,"ZodXID"),ZodXor:s(()=>$l,"ZodXor"),_ZodString:s(()=>on,"_ZodString"),_default:s(()=>Nn,"_default"),_function:s(()=>Rr,"_function"),any:s(()=>pl,"any"),array:s(()=>fu,"array"),base64:s(()=>V0,"base64"),base64url:s(()=>J0,"base64url"),bigint:s(()=>rl,"bigint"),boolean:s(()=>Cn,"boolean"),catch:s(()=>Tn,"catch"),check:s(()=>ad,"check"),cidrv4:s(()=>Z0,"cidrv4"),cidrv6:s(()=>L0,"cidrv6"),clone:s(()=>Se,"clone"),codec:s(()=>Xl,"codec"),coerce:s(()=>O1,"coerce"),config:s(()=>be,"config"),core:s(()=>E4,"core"),cuid:s(()=>z0,"cuid"),cuid2:s(()=>N0,"cuid2"),custom:s(()=>od,"custom"),date:s(()=>vl,"date"),decode:s(()=>w1,"decode"),decodeAsync:s(()=>$1,"decodeAsync"),describe:s(()=>I1,"describe"),discriminatedUnion:s(()=>Cl,"discriminatedUnion"),e164:s(()=>W0,"e164"),email:s(()=>B0,"email"),emoji:s(()=>F0,"emoji"),encode:s(()=>b1,"encode"),encodeAsync:s(()=>D1,"encodeAsync"),endsWith:s(()=>fr,"endsWith"),enum:s(()=>jr,"enum"),exactOptional:s(()=>zn,"exactOptional"),file:s(()=>Tl,"file"),flattenError:s(()=>_i,"flattenError"),float32:s(()=>Q0,"float32"),float64:s(()=>el,"float64"),formatError:s(()=>Si,"formatError"),fromJSONSchema:s(()=>M1,"fromJSONSchema"),function:s(()=>Rr,"function"),getErrorMap:s(()=>j1,"getErrorMap"),globalRegistry:s(()=>Re,"globalRegistry"),gt:s(()=>nt,"gt"),gte:s(()=>Ce,"gte"),guid:s(()=>x0,"guid"),hash:s(()=>Y0,"hash"),hex:s(()=>X0,"hex"),hostname:s(()=>H0,"hostname"),httpUrl:s(()=>S0,"httpUrl"),includes:s(()=>pr,"includes"),instanceof:s(()=>ld,"instanceof"),int:s(()=>Cr,"int"),int32:s(()=>tl,"int32"),int64:s(()=>il,"int64"),intersection:s(()=>_n,"intersection"),invertCodec:s(()=>Yl,"invertCodec"),ipv4:s(()=>T0,"ipv4"),ipv6:s(()=>q0,"ipv6"),iso:s(()=>h0,"iso"),json:s(()=>dd,"json"),jwt:s(()=>G0,"jwt"),keyof:s(()=>El,"keyof"),ksuid:s(()=>R0,"ksuid"),lazy:s(()=>Un,"lazy"),length:s(()=>lu,"length"),literal:s(()=>Ol,"literal"),locales:s(()=>yo,"locales"),looseObject:s(()=>Dl,"looseObject"),looseRecord:s(()=>_l,"looseRecord"),lowercase:s(()=>dr,"lowercase"),lt:s(()=>it,"lt"),lte:s(()=>ze,"lte"),mac:s(()=>U0,"mac"),map:s(()=>Fl,"map"),maxLength:s(()=>ou,"maxLength"),maxSize:s(()=>Mt,"maxSize"),meta:s(()=>_1,"meta"),mime:s(()=>hr,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Nt,"multipleOf"),nan:s(()=>Hl,"nan"),nanoid:s(()=>j0,"nanoid"),nativeEnum:s(()=>Nl,"nativeEnum"),negative:s(()=>rn,"negative"),never:s(()=>Ir,"never"),nonnegative:s(()=>sn,"nonnegative"),nonoptional:s(()=>Rn,"nonoptional"),nonpositive:s(()=>nn,"nonpositive"),normalize:s(()=>gr,"normalize"),null:s(()=>An,"null"),nullable:s(()=>yu,"nullable"),nullish:s(()=>Zl,"nullish"),number:s(()=>xn,"number"),object:s(()=>bl,"object"),optional:s(()=>vu,"optional"),overwrite:s(()=>Ke,"overwrite"),parse:s(()=>g1,"parse"),parseAsync:s(()=>v1,"parseAsync"),partialRecord:s(()=>Il,"partialRecord"),pipe:s(()=>Mr,"pipe"),positive:s(()=>un,"positive"),prefault:s(()=>Mn,"prefault"),preprocess:s(()=>cd,"preprocess"),prettifyError:s(()=>Ca,"prettifyError"),promise:s(()=>nd,"promise"),property:s(()=>an,"property"),readonly:s(()=>Pn,"readonly"),record:s(()=>Fn,"record"),refine:s(()=>qn,"refine"),regex:s(()=>lr,"regex"),regexes:s(()=>ft,"regexes"),registry:s(()=>Ni,"registry"),safeDecode:s(()=>x1,"safeDecode"),safeDecodeAsync:s(()=>k1,"safeDecodeAsync"),safeEncode:s(()=>B1,"safeEncode"),safeEncodeAsync:s(()=>C1,"safeEncodeAsync"),safeParse:s(()=>y1,"safeParse"),safeParseAsync:s(()=>E1,"safeParseAsync"),set:s(()=>zl,"set"),setErrorMap:s(()=>F1,"setErrorMap"),size:s(()=>au,"size"),slugify:s(()=>br,"slugify"),startsWith:s(()=>mr,"startsWith"),strictObject:s(()=>wl,"strictObject"),string:s(()=>pu,"string"),stringFormat:s(()=>K0,"stringFormat"),stringbool:s(()=>S1,"stringbool"),success:s(()=>Wl,"success"),superRefine:s(()=>Zn,"superRefine"),symbol:s(()=>al,"symbol"),templateLiteral:s(()=>ud,"templateLiteral"),toJSONSchema:s(()=>f0,"toJSONSchema"),toLowerCase:s(()=>yr,"toLowerCase"),toUpperCase:s(()=>Er,"toUpperCase"),transform:s(()=>zr,"transform"),treeifyError:s(()=>Ba,"treeifyError"),trim:s(()=>vr,"trim"),tuple:s(()=>Sn,"tuple"),uint32:s(()=>ul,"uint32"),uint64:s(()=>nl,"uint64"),ulid:s(()=>M0,"ulid"),undefined:s(()=>ll,"undefined"),union:s(()=>Fr,"union"),unknown:s(()=>gt,"unknown"),uppercase:s(()=>cr,"uppercase"),url:s(()=>_0,"url"),util:s(()=>te,"util"),uuid:s(()=>C0,"uuid"),uuidv4:s(()=>k0,"uuidv4"),uuidv6:s(()=>A0,"uuidv6"),uuidv7:s(()=>I0,"uuidv7"),void:s(()=>gl,"void"),xid:s(()=>O0,"xid"),xor:s(()=>Bl,"xor")});var E4={};ut(E4,{$ZodAny:s(()=>kh,"$ZodAny"),$ZodArray:s(()=>Fh,"$ZodArray"),$ZodAsyncError:s(()=>Ft,"$ZodAsyncError"),$ZodBase64:s(()=>vh,"$ZodBase64"),$ZodBase64URL:s(()=>yh,"$ZodBase64URL"),$ZodBigInt:s(()=>Ha,"$ZodBigInt"),$ZodBigIntFormat:s(()=>$h,"$ZodBigIntFormat"),$ZodBoolean:s(()=>Ka,"$ZodBoolean"),$ZodCIDRv4:s(()=>hh,"$ZodCIDRv4"),$ZodCIDRv6:s(()=>gh,"$ZodCIDRv6"),$ZodCUID:s(()=>rh,"$ZodCUID"),$ZodCUID2:s(()=>ih,"$ZodCUID2"),$ZodCatch:s(()=>Xh,"$ZodCatch"),$ZodCheck:s(()=>de,"$ZodCheck"),$ZodCheckBigIntFormat:s(()=>jf,"$ZodCheckBigIntFormat"),$ZodCheckEndsWith:s(()=>Vf,"$ZodCheckEndsWith"),$ZodCheckGreaterThan:s(()=>La,"$ZodCheckGreaterThan"),$ZodCheckIncludes:s(()=>Zf,"$ZodCheckIncludes"),$ZodCheckLengthEquals:s(()=>Tf,"$ZodCheckLengthEquals"),$ZodCheckLessThan:s(()=>Za,"$ZodCheckLessThan"),$ZodCheckLowerCase:s(()=>Uf,"$ZodCheckLowerCase"),$ZodCheckMaxLength:s(()=>Of,"$ZodCheckMaxLength"),$ZodCheckMaxSize:s(()=>zf,"$ZodCheckMaxSize"),$ZodCheckMimeType:s(()=>Wf,"$ZodCheckMimeType"),$ZodCheckMinLength:s(()=>Rf,"$ZodCheckMinLength"),$ZodCheckMinSize:s(()=>Nf,"$ZodCheckMinSize"),$ZodCheckMultipleOf:s(()=>Sf,"$ZodCheckMultipleOf"),$ZodCheckNumberFormat:s(()=>Ff,"$ZodCheckNumberFormat"),$ZodCheckOverwrite:s(()=>Gf,"$ZodCheckOverwrite"),$ZodCheckProperty:s(()=>Jf,"$ZodCheckProperty"),$ZodCheckRegex:s(()=>Pf,"$ZodCheckRegex"),$ZodCheckSizeEquals:s(()=>Mf,"$ZodCheckSizeEquals"),$ZodCheckStartsWith:s(()=>Lf,"$ZodCheckStartsWith"),$ZodCheckStringFormat:s(()=>er,"$ZodCheckStringFormat"),$ZodCheckUpperCase:s(()=>qf,"$ZodCheckUpperCase"),$ZodCodec:s(()=>ho,"$ZodCodec"),$ZodCustom:s(()=>ng,"$ZodCustom"),$ZodCustomStringFormat:s(()=>wh,"$ZodCustomStringFormat"),$ZodDate:s(()=>Sh,"$ZodDate"),$ZodDefault:s(()=>Wh,"$ZodDefault"),$ZodDiscriminatedUnion:s(()=>Mh,"$ZodDiscriminatedUnion"),$ZodE164:s(()=>Eh,"$ZodE164"),$ZodEmail:s(()=>Qf,"$ZodEmail"),$ZodEmoji:s(()=>th,"$ZodEmoji"),$ZodEncodeError:s(()=>Ci,"$ZodEncodeError"),$ZodEnum:s(()=>Uh,"$ZodEnum"),$ZodError:s(()=>$a,"$ZodError"),$ZodExactOptional:s(()=>Vh,"$ZodExactOptional"),$ZodFile:s(()=>Zh,"$ZodFile"),$ZodFunction:s(()=>ug,"$ZodFunction"),$ZodGUID:s(()=>Xf,"$ZodGUID"),$ZodIPv4:s(()=>ph,"$ZodIPv4"),$ZodIPv6:s(()=>mh,"$ZodIPv6"),$ZodISODate:s(()=>lh,"$ZodISODate"),$ZodISODateTime:s(()=>oh,"$ZodISODateTime"),$ZodISODuration:s(()=>ch,"$ZodISODuration"),$ZodISOTime:s(()=>dh,"$ZodISOTime"),$ZodIntersection:s(()=>Oh,"$ZodIntersection"),$ZodJWT:s(()=>bh,"$ZodJWT"),$ZodKSUID:s(()=>ah,"$ZodKSUID"),$ZodLazy:s(()=>ig,"$ZodLazy"),$ZodLiteral:s(()=>qh,"$ZodLiteral"),$ZodMAC:s(()=>fh,"$ZodMAC"),$ZodMap:s(()=>Th,"$ZodMap"),$ZodNaN:s(()=>Yh,"$ZodNaN"),$ZodNanoID:s(()=>uh,"$ZodNanoID"),$ZodNever:s(()=>Ih,"$ZodNever"),$ZodNonOptional:s(()=>Kh,"$ZodNonOptional"),$ZodNull:s(()=>Ch,"$ZodNull"),$ZodNullable:s(()=>Jh,"$ZodNullable"),$ZodNumber:s(()=>Ga,"$ZodNumber"),$ZodNumberFormat:s(()=>Dh,"$ZodNumberFormat"),$ZodObject:s(()=>jh,"$ZodObject"),$ZodObjectJIT:s(()=>zh,"$ZodObjectJIT"),$ZodOptional:s(()=>co,"$ZodOptional"),$ZodPipe:s(()=>fo,"$ZodPipe"),$ZodPrefault:s(()=>Gh,"$ZodPrefault"),$ZodPreprocess:s(()=>Qh,"$ZodPreprocess"),$ZodPromise:s(()=>rg,"$ZodPromise"),$ZodReadonly:s(()=>eg,"$ZodReadonly"),$ZodRealError:s(()=>je,"$ZodRealError"),$ZodRecord:s(()=>Rh,"$ZodRecord"),$ZodRegistry:s(()=>iv,"$ZodRegistry"),$ZodSet:s(()=>Ph,"$ZodSet"),$ZodString:s(()=>tr,"$ZodString"),$ZodStringFormat:s(()=>se,"$ZodStringFormat"),$ZodSuccess:s(()=>Hh,"$ZodSuccess"),$ZodSymbol:s(()=>Bh,"$ZodSymbol"),$ZodTemplateLiteral:s(()=>tg,"$ZodTemplateLiteral"),$ZodTransform:s(()=>Lh,"$ZodTransform"),$ZodTuple:s(()=>ro,"$ZodTuple"),$ZodType:s(()=>X,"$ZodType"),$ZodULID:s(()=>nh,"$ZodULID"),$ZodURL:s(()=>eh,"$ZodURL"),$ZodUUID:s(()=>Yf,"$ZodUUID"),$ZodUndefined:s(()=>xh,"$ZodUndefined"),$ZodUnion:s(()=>ji,"$ZodUnion"),$ZodUnknown:s(()=>Ah,"$ZodUnknown"),$ZodVoid:s(()=>_h,"$ZodVoid"),$ZodXID:s(()=>sh,"$ZodXID"),$ZodXor:s(()=>Nh,"$ZodXor"),$brand:s(()=>D4,"$brand"),$constructor:s(()=>B,"$constructor"),$input:s(()=>rv,"$input"),$output:s(()=>uv,"$output"),Doc:s(()=>Kf,"Doc"),JSONSchema:s(()=>oD,"JSONSchema"),JSONSchemaGenerator:s(()=>aD,"JSONSchemaGenerator"),NEVER:s(()=>w4,"NEVER"),TimePrecision:s(()=>nv,"TimePrecision"),_any:s(()=>Ko,"_any"),_array:s(()=>u0,"_array"),_base64:s(()=>Yi,"_base64"),_base64url:s(()=>Qi,"_base64url"),_bigint:s(()=>qo,"_bigint"),_boolean:s(()=>Po,"_boolean"),_catch:s(()=>$v,"_catch"),_check:s(()=>a0,"_check"),_cidrv4:s(()=>Hi,"_cidrv4"),_cidrv6:s(()=>Xi,"_cidrv6"),_coercedBigint:s(()=>Zo,"_coercedBigint"),_coercedBoolean:s(()=>Uo,"_coercedBoolean"),_coercedDate:s(()=>e0,"_coercedDate"),_coercedNumber:s(()=>zo,"_coercedNumber"),_coercedString:s(()=>ko,"_coercedString"),_cuid:s(()=>Zi,"_cuid"),_cuid2:s(()=>Li,"_cuid2"),_custom:s(()=>i0,"_custom"),_date:s(()=>Qo,"_date"),_decode:s(()=>_a,"_decode"),_decodeAsync:s(()=>Fa,"_decodeAsync"),_default:s(()=>bv,"_default"),_discriminatedUnion:s(()=>ov,"_discriminatedUnion"),_e164:s(()=>en,"_e164"),_email:s(()=>Mi,"_email"),_emoji:s(()=>Ui,"_emoji"),_encode:s(()=>Ia,"_encode"),_encodeAsync:s(()=>Sa,"_encodeAsync"),_endsWith:s(()=>fr,"_endsWith"),_enum:s(()=>fv,"_enum"),_file:s(()=>r0,"_file"),_float32:s(()=>Mo,"_float32"),_float64:s(()=>Oo,"_float64"),_gt:s(()=>nt,"_gt"),_gte:s(()=>Ce,"_gte"),_guid:s(()=>ar,"_guid"),_includes:s(()=>pr,"_includes"),_int:s(()=>No,"_int"),_int32:s(()=>Ro,"_int32"),_int64:s(()=>Lo,"_int64"),_intersection:s(()=>lv,"_intersection"),_ipv4:s(()=>Gi,"_ipv4"),_ipv6:s(()=>Ki,"_ipv6"),_isoDate:s(()=>_o,"_isoDate"),_isoDateTime:s(()=>Io,"_isoDateTime"),_isoDuration:s(()=>Fo,"_isoDuration"),_isoTime:s(()=>So,"_isoTime"),_jwt:s(()=>tn,"_jwt"),_ksuid:s(()=>Wi,"_ksuid"),_lazy:s(()=>kv,"_lazy"),_length:s(()=>lu,"_length"),_literal:s(()=>gv,"_literal"),_lowercase:s(()=>dr,"_lowercase"),_lt:s(()=>it,"_lt"),_lte:s(()=>ze,"_lte"),_mac:s(()=>Ao,"_mac"),_map:s(()=>pv,"_map"),_max:s(()=>ze,"_max"),_maxLength:s(()=>ou,"_maxLength"),_maxSize:s(()=>Mt,"_maxSize"),_mime:s(()=>hr,"_mime"),_min:s(()=>Ce,"_min"),_minLength:s(()=>ht,"_minLength"),_minSize:s(()=>st,"_minSize"),_multipleOf:s(()=>Nt,"_multipleOf"),_nan:s(()=>t0,"_nan"),_nanoid:s(()=>qi,"_nanoid"),_nativeEnum:s(()=>hv,"_nativeEnum"),_negative:s(()=>rn,"_negative"),_never:s(()=>Xo,"_never"),_nonnegative:s(()=>sn,"_nonnegative"),_nonoptional:s(()=>wv,"_nonoptional"),_nonpositive:s(()=>nn,"_nonpositive"),_normalize:s(()=>gr,"_normalize"),_null:s(()=>Go,"_null"),_nullable:s(()=>Ev,"_nullable"),_number:s(()=>jo,"_number"),_optional:s(()=>yv,"_optional"),_overwrite:s(()=>Ke,"_overwrite"),_parse:s(()=>Hu,"_parse"),_parseAsync:s(()=>Xu,"_parseAsync"),_pipe:s(()=>Bv,"_pipe"),_positive:s(()=>un,"_positive"),_promise:s(()=>Av,"_promise"),_property:s(()=>an,"_property"),_readonly:s(()=>xv,"_readonly"),_record:s(()=>cv,"_record"),_refine:s(()=>n0,"_refine"),_regex:s(()=>lr,"_regex"),_safeDecode:s(()=>za,"_safeDecode"),_safeDecodeAsync:s(()=>Ma,"_safeDecodeAsync"),_safeEncode:s(()=>ja,"_safeEncode"),_safeEncodeAsync:s(()=>Na,"_safeEncodeAsync"),_safeParse:s(()=>Yu,"_safeParse"),_safeParseAsync:s(()=>Qu,"_safeParseAsync"),_set:s(()=>mv,"_set"),_size:s(()=>au,"_size"),_slugify:s(()=>br,"_slugify"),_startsWith:s(()=>mr,"_startsWith"),_string:s(()=>Co,"_string"),_stringFormat:s(()=>du,"_stringFormat"),_stringbool:s(()=>d0,"_stringbool"),_success:s(()=>Dv,"_success"),_superRefine:s(()=>s0,"_superRefine"),_symbol:s(()=>Jo,"_symbol"),_templateLiteral:s(()=>Cv,"_templateLiteral"),_toLowerCase:s(()=>yr,"_toLowerCase"),_toUpperCase:s(()=>Er,"_toUpperCase"),_transform:s(()=>vv,"_transform"),_trim:s(()=>vr,"_trim"),_tuple:s(()=>dv,"_tuple"),_uint32:s(()=>To,"_uint32"),_uint64:s(()=>Vo,"_uint64"),_ulid:s(()=>Vi,"_ulid"),_undefined:s(()=>Wo,"_undefined"),_union:s(()=>sv,"_union"),_unknown:s(()=>Ho,"_unknown"),_uppercase:s(()=>cr,"_uppercase"),_url:s(()=>or,"_url"),_uuid:s(()=>Oi,"_uuid"),_uuidv4:s(()=>Ri,"_uuidv4"),_uuidv6:s(()=>Ti,"_uuidv6"),_uuidv7:s(()=>Pi,"_uuidv7"),_void:s(()=>Yo,"_void"),_xid:s(()=>Ji,"_xid"),_xor:s(()=>av,"_xor"),clone:s(()=>Se,"clone"),config:s(()=>be,"config"),createStandardJSONSchemaMethod:s(()=>wr,"createStandardJSONSchemaMethod"),createToJSONSchemaMethod:s(()=>Iv,"createToJSONSchemaMethod"),decode:s(()=>_5,"decode"),decodeAsync:s(()=>F5,"decodeAsync"),describe:s(()=>o0,"describe"),encode:s(()=>I5,"encode"),encodeAsync:s(()=>S5,"encodeAsync"),extractDefs:s(()=>Rt,"extractDefs"),finalize:s(()=>Tt,"finalize"),flattenError:s(()=>_i,"flattenError"),formatError:s(()=>Si,"formatError"),globalConfig:s(()=>Lu,"globalConfig"),globalRegistry:s(()=>Re,"globalRegistry"),initializeContext:s(()=>Ot,"initializeContext"),isValidBase64:s(()=>Fi,"isValidBase64"),isValidBase64URL:s(()=>Ja,"isValidBase64URL"),isValidJWT:s(()=>Wa,"isValidJWT"),locales:s(()=>yo,"locales"),meta:s(()=>l0,"meta"),parse:s(()=>ka,"parse"),parseAsync:s(()=>Aa,"parseAsync"),prettifyError:s(()=>Ca,"prettifyError"),process:s(()=>ie,"process"),regexes:s(()=>ft,"regexes"),registry:s(()=>Ni,"registry"),safeDecode:s(()=>z5,"safeDecode"),safeDecodeAsync:s(()=>M5,"safeDecodeAsync"),safeEncode:s(()=>j5,"safeEncode"),safeEncodeAsync:s(()=>N5,"safeEncodeAsync"),safeParse:s(()=>Q4,"safeParse"),safeParseAsync:s(()=>ef,"safeParseAsync"),toDotPath:s(()=>xa,"toDotPath"),toJSONSchema:s(()=>f0,"toJSONSchema"),treeifyError:s(()=>Ba,"treeifyError"),util:s(()=>te,"util"),version:s(()=>Hf,"version")});var b4,w4=Object.freeze({status:"aborted"});function B(e,t,r){function i(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let c=a.prototype,p=Object.keys(c);for(let m=0;m<p.length;m++){let f=p[m];f in l||(l[f]=c[f].bind(l))}}s(i,"o"),o(i,"init");let u=r?.Parent??Object;class n extends u{static{s(this,"i")}static{o(this,"Definition")}}Object.defineProperty(n,"name",{value:e});function a(l){var d;let c=r?.Parent?new n:this;i(c,l),(d=c._zod).deferred??(d.deferred=[]);for(let p of c._zod.deferred)p();return c}return s(a,"s"),o(a,"_"),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(a,"name",{value:e}),a}s(B,"k"),o(B,"$constructor");var D4=Symbol("zod_brand"),Ft=class extends Error{static{s(this,"Qe")}static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ci=class extends Error{static{s(this,"St")}static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(b4=globalThis).__zod_globalConfig??(b4.__zod_globalConfig={});var Lu=globalThis.__zod_globalConfig;function be(e){return e&&Object.assign(Lu,e),Lu}s(be,"fe"),o(be,"config");var te={};ut(te,{BIGINT_FORMAT_RANGES:s(()=>T4,"BIGINT_FORMAT_RANGES"),Class:s(()=>A5,"Class"),NUMBER_FORMAT_RANGES:s(()=>R4,"NUMBER_FORMAT_RANGES"),aborted:s(()=>mt,"aborted"),allowsEval:s(()=>z4,"allowsEval"),assert:s(()=>k4,"assert"),assertEqual:s(()=>$4,"assertEqual"),assertIs:s(()=>x4,"assertIs"),assertNever:s(()=>C4,"assertNever"),assertNotEqual:s(()=>B4,"assertNotEqual"),assignProp:s(()=>rt,"assignProp"),base64ToUint8Array:s(()=>wa,"base64ToUint8Array"),base64urlToUint8Array:s(()=>G4,"base64urlToUint8Array"),cached:s(()=>uu,"cached"),captureStackTrace:s(()=>va,"captureStackTrace"),cleanEnum:s(()=>W4,"cleanEnum"),cleanRegex:s(()=>Ju,"cleanRegex"),clone:s(()=>Se,"clone"),cloneDef:s(()=>_4,"cloneDef"),createTransparentProxy:s(()=>O4,"createTransparentProxy"),defineLazy:s(()=>ee,"defineLazy"),esc:s(()=>Ai,"esc"),escapeRegex:s(()=>Ge,"escapeRegex"),explicitlyAborted:s(()=>ba,"explicitlyAborted"),extend:s(()=>q4,"extend"),finalizeIssue:s(()=>Ae,"finalizeIssue"),floatSafeRemainder:s(()=>ha,"floatSafeRemainder"),getElementAtPath:s(()=>S4,"getElementAtPath"),getEnumValues:s(()=>ki,"getEnumValues"),getLengthableOrigin:s(()=>Gu,"getLengthableOrigin"),getParsedType:s(()=>k5,"getParsedType"),getSizableOrigin:s(()=>Wu,"getSizableOrigin"),hexToUint8Array:s(()=>H4,"hexToUint8Array"),isObject:s(()=>jt,"isObject"),isPlainObject:s(()=>pt,"isPlainObject"),issue:s(()=>Ku,"issue"),joinValues:s(()=>O,"joinValues"),jsonStringifyReplacer:s(()=>Vu,"jsonStringifyReplacer"),merge:s(()=>L4,"merge"),mergeDefs:s(()=>We,"mergeDefs"),normalizeParams:s(()=>T,"normalizeParams"),nullish:s(()=>ct,"nullish"),numKeys:s(()=>N4,"numKeys"),objectClone:s(()=>I4,"objectClone"),omit:s(()=>U4,"omit"),optionalKeys:s(()=>Ea,"optionalKeys"),parsedType:s(()=>G,"parsedType"),partial:s(()=>V4,"partial"),pick:s(()=>P4,"pick"),prefixIssues:s(()=>Fe,"prefixIssues"),primitiveTypes:s(()=>M4,"primitiveTypes"),promiseAllObject:s(()=>F4,"promiseAllObject"),propertyKeyTypes:s(()=>Ii,"propertyKeyTypes"),randomString:s(()=>j4,"randomString"),required:s(()=>J4,"required"),safeExtend:s(()=>Z4,"safeExtend"),shallowClone:s(()=>ya,"shallowClone"),slugify:s(()=>ga,"slugify"),stringifyPrimitive:s(()=>J,"stringifyPrimitive"),uint8ArrayToBase64:s(()=>Da,"uint8ArrayToBase64"),uint8ArrayToBase64url:s(()=>K4,"uint8ArrayToBase64url"),uint8ArrayToHex:s(()=>X4,"uint8ArrayToHex"),unwrapMessage:s(()=>ru,"unwrapMessage")});function $4(e){return e}s($4,"nI"),o($4,"assertEqual");function B4(e){return e}s(B4,"oI"),o(B4,"assertNotEqual");function x4(e){}s(x4,"iI"),o(x4,"assertIs");function C4(e){throw new Error("Unexpected value in exhaustive check")}s(C4,"sI"),o(C4,"assertNever");function k4(e){}s(k4,"aI"),o(k4,"assert");function ki(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}s(ki,"In"),o(ki,"getEnumValues");function O(e,t="|"){return e.map(r=>J(r)).join(t)}s(O,"R"),o(O,"joinValues");function Vu(e,t){return typeof t=="bigint"?t.toString():t}s(Vu,"wr"),o(Vu,"jsonStringifyReplacer");function uu(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}s(uu,"xr"),o(uu,"cached");function ct(e){return e==null}s(ct,"It"),o(ct,"nullish");function Ju(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}s(Ju,"Rn"),o(Ju,"cleanRegex");function ha(e,t){let r=e/t,i=Math.round(r),u=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<u?0:r-i}s(ha,"Sc"),o(ha,"floatSafeRemainder");var A4=Symbol("evaluating");function ee(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==A4)return i===void 0&&(i=A4,i=r()),i},set(u){Object.defineProperty(e,t,{value:u})},configurable:!0})}s(ee,"Q"),o(ee,"defineLazy");function I4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}s(I4,"cI"),o(I4,"objectClone");function rt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(rt,"Rt"),o(rt,"assignProp");function We(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}s(We,"gt"),o(We,"mergeDefs");function _4(e){return We(e._zod.def)}s(_4,"uI"),o(_4,"cloneDef");function S4(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}s(S4,"lI"),o(S4,"getElementAtPath");function F4(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let u={};for(let n=0;n<t.length;n++)u[t[n]]=i[n];return u})}s(F4,"dI"),o(F4,"promiseAllObject");function j4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}s(j4,"pI"),o(j4,"randomString");function Ai(e){return JSON.stringify(e)}s(Ai,"ai"),o(Ai,"esc");function ga(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}s(ga,"Ic"),o(ga,"slugify");var va="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(jt,"Yt"),o(jt,"isObject");var z4=uu(()=>{if(Lu.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function pt(e){if(jt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(jt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(pt,"Et"),o(pt,"isPlainObject");function ya(e){return pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}s(ya,"Ec"),o(ya,"shallowClone");function N4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}s(N4,"fI"),o(N4,"numKeys");var k5=o(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}`)}},"getParsedType"),Ii=new Set(["string","number","symbol"]),M4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Ge,"Je"),o(Ge,"escapeRegex");function Se(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}s(Se,"Te"),o(Se,"clone");function T(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};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:o(()=>t.error,"error")}:t}s(T,"B"),o(T,"normalizeParams");function O4(e){let t;return new Proxy({},{get(r,i,u){return t??(t=e()),Reflect.get(t,i,u)},set(r,i,u,n){return t??(t=e()),Reflect.set(t,i,u,n)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,u){return t??(t=e()),Reflect.defineProperty(t,i,u)}})}s(O4,"hI"),o(O4,"createTransparentProxy");function J(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}s(J,"D"),o(J,"stringifyPrimitive");function Ea(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}s(Ea,"Ac"),o(Ea,"optionalKeys");var R4={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]},T4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function P4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let n={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(n[a]=r.shape[a])}return rt(this,"shape",n),n},checks:[]});return Se(e,u)}s(P4,"gI"),o(P4,"pick");function U4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete n[a]}return rt(this,"shape",n),n},checks:[]});return Se(e,u)}s(U4,"vI"),o(U4,"omit");function q4(e,t){if(!pt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let u=e._zod.def.shape;for(let n in t)if(Object.getOwnPropertyDescriptor(u,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=We(e._zod.def,{get shape(){let u={...e._zod.def.shape,...t};return rt(this,"shape",u),u}});return Se(e,i)}s(q4,"yI"),o(q4,"extend");function Z4(e,t){if(!pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=We(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return rt(this,"shape",i),i}});return Se(e,r)}s(Z4,"bI"),o(Z4,"safeExtend");function L4(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=We(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return rt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Se(e,r)}s(L4,"wI"),o(L4,"merge");function V4(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let u=We(t._zod.def,{get shape(){let n=t._zod.def.shape,a={...n};if(r)for(let l in r){if(!(l in n))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(a[l]=e?new e({type:"optional",innerType:n[l]}):n[l])}else for(let l in n)a[l]=e?new e({type:"optional",innerType:n[l]}):n[l];return rt(this,"shape",a),a},checks:[]});return Se(t,u)}s(V4,"xI"),o(V4,"partial");function J4(e,t,r){let i=We(t._zod.def,{get shape(){let u=t._zod.def.shape,n={...u};if(r)for(let a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(n[a]=new e({type:"nonoptional",innerType:u[a]}))}else for(let a in u)n[a]=new e({type:"nonoptional",innerType:u[a]});return rt(this,"shape",n),n}});return Se(t,i)}s(J4,"$I"),o(J4,"required");function mt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}s(mt,"Tt"),o(mt,"aborted");function ba(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}s(ba,"Oc"),o(ba,"explicitlyAborted");function Fe(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}s(Fe,"Oe"),o(Fe,"prefixIssues");function ru(e){return typeof e=="string"?e:e?.message}s(ru,"Sn"),o(ru,"unwrapMessage");function Ae(e,t,r){let i=e.message?e.message:ru(e.inst?._zod.def?.error?.(e))??ru(t?.error?.(e))??ru(r.customError?.(e))??ru(r.localeError?.(e))??"Invalid input",{inst:u,continue:n,input:a,...l}=e;return l.path??(l.path=[]),l.message=i,t?.reportInput&&(l.input=a),l}s(Ae,"Ae"),o(Ae,"finalizeIssue");function Wu(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}s(Wu,"Tn"),o(Wu,"getSizableOrigin");function Gu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}s(Gu,"An"),o(Gu,"getLengthableOrigin");function G(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}s(G,"U"),o(G,"parsedType");function Ku(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}s(Ku,"$r"),o(Ku,"issue");function W4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}s(W4,"_I"),o(W4,"cleanEnum");function wa(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}s(wa,"sw"),o(wa,"base64ToUint8Array");function Da(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}s(Da,"aw"),o(Da,"uint8ArrayToBase64");function G4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return wa(t+r)}s(G4,"kI"),o(G4,"base64urlToUint8Array");function K4(e){return Da(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(K4,"SI"),o(K4,"uint8ArrayToBase64url");function H4(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}s(H4,"II"),o(H4,"hexToUint8Array");function X4(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}s(X4,"RI"),o(X4,"uint8ArrayToHex");var A5=class{static{s(this,"kc")}static{o(this,"Class")}constructor(...e){}},Y4=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Vu,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$a=B("$ZodError",Y4),je=B("$ZodError",Y4,{Parent:Error});function _i(e,t=r=>r.message){let r={},i=[];for(let u of e.issues)u.path.length>0?(r[u.path[0]]=r[u.path[0]]||[],r[u.path[0]].push(t(u))):i.push(t(u));return{formErrors:i,fieldErrors:r}}s(_i,"zn"),o(_i,"flattenError");function Si(e,t=r=>r.message){let r={_errors:[]},i=o((u,n=[])=>{for(let a of u.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>i({issues:l},[...n,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...n,...a.path]);else{let l=[...n,...a.path];if(l.length===0)r._errors.push(t(a));else{let d=r,c=0;for(;c<l.length;){let p=l[c];c===l.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(a))):d[p]=d[p]||{_errors:[]},d=d[p],c++}}}},"processError");return i(e),r}s(Si,"On"),o(Si,"formatError");function Ba(e,t=r=>r.message){let r={errors:[]},i=o((u,n=[])=>{var a,l;for(let d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(c=>i({issues:c},[...n,...d.path]));else if(d.code==="invalid_key")i({issues:d.issues},[...n,...d.path]);else if(d.code==="invalid_element")i({issues:d.issues},[...n,...d.path]);else{let c=[...n,...d.path];if(c.length===0){r.errors.push(t(d));continue}let p=r,m=0;for(;m<c.length;){let f=c[m],h=m===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(l=p.items)[f]??(l[f]={errors:[]}),p=p.items[f]),h&&p.errors.push(t(d)),m++}}},"processError");return i(e),r}s(Ba,"Mc"),o(Ba,"treeifyError");function xa(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}s(xa,"uw"),o(xa,"toDotPath");function Ca(e){let t=[],r=[...e.issues].sort((i,u)=>(i.path??[]).length-(u.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${xa(i.path)}`);return t.join(`
|
|
2
|
-
`)}s(Ca,"Nc"),o(Ca,"prettifyError");var Hu=o(e=>(t,r,i,u)=>{let n=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new Ft;if(a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,n,be())));throw va(l,u?.callee),l}return a.value},"_parse"),ka=Hu(je),Xu=o(e=>async(t,r,i,u)=>{let n=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise&&(a=await a),a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,n,be())));throw va(l,u?.callee),l}return a.value},"_parseAsync"),Aa=Xu(je),Yu=o(e=>(t,r,i)=>{let u=i?{...i,async:!1}:{async:!1},n=t._zod.run({value:r,issues:[]},u);if(n instanceof Promise)throw new Ft;return n.issues.length?{success:!1,error:new(e??$a)(n.issues.map(a=>Ae(a,u,be())))}:{success:!0,data:n.value}},"_safeParse"),Q4=Yu(je),Qu=o(e=>async(t,r,i)=>{let u=i?{...i,async:!0}:{async:!0},n=t._zod.run({value:r,issues:[]},u);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new e(n.issues.map(a=>Ae(a,u,be())))}:{success:!0,data:n.value}},"_safeParseAsync"),ef=Qu(je),Ia=o(e=>(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Hu(e)(t,r,u)},"_encode"),I5=Ia(je),_a=o(e=>(t,r,i)=>Hu(e)(t,r,i),"_decode"),_5=_a(je),Sa=o(e=>async(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Xu(e)(t,r,u)},"_encodeAsync"),S5=Sa(je),Fa=o(e=>async(t,r,i)=>Xu(e)(t,r,i),"_decodeAsync"),F5=Fa(je),ja=o(e=>(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Yu(e)(t,r,u)},"_safeEncode"),j5=ja(je),za=o(e=>(t,r,i)=>Yu(e)(t,r,i),"_safeDecode"),z5=za(je),Na=o(e=>async(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Qu(e)(t,r,u)},"_safeEncodeAsync"),N5=Na(je),Ma=o(e=>async(t,r,i)=>Qu(e)(t,r,i),"_safeDecodeAsync"),M5=Ma(je),ft={};ut(ft,{base64:s(()=>vf,"base64"),base64url:s(()=>Ra,"base64url"),bigint:s(()=>$f,"bigint"),boolean:s(()=>xf,"boolean"),browserEmail:s(()=>L5,"browserEmail"),cidrv4:s(()=>hf,"cidrv4"),cidrv6:s(()=>gf,"cidrv6"),cuid:s(()=>tf,"cuid"),cuid2:s(()=>uf,"cuid2"),date:s(()=>wf,"date"),datetime:s(()=>Ua,"datetime"),domain:s(()=>W5,"domain"),duration:s(()=>of,"duration"),e164:s(()=>Ef,"e164"),email:s(()=>df,"email"),emoji:s(()=>Oa,"emoji"),extendedDuration:s(()=>O5,"extendedDuration"),guid:s(()=>lf,"guid"),hex:s(()=>G5,"hex"),hostname:s(()=>J5,"hostname"),html5Email:s(()=>U5,"html5Email"),httpProtocol:s(()=>yf,"httpProtocol"),idnEmail:s(()=>Z5,"idnEmail"),integer:s(()=>Bf,"integer"),ipv4:s(()=>pf,"ipv4"),ipv6:s(()=>mf,"ipv6"),ksuid:s(()=>sf,"ksuid"),lowercase:s(()=>Af,"lowercase"),mac:s(()=>ff,"mac"),md5_base64:s(()=>H5,"md5_base64"),md5_base64url:s(()=>X5,"md5_base64url"),md5_hex:s(()=>K5,"md5_hex"),nanoid:s(()=>af,"nanoid"),null:s(()=>Cf,"null"),number:s(()=>qa,"number"),rfc5322Email:s(()=>q5,"rfc5322Email"),sha1_base64:s(()=>Q5,"sha1_base64"),sha1_base64url:s(()=>ew,"sha1_base64url"),sha1_hex:s(()=>Y5,"sha1_hex"),sha256_base64:s(()=>uw,"sha256_base64"),sha256_base64url:s(()=>rw,"sha256_base64url"),sha256_hex:s(()=>tw,"sha256_hex"),sha384_base64:s(()=>nw,"sha384_base64"),sha384_base64url:s(()=>sw,"sha384_base64url"),sha384_hex:s(()=>iw,"sha384_hex"),sha512_base64:s(()=>ow,"sha512_base64"),sha512_base64url:s(()=>lw,"sha512_base64url"),sha512_hex:s(()=>aw,"sha512_hex"),string:s(()=>Df,"string"),time:s(()=>Pa,"time"),ulid:s(()=>rf,"ulid"),undefined:s(()=>kf,"undefined"),unicodeEmail:s(()=>cf,"unicodeEmail"),uppercase:s(()=>If,"uppercase"),uuid:s(()=>iu,"uuid"),uuid4:s(()=>R5,"uuid4"),uuid6:s(()=>T5,"uuid6"),uuid7:s(()=>P5,"uuid7"),xid:s(()=>nf,"xid")});var tf=/^[cC][0-9a-z]{6,}$/,uf=/^[0-9a-z]+$/,rf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nf=/^[0-9a-vA-V]{20}$/,sf=/^[A-Za-z0-9]{27}$/,af=/^[a-zA-Z0-9_-]{21}$/,of=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,O5=/^[-+]?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)?)??$/,lf=/^([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})$/,iu=o(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),R5=iu(4),T5=iu(6),P5=iu(7),df=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,U5=/^[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])?)*$/,q5=/^(([^<>()\[\]\\.,;:\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,}))$/,cf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Z5=cf,L5=/^[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])?)*$/,V5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Oa(){return new RegExp(V5,"u")}s(Oa,"Jc"),o(Oa,"emoji");var pf=/^(?:(?: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])$/,mf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ff=o(e=>{let t=Ge(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),hf=/^((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])$/,gf=/^(([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])$/,vf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ra=/^[A-Za-z0-9_-]*$/,J5=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,W5=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,yf=/^https?$/,Ef=/^\+[1-9]\d{6,14}$/,bf="(?:(?:\\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])))",wf=new RegExp(`^${bf}$`);function Ta(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+)?)?`}s(Ta,"pw"),o(Ta,"timeSource");function Pa(e){return new RegExp(`^${Ta(e)}$`)}s(Pa,"nu"),o(Pa,"time");function Ua(e){let t=Ta({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${bf}T(?:${i})$`)}s(Ua,"ou"),o(Ua,"datetime");var Df=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),$f=/^-?\d+n?$/,Bf=/^-?\d+$/,qa=/^-?\d+(?:\.\d+)?$/,xf=/^(?:true|false)$/i,Cf=/^null$/i,kf=/^undefined$/i,Af=/^[^A-Z]*$/,If=/^[^a-z]*$/,G5=/^[0-9a-fA-F]*$/;function nu(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}s(nu,"Mn"),o(nu,"fixedBase64");function su(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}s(su,"Nn"),o(su,"fixedBase64url");var K5=/^[0-9a-fA-F]{32}$/,H5=nu(22,"=="),X5=su(22),Y5=/^[0-9a-fA-F]{40}$/,Q5=nu(27,"="),ew=su(27),tw=/^[0-9a-fA-F]{64}$/,uw=nu(43,"="),rw=su(43),iw=/^[0-9a-fA-F]{96}$/,nw=nu(64,""),sw=su(64),aw=/^[0-9a-fA-F]{128}$/,ow=nu(86,"=="),lw=su(86),de=B("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),_f={number:"number",bigint:"bigint",object:"date"},Za=B("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let r=_f[typeof t.value];e._zod.onattach.push(i=>{let u=i._zod.bag,n=(t.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?u.maximum=t.value:u.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),La=B("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=_f[typeof t.value];e._zod.onattach.push(i=>{let u=i._zod.bag,n=(t.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?u.minimum=t.value:u.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Sf=B("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):ha(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ff=B("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[u,n]=R4[t.format];e._zod.onattach.push(a=>{let l=a._zod.bag;l.format=t.format,l.minimum=u,l.maximum=n,r&&(l.pattern=Bf)}),e._zod.check=a=>{let l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}l<u&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:u,inclusive:!0,inst:e,continue:!t.abort}),l>n&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),jf=B("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[r,i]=T4[t.format];e._zod.onattach.push(u=>{let n=u._zod.bag;n.format=t.format,n.minimum=r,n.maximum=i}),e._zod.check=u=>{let n=u.value;n<r&&u.issues.push({origin:"bigint",input:n,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),n>i&&u.issues.push({origin:"bigint",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),zf=B("$ZodCheckMaxSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let u=i.value;u.size<=t.maximum||i.issues.push({origin:Wu(u),code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Nf=B("$ZodCheckMinSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let u=i.value;u.size>=t.minimum||i.issues.push({origin:Wu(u),code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Mf=B("$ZodCheckSizeEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag;u.minimum=t.size,u.maximum=t.size,u.size=t.size}),e._zod.check=i=>{let u=i.value,n=u.size;if(n===t.size)return;let a=n>t.size;i.issues.push({origin:Wu(u),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Of=B("$ZodCheckMaxLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let u=i.value;if(u.length<=t.maximum)return;let n=Gu(u);i.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Rf=B("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let u=i.value;if(u.length>=t.minimum)return;let n=Gu(u);i.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Tf=B("$ZodCheckLengthEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag;u.minimum=t.length,u.maximum=t.length,u.length=t.length}),e._zod.check=i=>{let u=i.value,n=u.length;if(n===t.length)return;let a=Gu(u),l=n>t.length;i.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),er=B("$ZodCheckStringFormat",(e,t)=>{var r,i;de.init(e,t),e._zod.onattach.push(u=>{let n=u._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:t.format,input:u.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Pf=B("$ZodCheckRegex",(e,t)=>{er.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Uf=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Af),er.init(e,t)}),qf=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=If),er.init(e,t)}),Zf=B("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let r=Ge(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(u=>{let n=u._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=u=>{u.value.includes(t.includes,t.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:u.value,inst:e,continue:!t.abort})}}),Lf=B("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`^${Ge(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let u=i._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Vf=B("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`.*${Ge(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let u=i._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Va(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues))}s(Va,"fw"),o(Va,"handleCheckPropertyResult");var Jf=B("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(u=>Va(u,r,t.property));Va(i,r,t.property)}}),Wf=B("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Gf=B("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),Kf=class{static{s(this,"Pn")}static{o(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
|
|
1
|
+
"use strict";var a5=Object.defineProperty;var s=(e,t)=>a5(e,"name",{value:t,configurable:!0});var Zm=Object.defineProperty,o=s((e,t)=>Zm(e,"name",{value:t,configurable:!0}),"a"),ut=s((e,t)=>{for(var r in t)Zm(e,r,{get:t[r],enumerable:!0})},"mt");import"reflect-metadata";import{createHash as o5}from"node:crypto";import{existsSync as Lm,readFileSync as Vm,statSync as Jm}from"node:fs";import{createServer as l5}from"node:http";import{basename as d5}from"node:path";var Wm="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Gm(e,t){let r="",i=e;for(let u=t-1;u>=0;u--){let n=i%32;r=Wm[n]+r,i=(i-n)/32}return r}s(Gm,"RS"),o(Gm,"encodeTime");function Km(e){let t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let r="";for(let i=0;i<e;i++)r+=Wm[(t[i]??0)&31];return r}s(Km,"ES"),o(Km,"encodeRandom");function lt(e=Date.now()){return Gm(e,10)+Km(16)}s(lt,"Fe"),o(lt,"ulid");var Hm=class{static{s(this,"mr")}static{o(this,"EventBus")}constructor(e={}){this.subs=new Set,this.dropped=0,this.capacity=e.capacity??1e4,this.onDrop=e.onDrop,this.transform=e.transform}publish(e){if(this.subs.size>this.capacity){this.dropped++,this.onDrop?.(1);return}let t=e;if(this.transform)try{t=this.transform(e)??e}catch{t=e}for(let r of this.subs)if(!(r.filter&&!r.filter(t)))try{let i=r.handler(t);i&&typeof i.then=="function"&&i.catch(()=>{})}catch{}}subscribe(e,t){let r={handler:e,filter:t};return this.subs.add(r),()=>{this.subs.delete(r)}}droppedCount(){return this.dropped}subscriberCount(){return this.subs.size}},eu="REDACTED",c5=["token","secret","password","passwd","apikey","credential","assertion","signature"],p5=new Set(["key","auth","authorization","jwt","code","sig","pwd","pass","session","sid","bearer","otp","cookie","set-cookie"]),m5=/^(?:(?:prompt|completion|total|input|output|cache|cached|cacheread|cachewrite|reasoning|thinking|max|min|remaining|used|billed)tokens|tokens?(?:count|used|limit|remaining))$/;function sa(e){let t=e.toLowerCase();if(m5.test(t.replace(/[-_.]+/g,"")))return!1;if(c5.some(r=>t.includes(r)))return!0;for(let r of t.split(/[-_.]+/))if(r&&p5.has(r))return!0;return!1}s(sa,"Gb"),o(sa,"isSecretParam");var f5=/^([a-z][a-z0-9+.-]*:\/\/)[^/?#@\s]*@/i,h5=/([?&#])([^=&#\s]+)=([^&#\s]*)/g;function Xm(e){return e&&e.replace(f5,`$1${eu}@`).replace(h5,(t,r,i)=>sa(i)?`${r}${i}=${eu}`:t)}s(Xm,"MS"),o(Xm,"redactUrlParams");var g5=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]*/g,v5=/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi,y5=/\b(authorization|x-api-key|api-key|cookie|set-cookie|proxy-authorization)\b(\s*[:=]\s*)(["']?)((?:(?:bearer|basic)\s+)?[^\s"',;]{4,})\3/gi;function dt(e){return Xm(e).replace(y5,(t,r,i,u)=>`${r}${i}${u}${eu}${u}`).replace(g5,eu).replace(v5,(t,r)=>`${r} ${eu}`)}s(dt,"ht"),o(dt,"redactText");function aa(e,t){return e.length<=t?e:`${e.slice(0,t)}\u2026[lensmcp truncated: ${e.length-t} more chars]`}s(aa,"Jb"),o(aa,"clip");function Ym(e,t=4096){if(e!==void 0)return aa(dt(e),t)}s(Ym,"Wb"),o(Ym,"safeText");function Qm(e){return aa(dt(e),300)}s(Qm,"Kb"),o(Qm,"safeTitle");var E5=6,b5=64,w5=/^TS\d{1,5}$/,D5=o((e,t)=>e==="code"&&typeof t=="string"&&w5.test(t),"isDiagnosticCode");function Zu(e,t=0,r=E5){if(typeof e=="string")return dt(e);if(e===null||typeof e!="object"||t>=r)return e;if(Array.isArray(e)){let n=!1,a=e.map((l,d)=>{if(d>=b5)return l;let c=Zu(l,t+1,r);return c!==l&&(n=!0),c});return n?a:e}let i=!1,u={};for(let[n,a]of Object.entries(e)){let l=sa(n)&&a!==void 0&&a!==null&&!D5(n,a)?eu:Zu(a,t+1,r);l!==a&&(i=!0),u[n]=l}return i?u:e}s(Zu,"gr"),o(Zu,"redactDeep");var $5=12;function oa(e={}){let t=e.maxDepth??$5,r=0,i=0;return{redact(u){r+=1;let n=u.title===void 0?void 0:Qm(dt(u.title)),a=u.message===void 0?void 0:Ym(dt(u.message),4096),l=u.raw===void 0?void 0:Zu(u.raw,0,t),d=n!==u.title,c=a!==u.message,p=l!==u.raw;return!d&&!c&&!p?u:(i+=1,{...u,...n!==void 0?{title:n}:{},...a!==void 0?{message:a}:{},...l!==void 0?{raw:l}:{}})},stats:o(()=>({inspected:r,redacted:i}),"stats"),reset:o(()=>{r=0,i=0},"reset")}}s(oa,"ri"),o(oa,"createEventRedactor");var e4=class{static{s(this,"vr")}static{o(this,"ResourceStore")}constructor(){this.entries=new Map,this.subs=new Map}register(e,t){if(this.entries.has(e))throw new Error(`Resource already registered: ${e}`);return this.entries.set(e,{uri:e,produce:t,revision:0}),()=>{this.entries.delete(e),this.subs.delete(e)}}async read(e){let t=this.entries.get(e);if(!t)throw new Error(`Unknown resource: ${e}`);return t.produce()}list(){return[...this.entries.keys()]}async markDirty(e){let t=this.entries.get(e);if(!t)return;let r=await t.produce(),i=JSON.stringify(r);if(i===t.lastJson)return;t.lastJson=i,t.revision+=1;let u=this.subs.get(e);if(u)for(let n of u)try{n(e,t.revision)}catch{}}revision(e){return this.entries.get(e)?.revision}subscribe(e,t){let r=this.subs.get(e);return r||(r=new Set,this.subs.set(e,r)),r.add(t),()=>{r?.delete(t)}}},t4=class{static{s(this,"yr")}static{o(this,"GraphStore")}constructor(){this.nodes=new Map,this.edges=new Map,this.byParent=new Map,this.byFlow=new Map,this.byLogical=new Map,this.byInstance=new Map,this.byRequest=new Map,this.outByAxis=new Map,this.inByAxis=new Map}addNode(e){this.nodes.set(e.id,e),e.parentTraceNodeId&&this.addToIndex(this.byParent,e.parentTraceNodeId,e.id),e.context.flowId&&this.addToIndex(this.byFlow,e.context.flowId,e.id),e.logicalId&&this.addToIndex(this.byLogical,e.logicalId,e.id),e.instanceId&&this.addToIndex(this.byInstance,e.instanceId,e.id),e.context.requestId&&this.addToIndex(this.byRequest,e.context.requestId,e.id)}updateNode(e,t){let r=this.nodes.get(e);if(!r)throw new Error(`Unknown node: ${e}`);let i={...r,...t,id:r.id};return this.nodes.set(e,i),i}getNode(e){return this.nodes.get(e)}addEdge(e){this.edges.set(e.id,e);let t=this.outByAxis.get(e.axis);t||(t=new Map,this.outByAxis.set(e.axis,t)),this.addToIndex(t,e.from,e.id);let r=this.inByAxis.get(e.axis);r||(r=new Map,this.inByAxis.set(e.axis,r)),this.addToIndex(r,e.to,e.id)}getEdge(e){return this.edges.get(e)}childrenOf(e){return this.materialiseNodes(this.byParent.get(e))}nodesInFlow(e){return this.materialiseNodes(this.byFlow.get(e))}nodesByLogical(e){return this.materialiseNodes(this.byLogical.get(e))}nodesByInstance(e){return this.materialiseNodes(this.byInstance.get(e))}nodesByRequest(e){return this.materialiseNodes(this.byRequest.get(e))}traverse(e){let t=this.nodes.get(e.from);if(!t)return{nodes:[],edges:[]};let r=Array.isArray(e.lens)?e.lens:[e.lens],i=e.direction??"both",u=e.depth??4,n=e.maxNodes??1e3,a=new Set,l=new Set,d=[{id:t.id,d:0}];for(;d.length&&!(a.size>=n);){let{id:c,d:p}=d.shift();if(!a.has(c)&&(a.add(c),!(p>=u)))for(let m of r){if(i==="out"||i==="both"){let f=this.outByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.to)||d.push({id:g.to,d:p+1})}}if(i==="in"||i==="both"){let f=this.inByAxis.get(m)?.get(c);if(f)for(let h of f){l.add(h);let g=this.edges.get(h);a.has(g.from)||d.push({id:g.from,d:p+1})}}}}return{nodes:this.materialiseNodes(a),edges:[...l].map(c=>this.edges.get(c)).filter(c=>!!c)}}nodeCount(){return this.nodes.size}edgeCount(){return this.edges.size}addToIndex(e,t,r){let i=e.get(t);i||(i=new Set,e.set(t,i)),i.add(r)}materialiseNodes(e){if(!e)return[];let t=[];for(let r of e){let i=this.nodes.get(r);i&&t.push(i)}return t}};function u4(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")}s(u4,"qS"),o(u4,"fnv1a32");function r4(e){let t=[e.kind,e.identity,e.file??"",e.detail??""];return`${e.kind}:${u4(t.join("|"))}`}s(r4,"Xb"),o(r4,"fingerprint");var B5=class{static{s(this,"ni")}static{o(this,"ReducerRegistry")}constructor(){this.reducers=[]}register(e,t){if(this.reducers.some(r=>r.name===e))throw new Error(`Reducer already registered: ${e}`);this.reducers.push({name:e,reducer:t})}list(){return this.reducers}async dispatch(e){for(let{reducer:t}of this.reducers)try{let r=t(e);r&&typeof r.then=="function"&&await r}catch{}}};function la(e,t={}){let r,i;if(t.flowId)i=t.flowId,r=e.filter(m=>m.context.flowId===i);else{let m=e.find(f=>f.context.flowId);if(!m)return;i=m.context.flowId,r=e.filter(f=>f.context.flowId===i)}if(r.length===0)return;r.sort((m,f)=>m.timestamp-f.timestamp);let u=1e3;r.length>u&&(r=[r[0],...r.slice(r.length-(u-1))]);let n=r[0],a=[],l,d;for(let m of r){let f=i4(m);if(f){if(a.push(f),f.kind==="render"||f.kind==="final-render"){let h=m.raw;h?.render&&(l={id:h.render.id,page:h.render.page,route:h.render.route,componentName:h.render.componentName})}else if(m.source==="visual"&&f.kind==="visual-violation"){let h=m.raw;h?.frame&&(d=h.frame.id)}}}for(let m=a.length-1;m>=0;m--)if(a[m].kind==="render"){a[m]={...a[m],kind:"final-render"};break}let c=r[0].timestamp,p=r[r.length-1].timestamp;return{flowId:i,origin:{type:n.context.originType,nodeId:n.context.originNodeId,at:n.timestamp},phases:a,finalState:l?{page:l.page,route:l.route,componentName:l.componentName,renderId:l.id,visualFrameId:d}:void 0,startedAt:c,endedAt:p,eventCount:r.length}}s(la,"oi"),o(la,"compileStory");function i4(e){let t=(e.raw??null)?.kind;if(t==="flow-origin"||e.source==="client-runtime"&&t==="user-action"){let r=e.raw;return{kind:"user-action",at:e.timestamp,label:r?.origin?.label??e.title,eventIds:[e.id]}}if(e.source==="react"&&t==="render"){let r=e.raw;return{kind:"render",at:e.timestamp,label:`render ${r?.render?.componentName??"?"}`,eventIds:[e.id],details:r?.render?{componentName:r.render.componentName,durationMs:r.render.actualDurationMs}:void 0}}if(e.source==="react"&&t==="slot-content-changed"){let r=e.raw,i=r?.slot?.toComponent??"?";return{kind:/spinner|loader|loading/i.test(i)?"loading-ui":"idle-ui",at:e.timestamp,label:`slot ${r?.slot?.slotLogicalId??""} \u2192 ${i}`,eventIds:[e.id]}}if(e.source==="client-runtime"&&t==="route"){let r=e.raw;return{kind:"route-transition",at:e.timestamp,label:`route ${r?.from??""} \u2192 ${r?.url??""}`,eventIds:[e.id]}}if(e.source==="valtio"&&t==="state-update"){let r=e.raw;return{kind:"state-update",at:e.timestamp,label:`${r?.update?.storeId??"?"}.${r?.update?.path??"?"}`,eventIds:[e.id],details:r?.update}}if(e.source==="nestjs"&&t==="server-request"){let r=e.raw;return{kind:"backend-request",at:e.timestamp,label:`${r?.request?.method??"?"} ${r?.request?.route??"?"} \u2192 ${r?.request?.status??"?"}`,eventIds:[e.id],details:r?.request}}if(e.source==="chrome"&&e.category==="network")return{kind:"backend-request",at:e.timestamp,label:e.title,eventIds:[e.id]};if(e.source==="visual"&&t==="visual-violation"){let r=e.raw;return{kind:"visual-violation",at:e.timestamp,label:`${r?.violation?.ruleType??"rule"} ${r?.violation?.ruleId??""}`,eventIds:[e.id]}}}s(i4,"VS"),o(i4,"classifyEvent");var n4={phaseGapMs:1500,burstGapMs:250,attachWindowMs:400,maxSegmentEvents:400,occurrenceSlackMs:10},x5=new Set(["subscription-added","subscription-removed","hook-run","store-created","singleton-instance","visual-frame"]),da="db-request-account",C5=new Set(["react","valtio","client-runtime","chrome","visual"]),tu=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),le=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),De=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function s4(e){let t=tu(e.raw)?e.raw:{},r=tu(t.request)?t.request:{},i=tu(t.span)?t.span:{},u=e.context??{},n=le(t.kind)??"",a=n===da,l=(a?De(t.lastEndedAt):void 0)??De(e.timestamp)??0,d=De(r.startedAt)??De(i.startTime)??De(t.startedAt)??(a?De(t.firstStartedAt):void 0),c=De(r.endedAt)??De(i.endTime)??(d!==void 0&&De(t.durationMs)!==void 0?d+t.durationMs:void 0),p=Math.min(l,d??l),m=Math.max(l,c??l),f=tu(t.render)?t.render:{},h=tu(t.update)?t.update:{},g=n==="render"?le(f.componentName):n==="state-update"?le(h.path)?.split(".").slice(0,2).join("."):void 0,b=le(t.queue),x=le(t.jobId),$=String(e.source),w=le(t.project)??le(u.projectName);return{event:e,id:e.id,ts:l,from:p,to:m,kind:n,source:$,...le(u.requestId)?{requestId:le(u.requestId)}:{},...le(u.parentRequestId)?{parentRequestId:le(u.parentRequestId)}:{},...b&&x?{queueKey:`${b}#${x}`}:{},browser:C5.has($)||$==="memory"&&w===void 0,bookkeeping:x5.has(n),...w?{project:w}:{},...g?{subject:g}:{},...n==="fetch-start"||n==="fetch-done"?{route:ca(le(t.url)),method:le(t.method)}:n==="server-request"?{route:le(r.route),method:le(r.method)}:n==="gateway-request"?{route:ca(le(t.url)),method:le(t.method)}:{}}}s(s4,"WS"),o(s4,"readItem");function ca(e){if(!e)return;let t=e.search(/[?#]/),r=t===-1?e:e.slice(0,t),i=/^[a-z][a-z0-9+.-]*:\/\/[^/]*(\/.*)?$/i.exec(r);return i?i[1]??"/":r}s(ca,"Hb"),o(ca,"pathOnly");var k5=o(e=>e.split(".")[0],"rootOf"),a4=o((e,t)=>e.reduce((r,i)=>Math.min(r,t(i)),1/0),"minOf"),o4=o((e,t)=>e.reduce((r,i)=>Math.max(r,t(i)),-1/0),"maxOf"),pa=o((e,t)=>e.ts-t.ts||(e.id<t.id?-1:e.id>t.id?1:0),"compare"),ma=o(e=>e.requestId&&!e.requestId.startsWith("job:")?k5(e.requestId):void 0,"directFamilyOf");function l4(e){if(e.requestId?.startsWith("job:"))return e.requestId.slice(4);if(e.queueKey&&e.kind!=="queue-enqueued"&&!e.requestId)return e.queueKey}s(l4,"XS"),o(l4,"jobKeyOf");function d4(e,t){let r=e.filter(n=>!n.parentRequestId&&(n.kind==="server-request"||n.kind==="gateway-request"||n.kind==="fetch-start"||n.kind==="fetch-done")).sort((n,a)=>n.from-a.from||pa(n,a));if(r.length<2)return[e];let i=[];for(let n of r){let a=i[i.length-1];a&&n.from<=a.to+t?a.to=Math.max(a.to,n.to):i.push({from:n.from,to:n.to})}if(i.length<2)return[e];let u=i.map(()=>[]);for(let n of e){let a=i.findIndex(l=>n.ts>=l.from-t&&n.ts<=l.to+t);if(a===-1){a=0;for(let l=0;l<i.length;l+=1)i[l].from<=n.ts&&(a=l)}u[a].push(n)}return u.filter(n=>n.length>0)}s(d4,"HS"),o(d4,"occurrencesOf");var c4={debug:0,info:1,warning:2,error:3,fatal:4};function fa(e,t){let r=[],i=[];for(let u of e){let n=i[i.length-1];n&&u.ts-n.ts>=t&&(r.push(i),i=[]),i.push(u)}return i.length&&r.push(i),r}s(fa,"Qb"),o(fa,"runs");function p4(e,t={}){let r={...n4};for(let[w,k]of Object.entries(t))typeof k=="number"&&Number.isFinite(k)&&(r[w]=k);let i=new Set,u=[];for(let w of e)i.has(w.id)||(i.add(w.id),u.push(s4(w)));u.sort(pa);let n=le(u[0]?.event.context?.flowId)??le(u[0]?.event.raw?.flowId)??"",a=new Map;for(let w of u)w.kind==="queue-enqueued"&&w.queueKey&&w.requestId&&!w.requestId.startsWith("job:")&&!a.has(w.queueKey)&&a.set(w.queueKey,w);let l=new Map,d=new Map,c=[];for(let w of u){let k=l4(w),C=ma(w);if(k!==void 0){let M=d.get(k);M?M.push(w):d.set(k,[w])}else if(C!==void 0){let M=l.get(C);M?M.push(w):l.set(C,[w])}else c.push(w)}let p=[],m=new Map;for(let[w,k]of l)d4(k,r.occurrenceSlackMs).forEach((C,M)=>{let y={id:`${n}~r:${w}${M===0?"":`@${M+1}`}`,kind:"request",items:C,requestId:w};p.push(y);for(let D of C)m.set(D,y)});for(let[w,k]of d){let C=a.get(w),M=C?m.get(C):void 0;M?M.items.push(...k):p.push({id:`${n}~r:job:${w}`,kind:"request",items:k,requestId:`job:${w}`})}let f=u.filter(w=>w.kind==="fetch-done"&&ma(w)!==void 0),h=new Map;for(let w of p)w.requestId&&h.set(w.requestId,[...h.get(w.requestId)??[],w]);let g=o((w,k)=>{let C=h.get(w);if(C)return C.find(M=>M.items.some(y=>y.kind==="fetch-done"&&y.ts===k))??C[C.length-1]},"owningUnit"),b=c.filter(w=>w.browser);for(let w of fa(b,r.burstGapMs)){let k=w[0].ts,C=f.filter(D=>D.ts<=k&&k-D.ts<=r.attachWindowMs),M=[...new Set(C.map(D=>ma(D)))];if(M.length===1){let D=g(M[0],C[C.length-1].ts);if(D){D.items.push(...w);continue}}let y=w.some(D=>D.kind==="flow-origin");p.push({id:`${n}~${y?"o":"u"}:${w[0].id}`,kind:y?"origin":"ui",items:w,...M.length>1?{after:M.sort()}:{}})}for(let w of fa(c.filter(k=>!k.browser),r.phaseGapMs))p.push({id:`${n}~a:${w[0].id}`,kind:"ambient",items:w});let x=m4(n,u.length,p,r),$=xi(u.map(w=>w.event));return $?{...x,sql:$}:x}s(p4,"nw"),o(p4,"segmentFlow");function m4(e,t,r,i){for(let f of r)f.items.sort(pa);let u=r.map(f=>({unit:f,from:a4(f.items,h=>h.from),to:o4(f.items,h=>h.to)}));u.sort((f,h)=>f.from-h.from||(f.unit.id<h.unit.id?-1:1));let n=new Map,a=0,l=-1/0;for(let f of u)(a===0||f.from-l>=i.phaseGapMs)&&(a+=1),l=Math.max(l,f.to),n.set(f.unit,a);let d=[];for(let f of u){let h=f4(f.unit.items,i.maxSegmentEvents),g=f.unit.kind==="request"?xi(f.unit.items.map(b=>b.event)):void 0;h.forEach((b,x)=>{let $=h4(e,f.unit,b,n.get(f.unit),h.length>1?{index:x+1,total:h.length}:void 0);d.push(g&&x===0?{...$,sql:g}:$)})}let c={};for(let f of d)for(let h of f.eventIds)c[h]=f.id;let p=[];for(let f of d){let h=p[f.phase-1];h||(h={index:f.phase,start:f.start,end:f.end,segmentIds:[]},p[f.phase-1]=h),h.start=Math.min(h.start,f.start),h.end=Math.max(h.end,f.end),h.segmentIds.push(f.id)}let m=d.reduce((f,h)=>f+h.counts.signal,0);return{flowId:e,segments:d,phases:p.filter(Boolean),assignment:c,stats:{events:t,signal:m,bookkeeping:t-m,segments:d.length,phases:p.filter(Boolean).length,largestSegment:d.reduce((f,h)=>Math.max(f,h.counts.total),0)}}}s(m4,"YS"),o(m4,"assemble");function f4(e,t){if(e.filter(n=>!n.bookkeeping).length<=t)return[e];let r=[],i=[],u=0;for(let n of e)!n.bookkeeping&&u===t&&(r.push(i),i=[],u=0),i.push(n),n.bookkeeping||(u+=1);return i.length&&r.push(i),r}s(f4,"QS"),o(f4,"chunk");function h4(e,t,r,i,u){let n={total:r.length,signal:0,bookkeeping:0,errors:0,warnings:0},a=new Set,l="debug";for(let h of r){h.bookkeeping?n.bookkeeping+=1:n.signal+=1;let g=String(h.event.severity);g==="error"||g==="fatal"?n.errors+=1:g==="warning"&&(n.warnings+=1),(c4[g]??1)>(c4[l]??0)&&(l=g),h.project&&a.add(h.project)}let d=t.kind==="ui"||t.kind==="origin"?v4(r):[],c=a4(r,h=>h.from),p=o4(r,h=>h.to),m=g4(t.items),f=t.id;return{id:u&&u.index>1?`${f}#${u.index}`:f,flowId:e,kind:t.kind,label:y4(t,r,m,u,d),phase:i,start:c,end:p,durationMs:p-c,eventIds:r.map(h=>h.id),counts:n,projects:[...a].sort(),...m.route?{route:m.route}:{},...m.method?{method:m.method}:{},...t.requestId?{requestId:t.requestId}:{},...t.after?{after:t.after}:{},...d.length?{hot:d}:{},...u?{part:u}:{},worstSeverity:l}}s(h4,"eI"),o(h4,"toSegment");function g4(e){let t=e.find(r=>r.kind==="fetch-start"&&r.route)??e.find(r=>r.kind==="server-request"&&!r.parentRequestId&&r.route)??e.find(r=>r.kind==="gateway-request"&&r.route)??e.find(r=>r.kind==="fetch-done"&&r.route);return{...t?.route?{route:t.route}:{},...t?.method?{method:t.method.toUpperCase()}:{}}}s(g4,"tI"),o(g4,"routeOf");function v4(e){let t=new Map;for(let r of e)r.subject&&!r.bookkeeping&&t.set(r.subject,(t.get(r.subject)??0)+1);return[...t.entries()].sort((r,i)=>i[1]-r[1]||(r[0]<i[0]?-1:1)).slice(0,3).map(([r,i])=>i>1?`${r} \xD7${i}`:r)}s(v4,"rI"),o(v4,"hotOf");function y4(e,t,r,i,u){let n=i?` (part ${i.index}/${i.total})`:"";if(e.kind==="request"){if(r.route)return`${r.method?`${r.method} `:""}${r.route}${n}`;let a=t.find(l=>l.queueKey);return a?`job ${a.queueKey}${n}`:`request ${e.requestId??""}${n}`}return e.kind==="origin"?`${t.find(a=>a.kind==="flow-origin")?.event.title||"start"}${u.length?` \xB7 ${u.join(", ")}`:""}${n}`:e.kind==="ui"?`UI update${u.length?` \xB7 ${u.join(", ")}`:""}${n}`:`background${n}`}s(y4,"nI"),o(y4,"labelOf");var E4=50;function xi(e){let t=new Map,r=new Map,i=new Set;for(let g of e){if(i.has(g.id))continue;i.add(g.id);let b=tu(g.raw)?g.raw:{},x=le(b.kind),$=le(g.context?.requestId);if(!$)continue;let w=le(b.project)??le(g.context?.projectName);if(x==="db-query"&&g.source==="db"){let k=r.get($)??{count:0,workMs:0,...w?{project:w}:{}};k.count+=1,k.workMs+=De(b.durationMs)??0,r.set($,k)}else if(x===da){let k=le(b.accountId)??g.id,C=De(b.seq)??0,M=t.get(k);if(M&&M.seq>=C)continue;t.set(k,{requestId:$,...w?{project:w}:{},seq:C,basis:b.basis==="end"?"end":"settled",statements:De(b.statements)??0,failed:De(b.failed)??0,workMs:De(b.workMs)??0,recorded:De(b.recorded)??0,suppressed:De(b.suppressed)??0,unwritten:De(b.unwritten)??0})}}let u=new Map;for(let g of t.values()){let b=u.get(g.requestId);if(!b){u.set(g.requestId,{...g});continue}g.basis==="settled"&&(b.basis="settled"),b.statements+=g.statements,b.failed+=g.failed,b.workMs+=g.workMs,b.recorded+=g.recorded,b.suppressed+=g.suppressed,b.unwritten+=g.unwritten}let n=[...new Set([...r.keys(),...u.keys()])].sort();if(n.length===0)return;let a={statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0},l={statements:0,workMs:0},d=[];for(let g of n){let b=r.get(g),x=u.get(g),$=b?.count??0;l.statements+=$,l.workMs+=b?.workMs??0;let w=!x||$>x.statements?"unverified":$===x.statements?"complete":"incomplete";x&&w!=="unverified"&&(a.statements+=x.statements,a.failed+=x.failed,a.workMs+=x.workMs,a.recorded+=x.recorded,a.suppressed+=x.suppressed,a.unwritten+=x.unwritten);let k=b?.project??x?.project;d.push({requestId:g,...k?{project:k}:{},status:w,observed:$,observedWorkMs:b?.workMs??0,...x?{basis:x.basis,statements:x.statements,failed:x.failed,workMs:x.workMs,recorded:x.recorded,suppressed:x.suppressed,unwritten:x.unwritten}:{}})}let c=o(g=>d.filter(b=>b.status===g).length,"tally"),p=c("unverified"),m=c("incomplete"),f=o(g=>(g.statements??0)-g.observed,"missing"),h=d.filter(g=>g.status!=="complete").sort((g,b)=>(g.status==="incomplete"?0:1)-(b.status==="incomplete"?0:1)||f(b)-f(g)||(g.requestId<b.requestId?-1:g.requestId>b.requestId?1:0));return{status:p>0?"unverified":m>0?"incomplete":"complete",requests:d.length,complete:c("complete"),incomplete:m,unverified:p,settled:d.filter(g=>g.status!=="unverified"&&g.basis==="settled").length,observed:l,accounted:a,gaps:h.slice(0,E4),gapsTruncated:h.length>E4}}s(xi,"si"),o(xi,"sqlAccountingOf");var v={};ut(v,{$brand:s(()=>$4,"$brand"),$input:s(()=>iv,"$input"),$output:s(()=>rv,"$output"),NEVER:s(()=>D4,"NEVER"),TimePrecision:s(()=>sv,"TimePrecision"),ZodAny:s(()=>cl,"ZodAny"),ZodArray:s(()=>yl,"ZodArray"),ZodBase64:s(()=>wn,"ZodBase64"),ZodBase64URL:s(()=>Dn,"ZodBase64URL"),ZodBigInt:s(()=>Ar,"ZodBigInt"),ZodBigIntFormat:s(()=>kn,"ZodBigIntFormat"),ZodBoolean:s(()=>kr,"ZodBoolean"),ZodCIDRv4:s(()=>En,"ZodCIDRv4"),ZodCIDRv6:s(()=>bn,"ZodCIDRv6"),ZodCUID:s(()=>pn,"ZodCUID"),ZodCUID2:s(()=>mn,"ZodCUID2"),ZodCatch:s(()=>Gl,"ZodCatch"),ZodCodec:s(()=>Or,"ZodCodec"),ZodCustom:s(()=>Tr,"ZodCustom"),ZodCustomStringFormat:s(()=>mu,"ZodCustomStringFormat"),ZodDate:s(()=>In,"ZodDate"),ZodDefault:s(()=>Ll,"ZodDefault"),ZodDiscriminatedUnion:s(()=>xl,"ZodDiscriminatedUnion"),ZodE164:s(()=>$n,"ZodE164"),ZodEmail:s(()=>ln,"ZodEmail"),ZodEmoji:s(()=>dn,"ZodEmoji"),ZodEnum:s(()=>gu,"ZodEnum"),ZodError:s(()=>dD,"ZodError"),ZodExactOptional:s(()=>Ul,"ZodExactOptional"),ZodFile:s(()=>Rl,"ZodFile"),ZodFirstPartyTypeKind:s(()=>pd,"ZodFirstPartyTypeKind"),ZodFunction:s(()=>sd,"ZodFunction"),ZodGUID:s(()=>$r,"ZodGUID"),ZodIPv4:s(()=>vn,"ZodIPv4"),ZodIPv6:s(()=>yn,"ZodIPv6"),ZodISODate:s(()=>y0,"ZodISODate"),ZodISODateTime:s(()=>g0,"ZodISODateTime"),ZodISODuration:s(()=>D0,"ZodISODuration"),ZodISOTime:s(()=>b0,"ZodISOTime"),ZodIntersection:s(()=>kl,"ZodIntersection"),ZodIssueCode:s(()=>cD,"ZodIssueCode"),ZodJWT:s(()=>Bn,"ZodJWT"),ZodKSUID:s(()=>gn,"ZodKSUID"),ZodLazy:s(()=>rd,"ZodLazy"),ZodLiteral:s(()=>Ml,"ZodLiteral"),ZodMAC:s(()=>P0,"ZodMAC"),ZodMap:s(()=>Sl,"ZodMap"),ZodNaN:s(()=>Kl,"ZodNaN"),ZodNanoID:s(()=>cn,"ZodNanoID"),ZodNever:s(()=>fl,"ZodNever"),ZodNonOptional:s(()=>On,"ZodNonOptional"),ZodNull:s(()=>dl,"ZodNull"),ZodNullable:s(()=>ql,"ZodNullable"),ZodNumber:s(()=>xr,"ZodNumber"),ZodNumberFormat:s(()=>Pt,"ZodNumberFormat"),ZodObject:s(()=>_r,"ZodObject"),ZodOptional:s(()=>jn,"ZodOptional"),ZodPipe:s(()=>Nr,"ZodPipe"),ZodPrefault:s(()=>Vl,"ZodPrefault"),ZodPreprocess:s(()=>Ql,"ZodPreprocess"),ZodPromise:s(()=>id,"ZodPromise"),ZodReadonly:s(()=>ed,"ZodReadonly"),ZodRealError:s(()=>Ne,"ZodRealError"),ZodRecord:s(()=>hu,"ZodRecord"),ZodSet:s(()=>jl,"ZodSet"),ZodString:s(()=>Dr,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>Jl,"ZodSuccess"),ZodSymbol:s(()=>sl,"ZodSymbol"),ZodTemplateLiteral:s(()=>td,"ZodTemplateLiteral"),ZodTransform:s(()=>Pl,"ZodTransform"),ZodTuple:s(()=>Al,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>fn,"ZodULID"),ZodURL:s(()=>Br,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>ol,"ZodUndefined"),ZodUnion:s(()=>Sr,"ZodUnion"),ZodUnknown:s(()=>ml,"ZodUnknown"),ZodVoid:s(()=>hl,"ZodVoid"),ZodXID:s(()=>hn,"ZodXID"),ZodXor:s(()=>$l,"ZodXor"),_ZodString:s(()=>on,"_ZodString"),_default:s(()=>Nn,"_default"),_function:s(()=>Rr,"_function"),any:s(()=>pl,"any"),array:s(()=>fu,"array"),base64:s(()=>V0,"base64"),base64url:s(()=>J0,"base64url"),bigint:s(()=>rl,"bigint"),boolean:s(()=>Cn,"boolean"),catch:s(()=>Tn,"catch"),check:s(()=>ad,"check"),cidrv4:s(()=>Z0,"cidrv4"),cidrv6:s(()=>L0,"cidrv6"),clone:s(()=>Se,"clone"),codec:s(()=>Xl,"codec"),coerce:s(()=>R1,"coerce"),config:s(()=>be,"config"),core:s(()=>b4,"core"),cuid:s(()=>z0,"cuid"),cuid2:s(()=>N0,"cuid2"),custom:s(()=>od,"custom"),date:s(()=>vl,"date"),decode:s(()=>D1,"decode"),decodeAsync:s(()=>B1,"decodeAsync"),describe:s(()=>_1,"describe"),discriminatedUnion:s(()=>Cl,"discriminatedUnion"),e164:s(()=>W0,"e164"),email:s(()=>B0,"email"),emoji:s(()=>F0,"emoji"),encode:s(()=>w1,"encode"),encodeAsync:s(()=>$1,"encodeAsync"),endsWith:s(()=>fr,"endsWith"),enum:s(()=>jr,"enum"),exactOptional:s(()=>zn,"exactOptional"),file:s(()=>Tl,"file"),flattenError:s(()=>_i,"flattenError"),float32:s(()=>Q0,"float32"),float64:s(()=>el,"float64"),formatError:s(()=>Si,"formatError"),fromJSONSchema:s(()=>O1,"fromJSONSchema"),function:s(()=>Rr,"function"),getErrorMap:s(()=>z1,"getErrorMap"),globalRegistry:s(()=>Re,"globalRegistry"),gt:s(()=>nt,"gt"),gte:s(()=>Ce,"gte"),guid:s(()=>x0,"guid"),hash:s(()=>Y0,"hash"),hex:s(()=>X0,"hex"),hostname:s(()=>H0,"hostname"),httpUrl:s(()=>S0,"httpUrl"),includes:s(()=>pr,"includes"),instanceof:s(()=>ld,"instanceof"),int:s(()=>Cr,"int"),int32:s(()=>tl,"int32"),int64:s(()=>il,"int64"),intersection:s(()=>_n,"intersection"),invertCodec:s(()=>Yl,"invertCodec"),ipv4:s(()=>T0,"ipv4"),ipv6:s(()=>q0,"ipv6"),iso:s(()=>h0,"iso"),json:s(()=>dd,"json"),jwt:s(()=>G0,"jwt"),keyof:s(()=>El,"keyof"),ksuid:s(()=>R0,"ksuid"),lazy:s(()=>Un,"lazy"),length:s(()=>lu,"length"),literal:s(()=>Ol,"literal"),locales:s(()=>yo,"locales"),looseObject:s(()=>Dl,"looseObject"),looseRecord:s(()=>_l,"looseRecord"),lowercase:s(()=>dr,"lowercase"),lt:s(()=>it,"lt"),lte:s(()=>ze,"lte"),mac:s(()=>U0,"mac"),map:s(()=>Fl,"map"),maxLength:s(()=>ou,"maxLength"),maxSize:s(()=>Mt,"maxSize"),meta:s(()=>S1,"meta"),mime:s(()=>hr,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Nt,"multipleOf"),nan:s(()=>Hl,"nan"),nanoid:s(()=>j0,"nanoid"),nativeEnum:s(()=>Nl,"nativeEnum"),negative:s(()=>rn,"negative"),never:s(()=>Ir,"never"),nonnegative:s(()=>sn,"nonnegative"),nonoptional:s(()=>Rn,"nonoptional"),nonpositive:s(()=>nn,"nonpositive"),normalize:s(()=>gr,"normalize"),null:s(()=>An,"null"),nullable:s(()=>yu,"nullable"),nullish:s(()=>Zl,"nullish"),number:s(()=>xn,"number"),object:s(()=>bl,"object"),optional:s(()=>vu,"optional"),overwrite:s(()=>Ke,"overwrite"),parse:s(()=>v1,"parse"),parseAsync:s(()=>y1,"parseAsync"),partialRecord:s(()=>Il,"partialRecord"),pipe:s(()=>Mr,"pipe"),positive:s(()=>un,"positive"),prefault:s(()=>Mn,"prefault"),preprocess:s(()=>cd,"preprocess"),prettifyError:s(()=>Ca,"prettifyError"),promise:s(()=>nd,"promise"),property:s(()=>an,"property"),readonly:s(()=>Pn,"readonly"),record:s(()=>Fn,"record"),refine:s(()=>qn,"refine"),regex:s(()=>lr,"regex"),regexes:s(()=>ft,"regexes"),registry:s(()=>Ni,"registry"),safeDecode:s(()=>C1,"safeDecode"),safeDecodeAsync:s(()=>A1,"safeDecodeAsync"),safeEncode:s(()=>x1,"safeEncode"),safeEncodeAsync:s(()=>k1,"safeEncodeAsync"),safeParse:s(()=>E1,"safeParse"),safeParseAsync:s(()=>b1,"safeParseAsync"),set:s(()=>zl,"set"),setErrorMap:s(()=>j1,"setErrorMap"),size:s(()=>au,"size"),slugify:s(()=>br,"slugify"),startsWith:s(()=>mr,"startsWith"),strictObject:s(()=>wl,"strictObject"),string:s(()=>pu,"string"),stringFormat:s(()=>K0,"stringFormat"),stringbool:s(()=>F1,"stringbool"),success:s(()=>Wl,"success"),superRefine:s(()=>Zn,"superRefine"),symbol:s(()=>al,"symbol"),templateLiteral:s(()=>ud,"templateLiteral"),toJSONSchema:s(()=>f0,"toJSONSchema"),toLowerCase:s(()=>yr,"toLowerCase"),toUpperCase:s(()=>Er,"toUpperCase"),transform:s(()=>zr,"transform"),treeifyError:s(()=>Ba,"treeifyError"),trim:s(()=>vr,"trim"),tuple:s(()=>Sn,"tuple"),uint32:s(()=>ul,"uint32"),uint64:s(()=>nl,"uint64"),ulid:s(()=>M0,"ulid"),undefined:s(()=>ll,"undefined"),union:s(()=>Fr,"union"),unknown:s(()=>gt,"unknown"),uppercase:s(()=>cr,"uppercase"),url:s(()=>_0,"url"),util:s(()=>te,"util"),uuid:s(()=>C0,"uuid"),uuidv4:s(()=>k0,"uuidv4"),uuidv6:s(()=>A0,"uuidv6"),uuidv7:s(()=>I0,"uuidv7"),void:s(()=>gl,"void"),xid:s(()=>O0,"xid"),xor:s(()=>Bl,"xor")});var b4={};ut(b4,{$ZodAny:s(()=>Ah,"$ZodAny"),$ZodArray:s(()=>jh,"$ZodArray"),$ZodAsyncError:s(()=>Ft,"$ZodAsyncError"),$ZodBase64:s(()=>yh,"$ZodBase64"),$ZodBase64URL:s(()=>Eh,"$ZodBase64URL"),$ZodBigInt:s(()=>Ha,"$ZodBigInt"),$ZodBigIntFormat:s(()=>Bh,"$ZodBigIntFormat"),$ZodBoolean:s(()=>Ka,"$ZodBoolean"),$ZodCIDRv4:s(()=>gh,"$ZodCIDRv4"),$ZodCIDRv6:s(()=>vh,"$ZodCIDRv6"),$ZodCUID:s(()=>ih,"$ZodCUID"),$ZodCUID2:s(()=>nh,"$ZodCUID2"),$ZodCatch:s(()=>Yh,"$ZodCatch"),$ZodCheck:s(()=>de,"$ZodCheck"),$ZodCheckBigIntFormat:s(()=>zf,"$ZodCheckBigIntFormat"),$ZodCheckEndsWith:s(()=>Jf,"$ZodCheckEndsWith"),$ZodCheckGreaterThan:s(()=>La,"$ZodCheckGreaterThan"),$ZodCheckIncludes:s(()=>Lf,"$ZodCheckIncludes"),$ZodCheckLengthEquals:s(()=>Pf,"$ZodCheckLengthEquals"),$ZodCheckLessThan:s(()=>Za,"$ZodCheckLessThan"),$ZodCheckLowerCase:s(()=>qf,"$ZodCheckLowerCase"),$ZodCheckMaxLength:s(()=>Rf,"$ZodCheckMaxLength"),$ZodCheckMaxSize:s(()=>Nf,"$ZodCheckMaxSize"),$ZodCheckMimeType:s(()=>Gf,"$ZodCheckMimeType"),$ZodCheckMinLength:s(()=>Tf,"$ZodCheckMinLength"),$ZodCheckMinSize:s(()=>Mf,"$ZodCheckMinSize"),$ZodCheckMultipleOf:s(()=>Ff,"$ZodCheckMultipleOf"),$ZodCheckNumberFormat:s(()=>jf,"$ZodCheckNumberFormat"),$ZodCheckOverwrite:s(()=>Kf,"$ZodCheckOverwrite"),$ZodCheckProperty:s(()=>Wf,"$ZodCheckProperty"),$ZodCheckRegex:s(()=>Uf,"$ZodCheckRegex"),$ZodCheckSizeEquals:s(()=>Of,"$ZodCheckSizeEquals"),$ZodCheckStartsWith:s(()=>Vf,"$ZodCheckStartsWith"),$ZodCheckStringFormat:s(()=>er,"$ZodCheckStringFormat"),$ZodCheckUpperCase:s(()=>Zf,"$ZodCheckUpperCase"),$ZodCodec:s(()=>ho,"$ZodCodec"),$ZodCustom:s(()=>sg,"$ZodCustom"),$ZodCustomStringFormat:s(()=>Dh,"$ZodCustomStringFormat"),$ZodDate:s(()=>Fh,"$ZodDate"),$ZodDefault:s(()=>Gh,"$ZodDefault"),$ZodDiscriminatedUnion:s(()=>Oh,"$ZodDiscriminatedUnion"),$ZodE164:s(()=>bh,"$ZodE164"),$ZodEmail:s(()=>eh,"$ZodEmail"),$ZodEmoji:s(()=>uh,"$ZodEmoji"),$ZodEncodeError:s(()=>Ci,"$ZodEncodeError"),$ZodEnum:s(()=>qh,"$ZodEnum"),$ZodError:s(()=>$a,"$ZodError"),$ZodExactOptional:s(()=>Jh,"$ZodExactOptional"),$ZodFile:s(()=>Lh,"$ZodFile"),$ZodFunction:s(()=>rg,"$ZodFunction"),$ZodGUID:s(()=>Yf,"$ZodGUID"),$ZodIPv4:s(()=>mh,"$ZodIPv4"),$ZodIPv6:s(()=>fh,"$ZodIPv6"),$ZodISODate:s(()=>dh,"$ZodISODate"),$ZodISODateTime:s(()=>lh,"$ZodISODateTime"),$ZodISODuration:s(()=>ph,"$ZodISODuration"),$ZodISOTime:s(()=>ch,"$ZodISOTime"),$ZodIntersection:s(()=>Rh,"$ZodIntersection"),$ZodJWT:s(()=>wh,"$ZodJWT"),$ZodKSUID:s(()=>oh,"$ZodKSUID"),$ZodLazy:s(()=>ng,"$ZodLazy"),$ZodLiteral:s(()=>Zh,"$ZodLiteral"),$ZodMAC:s(()=>hh,"$ZodMAC"),$ZodMap:s(()=>Ph,"$ZodMap"),$ZodNaN:s(()=>Qh,"$ZodNaN"),$ZodNanoID:s(()=>rh,"$ZodNanoID"),$ZodNever:s(()=>_h,"$ZodNever"),$ZodNonOptional:s(()=>Hh,"$ZodNonOptional"),$ZodNull:s(()=>kh,"$ZodNull"),$ZodNullable:s(()=>Wh,"$ZodNullable"),$ZodNumber:s(()=>Ga,"$ZodNumber"),$ZodNumberFormat:s(()=>$h,"$ZodNumberFormat"),$ZodObject:s(()=>zh,"$ZodObject"),$ZodObjectJIT:s(()=>Nh,"$ZodObjectJIT"),$ZodOptional:s(()=>co,"$ZodOptional"),$ZodPipe:s(()=>fo,"$ZodPipe"),$ZodPrefault:s(()=>Kh,"$ZodPrefault"),$ZodPreprocess:s(()=>eg,"$ZodPreprocess"),$ZodPromise:s(()=>ig,"$ZodPromise"),$ZodReadonly:s(()=>tg,"$ZodReadonly"),$ZodRealError:s(()=>je,"$ZodRealError"),$ZodRecord:s(()=>Th,"$ZodRecord"),$ZodRegistry:s(()=>nv,"$ZodRegistry"),$ZodSet:s(()=>Uh,"$ZodSet"),$ZodString:s(()=>tr,"$ZodString"),$ZodStringFormat:s(()=>se,"$ZodStringFormat"),$ZodSuccess:s(()=>Xh,"$ZodSuccess"),$ZodSymbol:s(()=>xh,"$ZodSymbol"),$ZodTemplateLiteral:s(()=>ug,"$ZodTemplateLiteral"),$ZodTransform:s(()=>Vh,"$ZodTransform"),$ZodTuple:s(()=>ro,"$ZodTuple"),$ZodType:s(()=>X,"$ZodType"),$ZodULID:s(()=>sh,"$ZodULID"),$ZodURL:s(()=>th,"$ZodURL"),$ZodUUID:s(()=>Qf,"$ZodUUID"),$ZodUndefined:s(()=>Ch,"$ZodUndefined"),$ZodUnion:s(()=>ji,"$ZodUnion"),$ZodUnknown:s(()=>Ih,"$ZodUnknown"),$ZodVoid:s(()=>Sh,"$ZodVoid"),$ZodXID:s(()=>ah,"$ZodXID"),$ZodXor:s(()=>Mh,"$ZodXor"),$brand:s(()=>$4,"$brand"),$constructor:s(()=>B,"$constructor"),$input:s(()=>iv,"$input"),$output:s(()=>rv,"$output"),Doc:s(()=>Hf,"Doc"),JSONSchema:s(()=>lD,"JSONSchema"),JSONSchemaGenerator:s(()=>oD,"JSONSchemaGenerator"),NEVER:s(()=>D4,"NEVER"),TimePrecision:s(()=>sv,"TimePrecision"),_any:s(()=>Ko,"_any"),_array:s(()=>u0,"_array"),_base64:s(()=>Yi,"_base64"),_base64url:s(()=>Qi,"_base64url"),_bigint:s(()=>qo,"_bigint"),_boolean:s(()=>Po,"_boolean"),_catch:s(()=>Bv,"_catch"),_check:s(()=>a0,"_check"),_cidrv4:s(()=>Hi,"_cidrv4"),_cidrv6:s(()=>Xi,"_cidrv6"),_coercedBigint:s(()=>Zo,"_coercedBigint"),_coercedBoolean:s(()=>Uo,"_coercedBoolean"),_coercedDate:s(()=>e0,"_coercedDate"),_coercedNumber:s(()=>zo,"_coercedNumber"),_coercedString:s(()=>ko,"_coercedString"),_cuid:s(()=>Zi,"_cuid"),_cuid2:s(()=>Li,"_cuid2"),_custom:s(()=>i0,"_custom"),_date:s(()=>Qo,"_date"),_decode:s(()=>_a,"_decode"),_decodeAsync:s(()=>Fa,"_decodeAsync"),_default:s(()=>wv,"_default"),_discriminatedUnion:s(()=>lv,"_discriminatedUnion"),_e164:s(()=>en,"_e164"),_email:s(()=>Mi,"_email"),_emoji:s(()=>Ui,"_emoji"),_encode:s(()=>Ia,"_encode"),_encodeAsync:s(()=>Sa,"_encodeAsync"),_endsWith:s(()=>fr,"_endsWith"),_enum:s(()=>hv,"_enum"),_file:s(()=>r0,"_file"),_float32:s(()=>Mo,"_float32"),_float64:s(()=>Oo,"_float64"),_gt:s(()=>nt,"_gt"),_gte:s(()=>Ce,"_gte"),_guid:s(()=>ar,"_guid"),_includes:s(()=>pr,"_includes"),_int:s(()=>No,"_int"),_int32:s(()=>Ro,"_int32"),_int64:s(()=>Lo,"_int64"),_intersection:s(()=>dv,"_intersection"),_ipv4:s(()=>Gi,"_ipv4"),_ipv6:s(()=>Ki,"_ipv6"),_isoDate:s(()=>_o,"_isoDate"),_isoDateTime:s(()=>Io,"_isoDateTime"),_isoDuration:s(()=>Fo,"_isoDuration"),_isoTime:s(()=>So,"_isoTime"),_jwt:s(()=>tn,"_jwt"),_ksuid:s(()=>Wi,"_ksuid"),_lazy:s(()=>Av,"_lazy"),_length:s(()=>lu,"_length"),_literal:s(()=>vv,"_literal"),_lowercase:s(()=>dr,"_lowercase"),_lt:s(()=>it,"_lt"),_lte:s(()=>ze,"_lte"),_mac:s(()=>Ao,"_mac"),_map:s(()=>mv,"_map"),_max:s(()=>ze,"_max"),_maxLength:s(()=>ou,"_maxLength"),_maxSize:s(()=>Mt,"_maxSize"),_mime:s(()=>hr,"_mime"),_min:s(()=>Ce,"_min"),_minLength:s(()=>ht,"_minLength"),_minSize:s(()=>st,"_minSize"),_multipleOf:s(()=>Nt,"_multipleOf"),_nan:s(()=>t0,"_nan"),_nanoid:s(()=>qi,"_nanoid"),_nativeEnum:s(()=>gv,"_nativeEnum"),_negative:s(()=>rn,"_negative"),_never:s(()=>Xo,"_never"),_nonnegative:s(()=>sn,"_nonnegative"),_nonoptional:s(()=>Dv,"_nonoptional"),_nonpositive:s(()=>nn,"_nonpositive"),_normalize:s(()=>gr,"_normalize"),_null:s(()=>Go,"_null"),_nullable:s(()=>bv,"_nullable"),_number:s(()=>jo,"_number"),_optional:s(()=>Ev,"_optional"),_overwrite:s(()=>Ke,"_overwrite"),_parse:s(()=>Hu,"_parse"),_parseAsync:s(()=>Xu,"_parseAsync"),_pipe:s(()=>xv,"_pipe"),_positive:s(()=>un,"_positive"),_promise:s(()=>Iv,"_promise"),_property:s(()=>an,"_property"),_readonly:s(()=>Cv,"_readonly"),_record:s(()=>pv,"_record"),_refine:s(()=>n0,"_refine"),_regex:s(()=>lr,"_regex"),_safeDecode:s(()=>za,"_safeDecode"),_safeDecodeAsync:s(()=>Ma,"_safeDecodeAsync"),_safeEncode:s(()=>ja,"_safeEncode"),_safeEncodeAsync:s(()=>Na,"_safeEncodeAsync"),_safeParse:s(()=>Yu,"_safeParse"),_safeParseAsync:s(()=>Qu,"_safeParseAsync"),_set:s(()=>fv,"_set"),_size:s(()=>au,"_size"),_slugify:s(()=>br,"_slugify"),_startsWith:s(()=>mr,"_startsWith"),_string:s(()=>Co,"_string"),_stringFormat:s(()=>du,"_stringFormat"),_stringbool:s(()=>d0,"_stringbool"),_success:s(()=>$v,"_success"),_superRefine:s(()=>s0,"_superRefine"),_symbol:s(()=>Jo,"_symbol"),_templateLiteral:s(()=>kv,"_templateLiteral"),_toLowerCase:s(()=>yr,"_toLowerCase"),_toUpperCase:s(()=>Er,"_toUpperCase"),_transform:s(()=>yv,"_transform"),_trim:s(()=>vr,"_trim"),_tuple:s(()=>cv,"_tuple"),_uint32:s(()=>To,"_uint32"),_uint64:s(()=>Vo,"_uint64"),_ulid:s(()=>Vi,"_ulid"),_undefined:s(()=>Wo,"_undefined"),_union:s(()=>av,"_union"),_unknown:s(()=>Ho,"_unknown"),_uppercase:s(()=>cr,"_uppercase"),_url:s(()=>or,"_url"),_uuid:s(()=>Oi,"_uuid"),_uuidv4:s(()=>Ri,"_uuidv4"),_uuidv6:s(()=>Ti,"_uuidv6"),_uuidv7:s(()=>Pi,"_uuidv7"),_void:s(()=>Yo,"_void"),_xid:s(()=>Ji,"_xid"),_xor:s(()=>ov,"_xor"),clone:s(()=>Se,"clone"),config:s(()=>be,"config"),createStandardJSONSchemaMethod:s(()=>wr,"createStandardJSONSchemaMethod"),createToJSONSchemaMethod:s(()=>_v,"createToJSONSchemaMethod"),decode:s(()=>S5,"decode"),decodeAsync:s(()=>j5,"decodeAsync"),describe:s(()=>o0,"describe"),encode:s(()=>_5,"encode"),encodeAsync:s(()=>F5,"encodeAsync"),extractDefs:s(()=>Rt,"extractDefs"),finalize:s(()=>Tt,"finalize"),flattenError:s(()=>_i,"flattenError"),formatError:s(()=>Si,"formatError"),globalConfig:s(()=>Lu,"globalConfig"),globalRegistry:s(()=>Re,"globalRegistry"),initializeContext:s(()=>Ot,"initializeContext"),isValidBase64:s(()=>Fi,"isValidBase64"),isValidBase64URL:s(()=>Ja,"isValidBase64URL"),isValidJWT:s(()=>Wa,"isValidJWT"),locales:s(()=>yo,"locales"),meta:s(()=>l0,"meta"),parse:s(()=>ka,"parse"),parseAsync:s(()=>Aa,"parseAsync"),prettifyError:s(()=>Ca,"prettifyError"),process:s(()=>ie,"process"),regexes:s(()=>ft,"regexes"),registry:s(()=>Ni,"registry"),safeDecode:s(()=>N5,"safeDecode"),safeDecodeAsync:s(()=>O5,"safeDecodeAsync"),safeEncode:s(()=>z5,"safeEncode"),safeEncodeAsync:s(()=>M5,"safeEncodeAsync"),safeParse:s(()=>ef,"safeParse"),safeParseAsync:s(()=>tf,"safeParseAsync"),toDotPath:s(()=>xa,"toDotPath"),toJSONSchema:s(()=>f0,"toJSONSchema"),treeifyError:s(()=>Ba,"treeifyError"),util:s(()=>te,"util"),version:s(()=>Xf,"version")});var w4,D4=Object.freeze({status:"aborted"});function B(e,t,r){function i(l,d){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let c=a.prototype,p=Object.keys(c);for(let m=0;m<p.length;m++){let f=p[m];f in l||(l[f]=c[f].bind(l))}}s(i,"o"),o(i,"init");let u=r?.Parent??Object;class n extends u{static{s(this,"i")}static{o(this,"Definition")}}Object.defineProperty(n,"name",{value:e});function a(l){var d;let c=r?.Parent?new n:this;i(c,l),(d=c._zod).deferred??(d.deferred=[]);for(let p of c._zod.deferred)p();return c}return s(a,"s"),o(a,"_"),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(a,"name",{value:e}),a}s(B,"k"),o(B,"$constructor");var $4=Symbol("zod_brand"),Ft=class extends Error{static{s(this,"Qe")}static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ci=class extends Error{static{s(this,"St")}static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(w4=globalThis).__zod_globalConfig??(w4.__zod_globalConfig={});var Lu=globalThis.__zod_globalConfig;function be(e){return e&&Object.assign(Lu,e),Lu}s(be,"fe"),o(be,"config");var te={};ut(te,{BIGINT_FORMAT_RANGES:s(()=>P4,"BIGINT_FORMAT_RANGES"),Class:s(()=>I5,"Class"),NUMBER_FORMAT_RANGES:s(()=>T4,"NUMBER_FORMAT_RANGES"),aborted:s(()=>mt,"aborted"),allowsEval:s(()=>N4,"allowsEval"),assert:s(()=>A4,"assert"),assertEqual:s(()=>B4,"assertEqual"),assertIs:s(()=>C4,"assertIs"),assertNever:s(()=>k4,"assertNever"),assertNotEqual:s(()=>x4,"assertNotEqual"),assignProp:s(()=>rt,"assignProp"),base64ToUint8Array:s(()=>wa,"base64ToUint8Array"),base64urlToUint8Array:s(()=>K4,"base64urlToUint8Array"),cached:s(()=>uu,"cached"),captureStackTrace:s(()=>va,"captureStackTrace"),cleanEnum:s(()=>G4,"cleanEnum"),cleanRegex:s(()=>Ju,"cleanRegex"),clone:s(()=>Se,"clone"),cloneDef:s(()=>S4,"cloneDef"),createTransparentProxy:s(()=>R4,"createTransparentProxy"),defineLazy:s(()=>ee,"defineLazy"),esc:s(()=>Ai,"esc"),escapeRegex:s(()=>Ge,"escapeRegex"),explicitlyAborted:s(()=>ba,"explicitlyAborted"),extend:s(()=>Z4,"extend"),finalizeIssue:s(()=>Ae,"finalizeIssue"),floatSafeRemainder:s(()=>ha,"floatSafeRemainder"),getElementAtPath:s(()=>F4,"getElementAtPath"),getEnumValues:s(()=>ki,"getEnumValues"),getLengthableOrigin:s(()=>Gu,"getLengthableOrigin"),getParsedType:s(()=>A5,"getParsedType"),getSizableOrigin:s(()=>Wu,"getSizableOrigin"),hexToUint8Array:s(()=>X4,"hexToUint8Array"),isObject:s(()=>jt,"isObject"),isPlainObject:s(()=>pt,"isPlainObject"),issue:s(()=>Ku,"issue"),joinValues:s(()=>O,"joinValues"),jsonStringifyReplacer:s(()=>Vu,"jsonStringifyReplacer"),merge:s(()=>V4,"merge"),mergeDefs:s(()=>We,"mergeDefs"),normalizeParams:s(()=>T,"normalizeParams"),nullish:s(()=>ct,"nullish"),numKeys:s(()=>M4,"numKeys"),objectClone:s(()=>_4,"objectClone"),omit:s(()=>q4,"omit"),optionalKeys:s(()=>Ea,"optionalKeys"),parsedType:s(()=>G,"parsedType"),partial:s(()=>J4,"partial"),pick:s(()=>U4,"pick"),prefixIssues:s(()=>Fe,"prefixIssues"),primitiveTypes:s(()=>O4,"primitiveTypes"),promiseAllObject:s(()=>j4,"promiseAllObject"),propertyKeyTypes:s(()=>Ii,"propertyKeyTypes"),randomString:s(()=>z4,"randomString"),required:s(()=>W4,"required"),safeExtend:s(()=>L4,"safeExtend"),shallowClone:s(()=>ya,"shallowClone"),slugify:s(()=>ga,"slugify"),stringifyPrimitive:s(()=>J,"stringifyPrimitive"),uint8ArrayToBase64:s(()=>Da,"uint8ArrayToBase64"),uint8ArrayToBase64url:s(()=>H4,"uint8ArrayToBase64url"),uint8ArrayToHex:s(()=>Y4,"uint8ArrayToHex"),unwrapMessage:s(()=>ru,"unwrapMessage")});function B4(e){return e}s(B4,"oI"),o(B4,"assertEqual");function x4(e){return e}s(x4,"iI"),o(x4,"assertNotEqual");function C4(e){}s(C4,"sI"),o(C4,"assertIs");function k4(e){throw new Error("Unexpected value in exhaustive check")}s(k4,"aI"),o(k4,"assertNever");function A4(e){}s(A4,"cI"),o(A4,"assert");function ki(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}s(ki,"In"),o(ki,"getEnumValues");function O(e,t="|"){return e.map(r=>J(r)).join(t)}s(O,"R"),o(O,"joinValues");function Vu(e,t){return typeof t=="bigint"?t.toString():t}s(Vu,"wr"),o(Vu,"jsonStringifyReplacer");function uu(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}s(uu,"xr"),o(uu,"cached");function ct(e){return e==null}s(ct,"It"),o(ct,"nullish");function Ju(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}s(Ju,"Rn"),o(Ju,"cleanRegex");function ha(e,t){let r=e/t,i=Math.round(r),u=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<u?0:r-i}s(ha,"Sc"),o(ha,"floatSafeRemainder");var I4=Symbol("evaluating");function ee(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==I4)return i===void 0&&(i=I4,i=r()),i},set(u){Object.defineProperty(e,t,{value:u})},configurable:!0})}s(ee,"Q"),o(ee,"defineLazy");function _4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}s(_4,"uI"),o(_4,"objectClone");function rt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}s(rt,"Rt"),o(rt,"assignProp");function We(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}s(We,"gt"),o(We,"mergeDefs");function S4(e){return We(e._zod.def)}s(S4,"lI"),o(S4,"cloneDef");function F4(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}s(F4,"dI"),o(F4,"getElementAtPath");function j4(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let u={};for(let n=0;n<t.length;n++)u[t[n]]=i[n];return u})}s(j4,"pI"),o(j4,"promiseAllObject");function z4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}s(z4,"fI"),o(z4,"randomString");function Ai(e){return JSON.stringify(e)}s(Ai,"ai"),o(Ai,"esc");function ga(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}s(ga,"Ic"),o(ga,"slugify");var va="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(jt,"Yt"),o(jt,"isObject");var N4=uu(()=>{if(Lu.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function pt(e){if(jt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(jt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}s(pt,"Et"),o(pt,"isPlainObject");function ya(e){return pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}s(ya,"Ec"),o(ya,"shallowClone");function M4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}s(M4,"mI"),o(M4,"numKeys");var A5=o(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}`)}},"getParsedType"),Ii=new Set(["string","number","symbol"]),O4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Ge,"Je"),o(Ge,"escapeRegex");function Se(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}s(Se,"Te"),o(Se,"clone");function T(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};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:o(()=>t.error,"error")}:t}s(T,"B"),o(T,"normalizeParams");function R4(e){let t;return new Proxy({},{get(r,i,u){return t??(t=e()),Reflect.get(t,i,u)},set(r,i,u,n){return t??(t=e()),Reflect.set(t,i,u,n)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,u){return t??(t=e()),Reflect.defineProperty(t,i,u)}})}s(R4,"gI"),o(R4,"createTransparentProxy");function J(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}s(J,"D"),o(J,"stringifyPrimitive");function Ea(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}s(Ea,"Ac"),o(Ea,"optionalKeys");var T4={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]},P4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function U4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let n={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(n[a]=r.shape[a])}return rt(this,"shape",n),n},checks:[]});return Se(e,u)}s(U4,"vI"),o(U4,"pick");function q4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let u=We(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete n[a]}return rt(this,"shape",n),n},checks:[]});return Se(e,u)}s(q4,"yI"),o(q4,"omit");function Z4(e,t){if(!pt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let u=e._zod.def.shape;for(let n in t)if(Object.getOwnPropertyDescriptor(u,n)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=We(e._zod.def,{get shape(){let u={...e._zod.def.shape,...t};return rt(this,"shape",u),u}});return Se(e,i)}s(Z4,"bI"),o(Z4,"extend");function L4(e,t){if(!pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=We(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return rt(this,"shape",i),i}});return Se(e,r)}s(L4,"wI"),o(L4,"safeExtend");function V4(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=We(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return rt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Se(e,r)}s(V4,"xI"),o(V4,"merge");function J4(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let u=We(t._zod.def,{get shape(){let n=t._zod.def.shape,a={...n};if(r)for(let l in r){if(!(l in n))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(a[l]=e?new e({type:"optional",innerType:n[l]}):n[l])}else for(let l in n)a[l]=e?new e({type:"optional",innerType:n[l]}):n[l];return rt(this,"shape",a),a},checks:[]});return Se(t,u)}s(J4,"$I"),o(J4,"partial");function W4(e,t,r){let i=We(t._zod.def,{get shape(){let u=t._zod.def.shape,n={...u};if(r)for(let a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(n[a]=new e({type:"nonoptional",innerType:u[a]}))}else for(let a in u)n[a]=new e({type:"nonoptional",innerType:u[a]});return rt(this,"shape",n),n}});return Se(t,i)}s(W4,"_I"),o(W4,"required");function mt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}s(mt,"Tt"),o(mt,"aborted");function ba(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}s(ba,"Oc"),o(ba,"explicitlyAborted");function Fe(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}s(Fe,"Oe"),o(Fe,"prefixIssues");function ru(e){return typeof e=="string"?e:e?.message}s(ru,"Sn"),o(ru,"unwrapMessage");function Ae(e,t,r){let i=e.message?e.message:ru(e.inst?._zod.def?.error?.(e))??ru(t?.error?.(e))??ru(r.customError?.(e))??ru(r.localeError?.(e))??"Invalid input",{inst:u,continue:n,input:a,...l}=e;return l.path??(l.path=[]),l.message=i,t?.reportInput&&(l.input=a),l}s(Ae,"Ae"),o(Ae,"finalizeIssue");function Wu(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}s(Wu,"Tn"),o(Wu,"getSizableOrigin");function Gu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}s(Gu,"An"),o(Gu,"getLengthableOrigin");function G(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}s(G,"U"),o(G,"parsedType");function Ku(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}s(Ku,"$r"),o(Ku,"issue");function G4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}s(G4,"kI"),o(G4,"cleanEnum");function wa(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}s(wa,"sw"),o(wa,"base64ToUint8Array");function Da(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}s(Da,"aw"),o(Da,"uint8ArrayToBase64");function K4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return wa(t+r)}s(K4,"SI"),o(K4,"base64urlToUint8Array");function H4(e){return Da(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}s(H4,"II"),o(H4,"uint8ArrayToBase64url");function X4(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}s(X4,"RI"),o(X4,"hexToUint8Array");function Y4(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}s(Y4,"EI"),o(Y4,"uint8ArrayToHex");var I5=class{static{s(this,"kc")}static{o(this,"Class")}constructor(...e){}},Q4=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Vu,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$a=B("$ZodError",Q4),je=B("$ZodError",Q4,{Parent:Error});function _i(e,t=r=>r.message){let r={},i=[];for(let u of e.issues)u.path.length>0?(r[u.path[0]]=r[u.path[0]]||[],r[u.path[0]].push(t(u))):i.push(t(u));return{formErrors:i,fieldErrors:r}}s(_i,"zn"),o(_i,"flattenError");function Si(e,t=r=>r.message){let r={_errors:[]},i=o((u,n=[])=>{for(let a of u.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>i({issues:l},[...n,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...n,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...n,...a.path]);else{let l=[...n,...a.path];if(l.length===0)r._errors.push(t(a));else{let d=r,c=0;for(;c<l.length;){let p=l[c];c===l.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(a))):d[p]=d[p]||{_errors:[]},d=d[p],c++}}}},"processError");return i(e),r}s(Si,"On"),o(Si,"formatError");function Ba(e,t=r=>r.message){let r={errors:[]},i=o((u,n=[])=>{var a,l;for(let d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(c=>i({issues:c},[...n,...d.path]));else if(d.code==="invalid_key")i({issues:d.issues},[...n,...d.path]);else if(d.code==="invalid_element")i({issues:d.issues},[...n,...d.path]);else{let c=[...n,...d.path];if(c.length===0){r.errors.push(t(d));continue}let p=r,m=0;for(;m<c.length;){let f=c[m],h=m===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(l=p.items)[f]??(l[f]={errors:[]}),p=p.items[f]),h&&p.errors.push(t(d)),m++}}},"processError");return i(e),r}s(Ba,"Mc"),o(Ba,"treeifyError");function xa(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}s(xa,"uw"),o(xa,"toDotPath");function Ca(e){let t=[],r=[...e.issues].sort((i,u)=>(i.path??[]).length-(u.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${xa(i.path)}`);return t.join(`
|
|
2
|
+
`)}s(Ca,"Nc"),o(Ca,"prettifyError");var Hu=o(e=>(t,r,i,u)=>{let n=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new Ft;if(a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,n,be())));throw va(l,u?.callee),l}return a.value},"_parse"),ka=Hu(je),Xu=o(e=>async(t,r,i,u)=>{let n=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise&&(a=await a),a.issues.length){let l=new(u?.Err??e)(a.issues.map(d=>Ae(d,n,be())));throw va(l,u?.callee),l}return a.value},"_parseAsync"),Aa=Xu(je),Yu=o(e=>(t,r,i)=>{let u=i?{...i,async:!1}:{async:!1},n=t._zod.run({value:r,issues:[]},u);if(n instanceof Promise)throw new Ft;return n.issues.length?{success:!1,error:new(e??$a)(n.issues.map(a=>Ae(a,u,be())))}:{success:!0,data:n.value}},"_safeParse"),ef=Yu(je),Qu=o(e=>async(t,r,i)=>{let u=i?{...i,async:!0}:{async:!0},n=t._zod.run({value:r,issues:[]},u);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new e(n.issues.map(a=>Ae(a,u,be())))}:{success:!0,data:n.value}},"_safeParseAsync"),tf=Qu(je),Ia=o(e=>(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Hu(e)(t,r,u)},"_encode"),_5=Ia(je),_a=o(e=>(t,r,i)=>Hu(e)(t,r,i),"_decode"),S5=_a(je),Sa=o(e=>async(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Xu(e)(t,r,u)},"_encodeAsync"),F5=Sa(je),Fa=o(e=>async(t,r,i)=>Xu(e)(t,r,i),"_decodeAsync"),j5=Fa(je),ja=o(e=>(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Yu(e)(t,r,u)},"_safeEncode"),z5=ja(je),za=o(e=>(t,r,i)=>Yu(e)(t,r,i),"_safeDecode"),N5=za(je),Na=o(e=>async(t,r,i)=>{let u=i?{...i,direction:"backward"}:{direction:"backward"};return Qu(e)(t,r,u)},"_safeEncodeAsync"),M5=Na(je),Ma=o(e=>async(t,r,i)=>Qu(e)(t,r,i),"_safeDecodeAsync"),O5=Ma(je),ft={};ut(ft,{base64:s(()=>yf,"base64"),base64url:s(()=>Ra,"base64url"),bigint:s(()=>Bf,"bigint"),boolean:s(()=>Cf,"boolean"),browserEmail:s(()=>V5,"browserEmail"),cidrv4:s(()=>gf,"cidrv4"),cidrv6:s(()=>vf,"cidrv6"),cuid:s(()=>uf,"cuid"),cuid2:s(()=>rf,"cuid2"),date:s(()=>Df,"date"),datetime:s(()=>Ua,"datetime"),domain:s(()=>G5,"domain"),duration:s(()=>lf,"duration"),e164:s(()=>bf,"e164"),email:s(()=>cf,"email"),emoji:s(()=>Oa,"emoji"),extendedDuration:s(()=>R5,"extendedDuration"),guid:s(()=>df,"guid"),hex:s(()=>K5,"hex"),hostname:s(()=>W5,"hostname"),html5Email:s(()=>q5,"html5Email"),httpProtocol:s(()=>Ef,"httpProtocol"),idnEmail:s(()=>L5,"idnEmail"),integer:s(()=>xf,"integer"),ipv4:s(()=>mf,"ipv4"),ipv6:s(()=>ff,"ipv6"),ksuid:s(()=>af,"ksuid"),lowercase:s(()=>If,"lowercase"),mac:s(()=>hf,"mac"),md5_base64:s(()=>X5,"md5_base64"),md5_base64url:s(()=>Y5,"md5_base64url"),md5_hex:s(()=>H5,"md5_hex"),nanoid:s(()=>of,"nanoid"),null:s(()=>kf,"null"),number:s(()=>qa,"number"),rfc5322Email:s(()=>Z5,"rfc5322Email"),sha1_base64:s(()=>ew,"sha1_base64"),sha1_base64url:s(()=>tw,"sha1_base64url"),sha1_hex:s(()=>Q5,"sha1_hex"),sha256_base64:s(()=>rw,"sha256_base64"),sha256_base64url:s(()=>iw,"sha256_base64url"),sha256_hex:s(()=>uw,"sha256_hex"),sha384_base64:s(()=>sw,"sha384_base64"),sha384_base64url:s(()=>aw,"sha384_base64url"),sha384_hex:s(()=>nw,"sha384_hex"),sha512_base64:s(()=>lw,"sha512_base64"),sha512_base64url:s(()=>dw,"sha512_base64url"),sha512_hex:s(()=>ow,"sha512_hex"),string:s(()=>$f,"string"),time:s(()=>Pa,"time"),ulid:s(()=>nf,"ulid"),undefined:s(()=>Af,"undefined"),unicodeEmail:s(()=>pf,"unicodeEmail"),uppercase:s(()=>_f,"uppercase"),uuid:s(()=>iu,"uuid"),uuid4:s(()=>T5,"uuid4"),uuid6:s(()=>P5,"uuid6"),uuid7:s(()=>U5,"uuid7"),xid:s(()=>sf,"xid")});var uf=/^[cC][0-9a-z]{6,}$/,rf=/^[0-9a-z]+$/,nf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sf=/^[0-9a-vA-V]{20}$/,af=/^[A-Za-z0-9]{27}$/,of=/^[a-zA-Z0-9_-]{21}$/,lf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,R5=/^[-+]?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)?)??$/,df=/^([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})$/,iu=o(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),T5=iu(4),P5=iu(6),U5=iu(7),cf=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,q5=/^[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])?)*$/,Z5=/^(([^<>()\[\]\\.,;:\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,}))$/,pf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,L5=pf,V5=/^[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])?)*$/,J5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Oa(){return new RegExp(J5,"u")}s(Oa,"Jc"),o(Oa,"emoji");var mf=/^(?:(?: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])$/,ff=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hf=o(e=>{let t=Ge(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),gf=/^((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])$/,vf=/^(([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])$/,yf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ra=/^[A-Za-z0-9_-]*$/,W5=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,G5=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ef=/^https?$/,bf=/^\+[1-9]\d{6,14}$/,wf="(?:(?:\\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])))",Df=new RegExp(`^${wf}$`);function Ta(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+)?)?`}s(Ta,"pw"),o(Ta,"timeSource");function Pa(e){return new RegExp(`^${Ta(e)}$`)}s(Pa,"nu"),o(Pa,"time");function Ua(e){let t=Ta({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${wf}T(?:${i})$`)}s(Ua,"ou"),o(Ua,"datetime");var $f=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Bf=/^-?\d+n?$/,xf=/^-?\d+$/,qa=/^-?\d+(?:\.\d+)?$/,Cf=/^(?:true|false)$/i,kf=/^null$/i,Af=/^undefined$/i,If=/^[^A-Z]*$/,_f=/^[^a-z]*$/,K5=/^[0-9a-fA-F]*$/;function nu(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}s(nu,"Mn"),o(nu,"fixedBase64");function su(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}s(su,"Nn"),o(su,"fixedBase64url");var H5=/^[0-9a-fA-F]{32}$/,X5=nu(22,"=="),Y5=su(22),Q5=/^[0-9a-fA-F]{40}$/,ew=nu(27,"="),tw=su(27),uw=/^[0-9a-fA-F]{64}$/,rw=nu(43,"="),iw=su(43),nw=/^[0-9a-fA-F]{96}$/,sw=nu(64,""),aw=su(64),ow=/^[0-9a-fA-F]{128}$/,lw=nu(86,"=="),dw=su(86),de=B("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Sf={number:"number",bigint:"bigint",object:"date"},Za=B("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let r=Sf[typeof t.value];e._zod.onattach.push(i=>{let u=i._zod.bag,n=(t.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?u.maximum=t.value:u.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),La=B("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=Sf[typeof t.value];e._zod.onattach.push(i=>{let u=i._zod.bag,n=(t.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?u.minimum=t.value:u.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ff=B("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):ha(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),jf=B("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[u,n]=T4[t.format];e._zod.onattach.push(a=>{let l=a._zod.bag;l.format=t.format,l.minimum=u,l.maximum=n,r&&(l.pattern=xf)}),e._zod.check=a=>{let l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}l<u&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:u,inclusive:!0,inst:e,continue:!t.abort}),l>n&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),zf=B("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[r,i]=P4[t.format];e._zod.onattach.push(u=>{let n=u._zod.bag;n.format=t.format,n.minimum=r,n.maximum=i}),e._zod.check=u=>{let n=u.value;n<r&&u.issues.push({origin:"bigint",input:n,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),n>i&&u.issues.push({origin:"bigint",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Nf=B("$ZodCheckMaxSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let u=i.value;u.size<=t.maximum||i.issues.push({origin:Wu(u),code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Mf=B("$ZodCheckMinSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let u=i.value;u.size>=t.minimum||i.issues.push({origin:Wu(u),code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Of=B("$ZodCheckSizeEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.size!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag;u.minimum=t.size,u.maximum=t.size,u.size=t.size}),e._zod.check=i=>{let u=i.value,n=u.size;if(n===t.size)return;let a=n>t.size;i.issues.push({origin:Wu(u),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Rf=B("$ZodCheckMaxLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let u=i.value;if(u.length<=t.maximum)return;let n=Gu(u);i.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Tf=B("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let u=i.value;if(u.length>=t.minimum)return;let n=Gu(u);i.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Pf=B("$ZodCheckLengthEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let u=i.value;return!ct(u)&&u.length!==void 0}),e._zod.onattach.push(i=>{let u=i._zod.bag;u.minimum=t.length,u.maximum=t.length,u.length=t.length}),e._zod.check=i=>{let u=i.value,n=u.length;if(n===t.length)return;let a=Gu(u),l=n>t.length;i.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),er=B("$ZodCheckStringFormat",(e,t)=>{var r,i;de.init(e,t),e._zod.onattach.push(u=>{let n=u._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:t.format,input:u.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Uf=B("$ZodCheckRegex",(e,t)=>{er.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qf=B("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=If),er.init(e,t)}),Zf=B("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_f),er.init(e,t)}),Lf=B("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let r=Ge(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(u=>{let n=u._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=u=>{u.value.includes(t.includes,t.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:u.value,inst:e,continue:!t.abort})}}),Vf=B("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`^${Ge(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let u=i._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Jf=B("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`.*${Ge(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let u=i._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Va(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues))}s(Va,"fw"),o(Va,"handleCheckPropertyResult");var Wf=B("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(u=>Va(u,r,t.property));Va(i,r,t.property)}}),Gf=B("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Kf=B("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),Hf=class{static{s(this,"Pn")}static{o(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
|
|
3
3
|
`).filter(u=>u),r=Math.min(...t.map(u=>u.length-u.trimStart().length)),i=t.map(u=>u.slice(r)).map(u=>" ".repeat(this.indent*2)+u);for(let u of i)this.content.push(u)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...t,r.join(`
|
|
4
|
-
`))}},Hf={major:4,minor:4,patch:3},X=B("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hf;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let u of i)for(let n of u._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let u=o((a,l,d)=>{let c=mt(a),p;for(let m of l){if(m._zod.def.when){if(ba(a)||!m._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&d?.async===!1)throw new Ft;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(c||(c=mt(a,f)))});else{if(a.issues.length===f)continue;c||(c=mt(a,f))}}return p?p.then(()=>a):a},"runChecks"),n=o((a,l,d)=>{if(mt(a))return a.aborted=!0,a;let c=u(l,i,d);if(c instanceof Promise){if(d.async===!1)throw new Ft;return c.then(p=>e._zod.parse(p,d))}return e._zod.parse(c,d)},"handleCanaryResult");e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(p=>n(p,a,l)):n(c,a,l)}let d=e._zod.parse(a,l);if(d instanceof Promise){if(l.async===!1)throw new Ft;return d.then(c=>u(c,i,l))}return u(d,i,l)}}ee(e,"~standard",()=>({validate:o(u=>{try{let n=Q4(e,u);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ef(e,u).then(n=>n.success?{value:n.data}:{issues:n.error?.issues})}},"validate"),vendor:"zod",version:1}))}),tr=B("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Df(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),se=B("$ZodStringFormat",(e,t)=>{er.init(e,t),tr.init(e,t)}),Xf=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=lf),se.init(e,t)}),Yf=B("$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=iu(r))}else t.pattern??(t.pattern=iu());se.init(e,t)}),Qf=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=df),se.init(e,t)}),eh=B("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===yf.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let u=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=u.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),th=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Oa()),se.init(e,t)}),uh=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=af),se.init(e,t)}),rh=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tf),se.init(e,t)}),ih=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uf),se.init(e,t)}),nh=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rf),se.init(e,t)}),sh=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nf),se.init(e,t)}),ah=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=sf),se.init(e,t)}),oh=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ua(t)),se.init(e,t)}),lh=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wf),se.init(e,t)}),dh=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Pa(t)),se.init(e,t)}),ch=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=of),se.init(e,t)}),ph=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pf),se.init(e,t),e._zod.bag.format="ipv4"}),mh=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mf),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),fh=B("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=ff(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),hh=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hf),se.init(e,t)}),gh=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gf),se.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[u,n]=i;if(!n)throw new Error;let a=Number(n);if(`${a}`!==n)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${u}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Fi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}s(Fi,"Qu"),o(Fi,"isValidBase64");var vh=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=vf),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Fi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ja(e){if(!Ra.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fi(r)}s(Ja,"Aw"),o(Ja,"isValidBase64URL");var yh=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ra),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ja(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Eh=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ef),se.init(e,t)});function Wa(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let u=JSON.parse(atob(i));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch{return!1}}s(Wa,"jw"),o(Wa,"isValidJWT");var bh=B("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{Wa(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),wh=B("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ga=B("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??qa,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let u=r.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return r;let n=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...n?{received:n}:{}}),r}}),Dh=B("$ZodNumberFormat",(e,t)=>{Ff.init(e,t),Ga.init(e,t)}),Ka=B("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=xf,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let u=r.value;return typeof u=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),r}}),Ha=B("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=$f,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),$h=B("$ZodBigIntFormat",(e,t)=>{jf.init(e,t),Ha.init(e,t)}),Bh=B("$ZodSymbol",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return typeof u=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:u,inst:e}),r}}),xh=B("$ZodUndefined",(e,t)=>{X.init(e,t),e._zod.pattern=kf,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:u,inst:e}),r}}),Ch=B("$ZodNull",(e,t)=>{X.init(e,t),e._zod.pattern=Cf,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let u=r.value;return u===null||r.issues.push({expected:"null",code:"invalid_type",input:u,inst:e}),r}}),kh=B("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Ah=B("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Ih=B("$ZodNever",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),_h=B("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"void",code:"invalid_type",input:u,inst:e}),r}}),Sh=B("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let u=r.value,n=u instanceof Date;return n&&!Number.isNaN(u.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:u,...n?{received:"Invalid Date"}:{},inst:e}),r}});function Xa(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(Xa,"gw"),o(Xa,"handleArrayResult");var Fh=B("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!Array.isArray(u))return r.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),r;r.value=Array(u.length);let n=[];for(let a=0;a<u.length;a++){let l=u[a],d=t.element._zod.run({value:l,issues:[]},i);d instanceof Promise?n.push(d.then(c=>Xa(c,r,a))):Xa(d,r,a)}return n.length?Promise.all(n).then(()=>r):r}});function ur(e,t,r,i,u,n){let a=r in i;if(e.issues.length){if(u&&n&&!a)return;t.issues.push(...Fe(r,e.issues))}if(!a&&!u){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}s(ur,"Ii"),o(ur,"handlePropertyResult");function Ya(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Ea(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}s(Ya,"zw"),o(Ya,"normalizeDef");function Qa(e,t,r,i,u,n){let a=[],l=u.keySet,d=u.catchall._zod,c=d.def.type,p=d.optin==="optional",m=d.optout==="optional";for(let f in t){if(f==="__proto__"||l.has(f))continue;if(c==="never"){a.push(f);continue}let h=d.run({value:t[f],issues:[]},i);h instanceof Promise?e.push(h.then(g=>ur(g,r,f,t,p,m))):ur(h,r,f,t,p,m)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:n}),e.length?Promise.all(e).then(()=>r):r}s(Qa,"Ow"),o(Qa,"handleCatchall");var jh=B("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let r=uu(()=>Ya(t));ee(e._zod,"propValues",()=>{let a=t.shape,l={};for(let d in a){let c=a[d]._zod;if(c.values){l[d]??(l[d]=new Set);for(let p of c.values)l[d].add(p)}}return l});let i=jt,u=t.catchall,n;e._zod.parse=(a,l)=>{n??(n=r.value);let d=a.value;if(!i(d))return a.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),a;a.value={};let c=[],p=n.shape;for(let m of n.keys){let f=p[m],h=f._zod.optin==="optional",g=f._zod.optout==="optional",b=f._zod.run({value:d[m],issues:[]},l);b instanceof Promise?c.push(b.then(x=>ur(x,a,m,d,h,g))):ur(b,a,m,d,h,g)}return u?Qa(c,d,a,l,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),zh=B("$ZodObjectJIT",(e,t)=>{jh.init(e,t);let r=e._zod.parse,i=uu(()=>Ya(t)),u=o(m=>{let f=new Kf(["shape","payload","ctx"]),h=i.value,g=o(w=>{let k=Ai(w);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`},"parseStr");f.write("const input = payload.value;");let b=Object.create(null),x=0;for(let w of h.keys)b[w]=`key_${x++}`;f.write("const newResult = {};");for(let w of h.keys){let k=b[w],C=Ai(w),M=m[w],y=M?._zod?.optin==="optional",D=M?._zod?.optout==="optional";f.write(`const ${k} = ${g(w)};`),y&&D?f.write(`
|
|
4
|
+
`))}},Xf={major:4,minor:4,patch:3},X=B("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xf;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let u of i)for(let n of u._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let u=o((a,l,d)=>{let c=mt(a),p;for(let m of l){if(m._zod.def.when){if(ba(a)||!m._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,h=m._zod.check(a);if(h instanceof Promise&&d?.async===!1)throw new Ft;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,a.issues.length!==f&&(c||(c=mt(a,f)))});else{if(a.issues.length===f)continue;c||(c=mt(a,f))}}return p?p.then(()=>a):a},"runChecks"),n=o((a,l,d)=>{if(mt(a))return a.aborted=!0,a;let c=u(l,i,d);if(c instanceof Promise){if(d.async===!1)throw new Ft;return c.then(p=>e._zod.parse(p,d))}return e._zod.parse(c,d)},"handleCanaryResult");e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(p=>n(p,a,l)):n(c,a,l)}let d=e._zod.parse(a,l);if(d instanceof Promise){if(l.async===!1)throw new Ft;return d.then(c=>u(c,i,l))}return u(d,i,l)}}ee(e,"~standard",()=>({validate:o(u=>{try{let n=ef(e,u);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return tf(e,u).then(n=>n.success?{value:n.data}:{issues:n.error?.issues})}},"validate"),vendor:"zod",version:1}))}),tr=B("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$f(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),se=B("$ZodStringFormat",(e,t)=>{er.init(e,t),tr.init(e,t)}),Yf=B("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=df),se.init(e,t)}),Qf=B("$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=iu(r))}else t.pattern??(t.pattern=iu());se.init(e,t)}),eh=B("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cf),se.init(e,t)}),th=B("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===Ef.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let u=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=u.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),uh=B("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Oa()),se.init(e,t)}),rh=B("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=of),se.init(e,t)}),ih=B("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uf),se.init(e,t)}),nh=B("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rf),se.init(e,t)}),sh=B("$ZodULID",(e,t)=>{t.pattern??(t.pattern=nf),se.init(e,t)}),ah=B("$ZodXID",(e,t)=>{t.pattern??(t.pattern=sf),se.init(e,t)}),oh=B("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=af),se.init(e,t)}),lh=B("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ua(t)),se.init(e,t)}),dh=B("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Df),se.init(e,t)}),ch=B("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Pa(t)),se.init(e,t)}),ph=B("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=lf),se.init(e,t)}),mh=B("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=mf),se.init(e,t),e._zod.bag.format="ipv4"}),fh=B("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ff),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),hh=B("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=hf(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),gh=B("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=gf),se.init(e,t)}),vh=B("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vf),se.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[u,n]=i;if(!n)throw new Error;let a=Number(n);if(`${a}`!==n)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${u}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Fi(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}s(Fi,"Qu"),o(Fi,"isValidBase64");var yh=B("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yf),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Fi(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ja(e){if(!Ra.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fi(r)}s(Ja,"Aw"),o(Ja,"isValidBase64URL");var Eh=B("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ra),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ja(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),bh=B("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bf),se.init(e,t)});function Wa(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let u=JSON.parse(atob(i));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch{return!1}}s(Wa,"jw"),o(Wa,"isValidJWT");var wh=B("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{Wa(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Dh=B("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ga=B("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??qa,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let u=r.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return r;let n=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...n?{received:n}:{}}),r}}),$h=B("$ZodNumberFormat",(e,t)=>{jf.init(e,t),Ga.init(e,t)}),Ka=B("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=Cf,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let u=r.value;return typeof u=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),r}}),Ha=B("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=Bf,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Bh=B("$ZodBigIntFormat",(e,t)=>{zf.init(e,t),Ha.init(e,t)}),xh=B("$ZodSymbol",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return typeof u=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:u,inst:e}),r}}),Ch=B("$ZodUndefined",(e,t)=>{X.init(e,t),e._zod.pattern=Af,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:u,inst:e}),r}}),kh=B("$ZodNull",(e,t)=>{X.init(e,t),e._zod.pattern=kf,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let u=r.value;return u===null||r.issues.push({expected:"null",code:"invalid_type",input:u,inst:e}),r}}),Ah=B("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Ih=B("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),_h=B("$ZodNever",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Sh=B("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return typeof u>"u"||r.issues.push({expected:"void",code:"invalid_type",input:u,inst:e}),r}}),Fh=B("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let u=r.value,n=u instanceof Date;return n&&!Number.isNaN(u.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:u,...n?{received:"Invalid Date"}:{},inst:e}),r}});function Xa(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(Xa,"gw"),o(Xa,"handleArrayResult");var jh=B("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!Array.isArray(u))return r.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),r;r.value=Array(u.length);let n=[];for(let a=0;a<u.length;a++){let l=u[a],d=t.element._zod.run({value:l,issues:[]},i);d instanceof Promise?n.push(d.then(c=>Xa(c,r,a))):Xa(d,r,a)}return n.length?Promise.all(n).then(()=>r):r}});function ur(e,t,r,i,u,n){let a=r in i;if(e.issues.length){if(u&&n&&!a)return;t.issues.push(...Fe(r,e.issues))}if(!a&&!u){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}s(ur,"Ii"),o(ur,"handlePropertyResult");function Ya(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Ea(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}s(Ya,"zw"),o(Ya,"normalizeDef");function Qa(e,t,r,i,u,n){let a=[],l=u.keySet,d=u.catchall._zod,c=d.def.type,p=d.optin==="optional",m=d.optout==="optional";for(let f in t){if(f==="__proto__"||l.has(f))continue;if(c==="never"){a.push(f);continue}let h=d.run({value:t[f],issues:[]},i);h instanceof Promise?e.push(h.then(g=>ur(g,r,f,t,p,m))):ur(h,r,f,t,p,m)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:n}),e.length?Promise.all(e).then(()=>r):r}s(Qa,"Ow"),o(Qa,"handleCatchall");var zh=B("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let r=uu(()=>Ya(t));ee(e._zod,"propValues",()=>{let a=t.shape,l={};for(let d in a){let c=a[d]._zod;if(c.values){l[d]??(l[d]=new Set);for(let p of c.values)l[d].add(p)}}return l});let i=jt,u=t.catchall,n;e._zod.parse=(a,l)=>{n??(n=r.value);let d=a.value;if(!i(d))return a.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),a;a.value={};let c=[],p=n.shape;for(let m of n.keys){let f=p[m],h=f._zod.optin==="optional",g=f._zod.optout==="optional",b=f._zod.run({value:d[m],issues:[]},l);b instanceof Promise?c.push(b.then(x=>ur(x,a,m,d,h,g))):ur(b,a,m,d,h,g)}return u?Qa(c,d,a,l,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),Nh=B("$ZodObjectJIT",(e,t)=>{zh.init(e,t);let r=e._zod.parse,i=uu(()=>Ya(t)),u=o(m=>{let f=new Hf(["shape","payload","ctx"]),h=i.value,g=o(w=>{let k=Ai(w);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`},"parseStr");f.write("const input = payload.value;");let b=Object.create(null),x=0;for(let w of h.keys)b[w]=`key_${x++}`;f.write("const newResult = {};");for(let w of h.keys){let k=b[w],C=Ai(w),M=m[w],y=M?._zod?.optin==="optional",D=M?._zod?.optout==="optional";f.write(`const ${k} = ${g(w)};`),y&&D?f.write(`
|
|
5
5
|
if (${k}.issues.length) {
|
|
6
6
|
if (${C} in input) {
|
|
7
7
|
payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
|
|
@@ -60,41 +60,41 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let $=f.compile();return(w,k)=>$(m,w,k)},"generateFastpass"),n,a=jt,l=!Lu.jitless,d=l&&z4.value,c=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=i.value);let h=m.value;return a(h)?l&&d&&f?.async===!1&&f.jitless!==!0?(n||(n=u(t.shape)),m=n(m,f),c?Qa([],h,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function eo(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let u=e.filter(n=>!mt(n));return u.length===1?(t.value=u[0].value,u[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ae(a,i,be())))}),t)}s(eo,"vw"),o(eo,"handleUnionResults");var ji=B("$ZodUnion",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Ju(u.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,u)=>{if(r)return r(i,u);let n=!1,a=[];for(let l of t.options){let d=l._zod.run({value:i.value,issues:[]},u);if(d instanceof Promise)a.push(d),n=!0;else{if(d.issues.length===0)return d;a.push(d)}}return n?Promise.all(a).then(l=>eo(l,i,e,u)):eo(a,i,e,u)}});function to(e,t,r,i){let u=e.filter(n=>n.issues.length===0);return u.length===1?(t.value=u[0].value,t):(u.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ae(a,i,be())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}s(to,"yw"),o(to,"handleExclusiveUnionResults");var Nh=B("$ZodXor",(e,t)=>{ji.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,u)=>{if(r)return r(i,u);let n=!1,a=[];for(let l of t.options){let d=l._zod.run({value:i.value,issues:[]},u);d instanceof Promise?(a.push(d),n=!0):a.push(d)}return n?Promise.all(a).then(l=>to(l,i,e,u)):to(a,i,e,u)}}),Mh=B("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ji.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let u={};for(let n of t.options){let a=n._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[l,d]of Object.entries(a)){u[l]||(u[l]=new Set);for(let c of d)u[l].add(c)}}return u});let i=uu(()=>{let u=t.options,n=new Map;for(let a of u){let l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let d of l){if(n.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);n.set(d,a)}}return n});e._zod.parse=(u,n)=>{let a=u.value;if(!jt(a))return u.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),u;let l=i.value.get(a?.[t.discriminator]);return l?l._zod.run(u,n):t.unionFallback||n.direction==="backward"?r(u,n):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:a,path:[t.discriminator],inst:e}),u)}}),Oh=B("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value,n=t.left._zod.run({value:u,issues:[]},i),a=t.right._zod.run({value:u,issues:[]},i);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([l,d])=>uo(r,l,d)):uo(r,n,a)}});function zi(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(pt(e)&&pt(t)){let r=Object.keys(t),i=Object.keys(e).filter(n=>r.indexOf(n)!==-1),u={...e,...t};for(let n of i){let a=zi(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};u[n]=a.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let u=e[i],n=t[i],a=zi(u,n);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(zi,"zu"),o(zi,"mergeValues");function uo(e,t,r){let i=new Map,u;for(let l of t.issues)if(l.code==="unrecognized_keys"){u??(u=l);for(let d of l.keys)i.has(d)||i.set(d,{}),i.get(d).l=!0}else e.issues.push(l);for(let l of r.issues)if(l.code==="unrecognized_keys")for(let d of l.keys)i.has(d)||i.set(d,{}),i.get(d).r=!0;else e.issues.push(l);let n=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(n.length&&u&&e.issues.push({...u,keys:n}),mt(e))return e;let a=zi(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}s(uo,"bw"),o(uo,"handleIntersectionResults");var ro=B("$ZodTuple",(e,t)=>{X.init(e,t);let r=t.items;e._zod.parse=(i,u)=>{let n=i.value;if(!Array.isArray(n))return i.issues.push({input:n,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],l=io(r,"optin"),d=io(r,"optout");if(!t.rest){if(n.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:n,inst:e,origin:"array"}),i;n.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:n,inst:e,origin:"array"})}let c=new Array(r.length);for(let p=0;p<r.length;p++){let m=r[p]._zod.run({value:n[p],issues:[]},u);m instanceof Promise?a.push(m.then(f=>{c[p]=f})):c[p]=m}if(t.rest){let p=r.length-1,m=n.slice(r.length);for(let f of m){p++;let h=t.rest._zod.run({value:f,issues:[]},u);h instanceof Promise?a.push(h.then(g=>no(g,i,p))):no(h,i,p)}}return a.length?Promise.all(a).then(()=>so(c,i,r,n,d)):so(c,i,r,n,d)}});function io(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}s(io,"ww"),o(io,"getTupleOptStart");function no(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(no,"xw"),o(no,"handleTupleResult");function so(e,t,r,i,u){for(let n=0;n<r.length;n++){let a=e[n],l=n<i.length;if(a.issues.length){if(!l&&n>=u){t.value.length=n;break}t.issues.push(...Fe(n,a.issues))}t.value[n]=a.value}for(let n=t.value.length-1;n>=i.length&&r[n]._zod.optout==="optional"&&t.value[n]===void 0;n--)t.value.length=n;return t}s(so,"$w"),o(so,"handleTupleResults");var Rh=B("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!pt(u))return r.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),r;let n=[],a=t.keyType._zod.values;if(a){r.value={};let l=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);let p=t.keyType._zod.run({value:c,issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>Ae(h,i,be())),input:c,path:[c],inst:e});continue}let m=p.value,f=t.valueType._zod.run({value:u[c],issues:[]},i);f instanceof Promise?n.push(f.then(h=>{h.issues.length&&r.issues.push(...Fe(c,h.issues)),r.value[m]=h.value})):(f.issues.length&&r.issues.push(...Fe(c,f.issues)),r.value[m]=f.value)}let d;for(let c in u)l.has(c)||(d=d??[],d.push(c));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:d})}else{r.value={};for(let l of Reflect.ownKeys(u)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(u,l))continue;let d=t.keyType._zod.run({value:l,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&qa.test(l)&&d.issues.length){let p=t.keyType._zod.run({value:Number(l),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?r.value[l]=u[l]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Ae(p,i,be())),input:l,path:[l],inst:e});continue}let c=t.valueType._zod.run({value:u[l],issues:[]},i);c instanceof Promise?n.push(c.then(p=>{p.issues.length&&r.issues.push(...Fe(l,p.issues)),r.value[d.value]=p.value})):(c.issues.length&&r.issues.push(...Fe(l,c.issues)),r.value[d.value]=c.value)}}return n.length?Promise.all(n).then(()=>r):r}}),Th=B("$ZodMap",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!(u instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:u,inst:e}),r;let n=[];r.value=new Map;for(let[a,l]of u){let d=t.keyType._zod.run({value:a,issues:[]},i),c=t.valueType._zod.run({value:l,issues:[]},i);d instanceof Promise||c instanceof Promise?n.push(Promise.all([d,c]).then(([p,m])=>{ao(p,m,r,a,u,e,i)})):ao(d,c,r,a,u,e,i)}return n.length?Promise.all(n).then(()=>r):r}});function ao(e,t,r,i,u,n,a){e.issues.length&&(Ii.has(typeof i)?r.issues.push(...Fe(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:u,inst:n,issues:e.issues.map(l=>Ae(l,a,be()))})),t.issues.length&&(Ii.has(typeof i)?r.issues.push(...Fe(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:u,inst:n,key:i,issues:t.issues.map(l=>Ae(l,a,be()))})),r.value.set(e.value,t.value)}s(ao,"_w"),o(ao,"handleMapResult");var Ph=B("$ZodSet",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!(u instanceof Set))return r.issues.push({input:u,inst:e,expected:"set",code:"invalid_type"}),r;let n=[];r.value=new Set;for(let a of u){let l=t.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise?n.push(l.then(d=>oo(d,r))):oo(l,r)}return n.length?Promise.all(n).then(()=>r):r}});function oo(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}s(oo,"kw"),o(oo,"handleSetResult");var Uh=B("$ZodEnum",(e,t)=>{X.init(e,t);let r=ki(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(u=>Ii.has(typeof u)).map(u=>typeof u=="string"?Ge(u):u.toString()).join("|")})$`),e._zod.parse=(u,n)=>{let a=u.value;return i.has(a)||u.issues.push({code:"invalid_value",values:r,input:a,inst:e}),u}}),qh=B("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Ge(i):i?Ge(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,u)=>{let n=i.value;return r.has(n)||i.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),i}}),Zh=B("$ZodFile",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return u instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:u,inst:e}),r}}),Lh=B("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ci(e.constructor.name);let u=t.transform(r.value,r);if(i.async)return(u instanceof Promise?u:Promise.resolve(u)).then(n=>(r.value=n,r.fallback=!0,r));if(u instanceof Promise)throw new Ft;return r.value=u,r.fallback=!0,r}});function lo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}s(lo,"Sw"),o(lo,"handleOptionalResult");var co=B("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ju(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let u=r.value,n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(a=>lo(a,u)):lo(n,u)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),Vh=B("$ZodExactOptional",(e,t)=>{co.init(e,t),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Jh=B("$ZodNullable",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ju(r.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Wh=B("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>po(n,t)):po(u,t)}});function po(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}s(po,"Iw"),o(po,"handleDefaultResult");var Gh=B("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),Kh=B("$ZodNonOptional",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>mo(n,e)):mo(u,e)}});function mo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}s(mo,"Rw"),o(mo,"handleNonOptionalResult");var Hh=B("$ZodSuccess",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ci("ZodSuccess");let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>(r.value=n.issues.length===0,r)):(r.value=u.issues.length===0,r)}}),Xh=B("$ZodCatch",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(a=>Ae(a,i,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(n=>Ae(n,i,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Yh=B("$ZodNaN",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),fo=B("$ZodPipe",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let n=t.out._zod.run(r,i);return n instanceof Promise?n.then(a=>rr(a,t.in,i)):rr(n,t.in,i)}let u=t.in._zod.run(r,i);return u instanceof Promise?u.then(n=>rr(n,t.out,i)):rr(u,t.out,i)}});function rr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}s(rr,"_i"),o(rr,"handlePipeResult");var ho=B("$ZodCodec",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let u=t.in._zod.run(r,i);return u instanceof Promise?u.then(n=>ir(n,t,i)):ir(u,t,i)}else{let u=t.out._zod.run(r,i);return u instanceof Promise?u.then(n=>ir(n,t,i)):ir(u,t,i)}}});function ir(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(u=>nr(e,u,t.out,r)):nr(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(u=>nr(e,u,t.in,r)):nr(e,i,t.in,r)}}s(ir,"ki"),o(ir,"handleCodecAResult");function nr(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}s(nr,"Si"),o(nr,"handleCodecTxResult");var Qh=B("$ZodPreprocess",(e,t)=>{fo.init(e,t)}),eg=B("$ZodReadonly",(e,t)=>{X.init(e,t),ee(e._zod,"propValues",()=>t.innerType._zod.propValues),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"optin",()=>t.innerType?._zod?.optin),ee(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(go):go(u)}});function go(e){return e.value=Object.freeze(e.value),e}s(go,"Ew"),o(go,"handleReadonlyResult");var tg=B("$ZodTemplateLiteral",(e,t)=>{X.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let u=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!u)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let n=u.startsWith("^")?1:0,a=u.endsWith("$")?u.length-1:u.length;r.push(u.slice(n,a))}else if(i===null||M4.has(typeof i))r.push(Ge(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,u)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",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:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),ug=B("$ZodFunction",(e,t)=>(X.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let u=e._def.input?ka(e._def.input,i):i,n=Reflect.apply(r,this,u);return e._def.output?ka(e._def.output,n):n}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let u=e._def.input?await Aa(e._def.input,i):i,n=await Reflect.apply(r,this,u);return e._def.output?await Aa(e._def.output,n):n}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new ro({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),rg=B("$ZodPromise",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(u=>t.innerType._zod.run({value:u,issues:[]},i))}),ig=B("$ZodLazy",(e,t)=>{X.init(e,t),ee(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ee(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ee(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ee(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ee(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),ng=B("$ZodCustom",(e,t)=>{de.init(e,t),X.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,u=t.fn(i);if(u instanceof Promise)return u.then(n=>vo(n,r,i,e));vo(u,r,i,e)}});function vo(e,t,r,i){if(!e){let u={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(u.params=i._zod.def.params),t.issues.push(Ku(u))}}s(vo,"Tw"),o(vo,"handleRefineResult");var yo={};ut(yo,{ar:s(()=>sg,"ar"),az:s(()=>ag,"az"),be:s(()=>og,"be"),bg:s(()=>lg,"bg"),ca:s(()=>dg,"ca"),cs:s(()=>cg,"cs"),da:s(()=>pg,"da"),de:s(()=>mg,"de"),el:s(()=>fg,"el"),en:s(()=>bo,"en"),eo:s(()=>hg,"eo"),es:s(()=>gg,"es"),fa:s(()=>vg,"fa"),fi:s(()=>yg,"fi"),fr:s(()=>Eg,"fr"),frCA:s(()=>bg,"frCA"),he:s(()=>wg,"he"),hr:s(()=>Dg,"hr"),hu:s(()=>$g,"hu"),hy:s(()=>Bg,"hy"),id:s(()=>xg,"id"),is:s(()=>Cg,"is"),it:s(()=>kg,"it"),ja:s(()=>Ag,"ja"),ka:s(()=>Ig,"ka"),kh:s(()=>_g,"kh"),km:s(()=>Do,"km"),ko:s(()=>Sg,"ko"),lt:s(()=>Fg,"lt"),mk:s(()=>jg,"mk"),ms:s(()=>zg,"ms"),nl:s(()=>Ng,"nl"),no:s(()=>Mg,"no"),ota:s(()=>Og,"ota"),pl:s(()=>Tg,"pl"),ps:s(()=>Rg,"ps"),pt:s(()=>Pg,"pt"),ro:s(()=>Ug,"ro"),ru:s(()=>qg,"ru"),sl:s(()=>Zg,"sl"),sv:s(()=>Lg,"sv"),ta:s(()=>Vg,"ta"),th:s(()=>Jg,"th"),tr:s(()=>Wg,"tr"),ua:s(()=>Gg,"ua"),uk:s(()=>xo,"uk"),ur:s(()=>Kg,"ur"),uz:s(()=>Hg,"uz"),vi:s(()=>Xg,"vi"),yo:s(()=>ev,"yo"),zhCN:s(()=>Yg,"zhCN"),zhTW:s(()=>Qg,"zhTW")});var dw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`:`\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}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`}case"invalid_value":return u.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 ${J(u.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: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${u.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 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${u.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${u.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${u.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${u.keys.length>1?"\u0629":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${u.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 ${u.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function sg(){return{localeError:dw()}}s(sg,"Bl"),o(sg,"default");var cw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${u.expected}, daxil olan ${l}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n}, daxil olan ${l}`}case"invalid_value":return u.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${J(u.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${n}${u.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${n.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:n.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${n.suffix}" il\u0259 bitm\u0259lidir`:n.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${n.includes}" daxil olmal\u0131d\u0131r`:n.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${n.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[n.format]??u.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${u.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${u.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function ag(){return{localeError:cw()}}s(ag,"Zl"),o(ag,"default");function Eo(e,t,r,i){let u=Math.abs(e),n=u%10,a=u%100;return a>=11&&a<=19?i:n===1?t:n>=2&&n<=4?r:i}s(Eo,"Nw"),o(Eo,"getBelarusianPlural");var pw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${u.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Eo(l,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 ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${n}${u.maximum.toString()} ${d}`}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 ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Eo(l,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 ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${n}${u.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${u.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${u.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 ${u.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function og(){return{localeError:pw()}}s(og,"ql"),o(og,"default");var mw=o(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",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:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${n}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${J(u.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${u.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;if(n.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${n.prefix}"`;if(n.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${n.suffix}"`;if(n.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${n.includes}"`;if(n.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${n.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[n.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${u.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u043E\u0432\u0435":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${u.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function lg(){return{localeError:mw()}}s(lg,"Vl"),o(lg,"default");var fw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${u.expected}, s'ha rebut ${l}`:`Tipus inv\xE0lid: s'esperava ${n}, s'ha rebut ${l}`}case"invalid_value":return u.values.length===1?`Valor inv\xE0lid: s'esperava ${J(u.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${O(u.values," o ")}`;case"too_big":{let n=u.inclusive?"com a m\xE0xim":"menys de",a=t(u.origin);return a?`Massa gran: s'esperava que ${u.origin??"el valor"} contingu\xE9s ${n} ${u.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${u.origin??"el valor"} fos ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(u.origin);return a?`Massa petit: s'esperava que ${u.origin} contingu\xE9s ${n} ${u.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${u.origin} fos ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${n.prefix}"`:n.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${n.suffix}"`:n.format==="includes"?`Format inv\xE0lid: ha d'incloure "${n.includes}"`:n.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${n.pattern}`:`Format inv\xE0lid per a ${r[n.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${u.divisor}`;case"unrecognized_keys":return`Clau${u.keys.length>1?"s":""} no reconeguda${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${u.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${u.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function dg(){return{localeError:fw()}}s(dg,"Gl"),o(dg,"default");var hw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${u.expected}, obdr\u017Eeno ${l}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n}, obdr\u017Eeno ${l}`}case"invalid_value":return u.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${J(u.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${n}${u.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${n}${u.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${n.prefix}"`:n.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${n.suffix}"`:n.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${n.includes}"`:n.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${n.pattern}`:`Neplatn\xFD form\xE1t ${r[n.format]??u.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${u.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${O(u.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${u.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${u.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function cg(){return{localeError:hw()}}s(cg,"Jl"),o(cg,"default");var gw=o(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldigt input: forventede instanceof ${u.expected}, fik ${l}`:`Ugyldigt input: forventede ${n}, fik ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig v\xE6rdi: forventede ${J(u.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`For stor: forventede ${l??"value"} ${a.verb} ${n} ${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`For lille: forventede ${l} ${a.verb} ${n} ${u.minimum.toString()} ${a.unit}`:`For lille: forventede ${l} havde ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ugyldig streng: skal starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: skal ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: skal indeholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${r[n.format]??u.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${u.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${u.origin}`;default:return"Ugyldigt input"}}},"error");function pg(){return{localeError:gw()}}s(pg,"Wl"),o(pg,"default");var vw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"Zahl",array:"Array"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${u.expected}, erhalten ${l}`:`Ung\xFCltige Eingabe: erwartet ${n}, erhalten ${l}`}case"invalid_value":return u.values.length===1?`Ung\xFCltige Eingabe: erwartet ${J(u.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${n}${u.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${n}${u.maximum.toString()} ist`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Zu klein: erwartet, dass ${u.origin} ${n}${u.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${u.origin} ${n}${u.minimum.toString()} ist`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ung\xFCltiger String: muss mit "${n.prefix}" beginnen`:n.format==="ends_with"?`Ung\xFCltiger String: muss mit "${n.suffix}" enden`:n.format==="includes"?`Ung\xFCltiger String: muss "${n.includes}" enthalten`:n.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${n.pattern} entsprechen`:`Ung\xFCltig: ${r[n.format]??u.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${u.divisor} sein`;case"unrecognized_keys":return`${u.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${u.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${u.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function mg(){return{localeError:vw()}}s(mg,"Kl"),o(mg,"default");var yw=o(()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return typeof u.expected=="string"&&/^[A-Z]/.test(u.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${u.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`}case"invalid_value":return u.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${J(u.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${n}${u.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${n}${u.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${n.prefix}"`:n.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${n.suffix}"`:n.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${n.includes}"`:n.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${n.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[n.format]??u.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${u.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${u.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${u.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${u.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${u.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function fg(){return{localeError:yw()}}s(fg,"Xl"),o(fg,"default");var Ew=o(()=>{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"},map:{unit:"entries",verb:"to have"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return`Invalid input: expected ${n}, received ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${J(u.values[0])}`:`Invalid option: expected one of ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Too big: expected ${u.origin??"value"} to have ${n}${u.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${u.origin??"value"} to be ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Too small: expected ${u.origin} to have ${n}${u.minimum.toString()} ${a.unit}`:`Too small: expected ${u.origin} to be ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;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 ${r[n.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`Invalid discriminator value. Expected ${u.options.map(n=>`'${n}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}},"error");function bo(){return{localeError:Ew()}}s(bo,"Ln"),o(bo,"default");var bw=o(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${u.expected}, ricevi\u011Dis ${l}`:`Nevalida enigo: atendi\u011Dis ${n}, ricevi\u011Dis ${l}`}case"invalid_value":return u.values.length===1?`Nevalida enigo: atendi\u011Dis ${J(u.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${n}${u.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Tro malgranda: atendi\u011Dis ke ${u.origin} havu ${n}${u.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${u.origin} estu ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;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 ${r[n.format]??u.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${u.divisor}`;case"unrecognized_keys":return`Nekonata${u.keys.length>1?"j":""} \u015Dlosilo${u.keys.length>1?"j":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${u.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${u.origin}`;default:return"Nevalida enigo"}}},"error");function hg(){return{localeError:bw()}}s(hg,"Hl"),o(hg,"default");var ww=o(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${u.expected}, recibido ${l}`:`Entrada inv\xE1lida: se esperaba ${n}, recibido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: se esperaba ${J(u.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${n}${u.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${n}${u.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${n.prefix}"`:n.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${n.suffix}"`:n.format==="includes"?`Cadena inv\xE1lida: debe incluir "${n.includes}"`:n.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${n.pattern}`:`Inv\xE1lido ${r[n.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Llave${u.keys.length>1?"s":""} desconocida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[u.origin]??u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[u.origin]??u.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function gg(){return{localeError:ww()}}s(gg,"Yl"),o(gg,"default");var Dw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${u.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return u.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${J(u.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 ${O(u.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:n.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:n.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${n.includes}" \u0628\u0627\u0634\u062F`:n.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${n.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[n.format]??u.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 ${u.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${u.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${O(u.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${u.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 ${u.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function vg(){return{localeError:Dw()}}s(vg,"Ql"),o(vg,"default");var $w=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Virheellinen tyyppi: odotettiin instanceof ${u.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${n}, oli ${l}`}case"invalid_value":return u.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${J(u.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${n}${u.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${n}${u.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${n.prefix}"`:n.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${n.suffix}"`:n.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${n.includes}"`:n.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${n.pattern}`:`Virheellinen ${r[n.format]??u.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${u.divisor} monikerta`;case"unrecognized_keys":return`${u.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(u.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"}}},"error");function yg(){return{localeError:$w()}}s(yg,"ed"),o(yg,"default");var Bw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : instanceof ${u.expected} attendu, ${l} re\xE7u`:`Entr\xE9e invalide : ${n} attendu, ${l} re\xE7u`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : ${J(u.values[0])} attendu`:`Option invalide : une valeur parmi ${O(u.values,"|")} attendue`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Trop grand : ${i[u.origin]??"valeur"} doit ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[u.origin]??"valeur"} doit \xEAtre ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Trop petit : ${i[u.origin]??"valeur"} doit ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Trop petit : ${i[u.origin]??"valeur"} doit \xEAtre ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${n.pattern}`:`${r[n.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Eg(){return{localeError:Bw()}}s(Eg,"td"),o(Eg,"default");var xw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : attendu instanceof ${u.expected}, re\xE7u ${l}`:`Entr\xE9e invalide : attendu ${n}, re\xE7u ${l}`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : attendu ${J(u.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"\u2264":"<",a=t(u.origin);return a?`Trop grand : attendu que ${u.origin??"la valeur"} ait ${n}${u.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${u.origin??"la valeur"} soit ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"\u2265":">",a=t(u.origin);return a?`Trop petit : attendu que ${u.origin} ait ${n}${u.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${u.origin} soit ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${n.pattern}`:`${r[n.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function bg(){return{localeError:xw()}}s(bg,"rd"),o(bg,"default");var Cw=o(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=o(c=>c?e[c]:void 0,"typeEntry"),i=o(c=>{let p=r(c);return p?p.label:c??e.unknown.label},"typeLabel"),u=o(c=>`\u05D4${i(c)}`,"withDefinite"),n=o(c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),a=o(c=>c?t[c]??null:null,"getSizing"),l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,m=d[p??""]??i(p),f=G(c.input),h=d[f]??e[f]?.label??f;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${J(c.values[0])}`;let p=c.values.map(f=>J(f));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let m=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case"too_big":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",b=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let f=c.inclusive?"<=":"<",h=n(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin,"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let b=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let f=c.inclusive?">=":">",h=n(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let m=l[p.format],f=m?.label??p.format,h=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${h}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${O(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";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${u(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function wg(){return{localeError:Cw()}}s(wg,"nd"),o(wg,"default");var kw=o(()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${u.expected}, a primljeno je ${l}`:`Neispravan unos: o\u010Dekuje se ${n}, a primljeno je ${l}`}case"invalid_value":return u.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${J(u.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Preveliko: o\u010Dekivano da ${l??"vrijednost"} ima ${n}${u.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${l??"vrijednost"} bude ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Premalo: o\u010Dekivano da ${l} ima ${n}${u.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${l} bude ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${n.prefix}"`:n.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${n.suffix}"`:n.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${n.includes}"`:n.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${n.pattern}`:`Neispravna ${r[n.format]??u.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${u.divisor}`;case"unrecognized_keys":return`Neprepoznat${u.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[u.origin]??u.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[u.origin]??u.origin}`;default:return"Neispravan unos"}}},"error");function Dg(){return{localeError:kw()}}s(Dg,"od"),o(Dg,"default");var Aw=o(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${u.expected}, a kapott \xE9rt\xE9k ${l}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n}, a kapott \xE9rt\xE9k ${l}`}case"invalid_value":return u.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${J(u.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xFAl nagy: ${u.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${n}${u.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${u.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} m\xE9rete t\xFAl kicsi ${n}${u.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} t\xFAl kicsi ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\xC9rv\xE9nytelen string: "${n.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:n.format==="ends_with"?`\xC9rv\xE9nytelen string: "${n.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:n.format==="includes"?`\xC9rv\xE9nytelen string: "${n.includes}" \xE9rt\xE9ket kell tartalmaznia`:n.format==="regex"?`\xC9rv\xE9nytelen string: ${n.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[n.format]??u.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${u.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${u.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${u.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function $g(){return{localeError:Aw()}}s($g,"id"),o($g,"default");function wo(e,t,r){return Math.abs(e)===1?t:r}s(wo,"Pw"),o(wo,"getArmenianPlural");function zt(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}s(zt,"Er"),o(zt,"withDefiniteArticle");var Iw=o(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${u.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${n}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`}case"invalid_value":return u.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${J(u.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=wo(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${n}${u.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=wo(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${n}${u.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin)} \u056C\u056B\u0576\u056B ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${n.prefix}"-\u0578\u057E`:n.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${n.suffix}"-\u0578\u057E`:n.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${n.includes}"`:n.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${n.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[n.format]??u.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${u.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${u.keys.length>1?"\u0576\u0565\u0580":""}. ${O(u.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${zt(u.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${zt(u.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function Bg(){return{localeError:Iw()}}s(Bg,"sd"),o(Bg,"default");var _w=o(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak valid: diharapkan instanceof ${u.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${n}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak valid: diharapkan ${J(u.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: diharapkan ${u.origin??"value"} memiliki ${n}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${u.origin??"value"} menjadi ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: diharapkan ${u.origin} memiliki ${n}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${u.origin} menjadi ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`String tidak valid: harus dimulai dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak valid: harus berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak valid: harus menyertakan "${n.includes}"`:n.format==="regex"?`String tidak valid: harus sesuai pola ${n.pattern}`:`${r[n.format]??u.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${u.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${u.origin}`;default:return"Input tidak valid"}}},"error");function xg(){return{localeError:_w()}}s(xg,"ad"),o(xg,"default");var Sw=o(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera instanceof ${u.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera ${n}`}case"invalid_value":return u.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${J(u.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} hafi ${n}${u.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} s\xE9 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} hafi ${n}${u.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} s\xE9 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${r[n.format]??u.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${u.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${u.keys.length>1?"ir lyklar":"ur lykill"}: ${O(u.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${u.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${u.origin}`;default:return"Rangt gildi"}}},"error");function Cg(){return{localeError:Sw()}}s(Cg,"cd"),o(Cg,"default");var Fw=o(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"numero",array:"vettore"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input non valido: atteso instanceof ${u.expected}, ricevuto ${l}`:`Input non valido: atteso ${n}, ricevuto ${l}`}case"invalid_value":return u.values.length===1?`Input non valido: atteso ${J(u.values[0])}`:`Opzione non valida: atteso uno tra ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Troppo grande: ${u.origin??"valore"} deve avere ${n}${u.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${u.origin??"valore"} deve essere ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Troppo piccolo: ${u.origin} deve avere ${n}${u.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${u.origin} deve essere ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Stringa non valida: deve iniziare con "${n.prefix}"`:n.format==="ends_with"?`Stringa non valida: deve terminare con "${n.suffix}"`:n.format==="includes"?`Stringa non valida: deve includere "${n.includes}"`:n.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${n.pattern}`:`Input non valido: ${r[n.format]??u.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${u.divisor}`;case"unrecognized_keys":return`Chiav${u.keys.length>1?"i":"e"} non riconosciut${u.keys.length>1?"e":"a"}: ${O(u.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${u.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${u.origin}`;default:return"Input non valido"}}},"error");function kg(){return{localeError:Fw()}}s(kg,"ud"),o(kg,"default");var jw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${u.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${n}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return u.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${J(u.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${O(u.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let n=u.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(u.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${a.unit??"\u8981\u7D20"}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let n=u.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(u.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${a.unit}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${n.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[n.format]??u.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${u.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${u.keys.length>1?"\u7FA4":""}: ${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function Ag(){return{localeError:jw()}}s(Ag,"ld"),o(Ag,"default");var zw=o(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${u.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`}case"invalid_value":return u.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${J(u.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${O(u.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} \u10D8\u10E7\u10DD\u10E1 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${u.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${u.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${u.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${u.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function Ig(){return{localeError:zw()}}s(Ig,"dd"),o(Ig,"default");var Nw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`:`\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} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${u.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${n} ${u.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${O(u.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 ${u.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 ${u.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Do(){return{localeError:Nw()}}s(Do,"Fn"),o(Do,"default");function _g(){return Do()}s(_g,"pd"),o(_g,"default");var Mw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${u.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`}case"invalid_value":return u.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${J(u.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${O(u.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let n=u.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=n==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()}${d} ${n}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()} ${n}${a}`}case"too_small":{let n=u.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=n==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()}${d} ${n}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()} ${n}${a}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:n.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${n.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[n.format]??u.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${u.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${O(u.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${u.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${u.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function Sg(){return{localeError:Mw()}}s(Sg,"fd"),o(Sg,"default");var sr=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function $o(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}s($o,"Dw"),o($o,"getUnitTypeFromNumber");var Ow=o(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(u,n,a,l){let d=e[u]??null;return d===null?d:{unit:d.unit[n],verb:d.verb[l][a?"inclusive":"notInclusive"]}}s(t,"t"),o(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Gautas tipas ${l}, o tik\u0117tasi - instanceof ${u.expected}`:`Gautas tipas ${l}, o tik\u0117tasi - ${n}`}case"invalid_value":return u.values.length===1?`Privalo b\u016Bti ${J(u.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${O(u.values,"|")} pasirinkim\u0173`;case"too_big":{let n=i[u.origin]??u.origin,a=t(u.origin,$o(Number(u.maximum)),u.inclusive??!1,"smaller");if(a?.verb)return`${sr(n??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.maximum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${sr(n??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.maximum.toString()} ${a?.unit}`}case"too_small":{let n=i[u.origin]??u.origin,a=t(u.origin,$o(Number(u.minimum)),u.inclusive??!1,"bigger");if(a?.verb)return`${sr(n??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.minimum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${sr(n??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.minimum.toString()} ${a?.unit}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${r[n.format]??u.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${u.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${u.keys.length>1?"i":"as"} rakt${u.keys.length>1?"ai":"as"}: ${O(u.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=i[u.origin]??u.origin;return`${sr(n??u.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function Fg(){return{localeError:Ow()}}s(Fg,"md"),o(Fg,"default");var Rw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${u.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${n}${u.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 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0438\u043C\u0430 ${n}${u.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`Invalid ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`${u.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"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${u.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 ${u.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function jg(){return{localeError:Rw()}}s(jg,"hd"),o(jg,"default");var Tw=o(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"nombor"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak sah: dijangka instanceof ${u.expected}, diterima ${l}`:`Input tidak sah: dijangka ${n}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak sah: dijangka ${J(u.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: dijangka ${u.origin??"nilai"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${u.origin??"nilai"} adalah ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: dijangka ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${u.origin} adalah ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`String tidak sah: mesti bermula dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak sah: mesti mengandungi "${n.includes}"`:n.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${n.pattern}`:`${r[n.format]??u.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${u.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${u.origin}`;default:return"Input tidak sah"}}},"error");function zg(){return{localeError:Tw()}}s(zg,"gd"),o(zg,"default");var Pw=o(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"getal"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ongeldige invoer: verwacht instanceof ${u.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${n}, ontving ${l}`}case"invalid_value":return u.values.length===1?`Ongeldige invoer: verwacht ${J(u.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=u.origin==="date"?"laat":u.origin==="string"?"lang":"groot";return a?`Te ${l}: verwacht dat ${u.origin??"waarde"} ${n}${u.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin??"waarde"} ${n}${u.maximum.toString()} is`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=u.origin==="date"?"vroeg":u.origin==="string"?"kort":"klein";return a?`Te ${l}: verwacht dat ${u.origin} ${n}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin} ${n}${u.minimum.toString()} is`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ongeldige tekst: moet met "${n.prefix}" beginnen`:n.format==="ends_with"?`Ongeldige tekst: moet op "${n.suffix}" eindigen`:n.format==="includes"?`Ongeldige tekst: moet "${n.includes}" bevatten`:n.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`:`Ongeldig: ${r[n.format]??u.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${u.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${u.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${u.origin}`;default:return"Ongeldige invoer"}}},"error");function Ng(){return{localeError:Pw()}}s(Ng,"vd"),o(Ng,"default");var Uw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"tall",array:"liste"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldig input: forventet instanceof ${u.expected}, fikk ${l}`:`Ugyldig input: forventet ${n}, fikk ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig verdi: forventet ${J(u.values[0])}`:`Ugyldig valg: forventet en av ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${n}${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`For lite(n): forventet ${u.origin} til \xE5 ha ${n}${u.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${u.origin} til \xE5 ha ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${r[n.format]??u.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${u.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${u.origin}`;default:return"Ugyldig input"}}},"error");function Mg(){return{localeError:Uw()}}s(Mg,"yd"),o(Mg,"default");var qw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`F\xE2sit giren: umulan instanceof ${u.expected}, al\u0131nan ${l}`:`F\xE2sit giren: umulan ${n}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`F\xE2sit giren: umulan ${J(u.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${n}${u.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${n}${u.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${n}${u.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${n}${u.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let n=u;return n.format==="starts_with"?`F\xE2sit metin: "${n.prefix}" ile ba\u015Flamal\u0131.`:n.format==="ends_with"?`F\xE2sit metin: "${n.suffix}" ile bitmeli.`:n.format==="includes"?`F\xE2sit metin: "${n.includes}" ihtiv\xE2 etmeli.`:n.format==="regex"?`F\xE2sit metin: ${n.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[n.format]??u.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${u.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${u.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function Og(){return{localeError:qw()}}s(Og,"bd"),o(Og,"default");var Zw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${u.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return u.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${J(u.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${O(u.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} \u0648\u064A`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} \u0648\u064A`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:n.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:n.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${n.includes}" \u0648\u0644\u0631\u064A`:n.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${n.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[n.format]??u.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${u.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${u.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${u.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 ${u.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function Rg(){return{localeError:Zw()}}s(Rg,"wd"),o(Rg,"default");var Lw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"liczba",array:"tablica"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${u.expected}, otrzymano ${l}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n}, otrzymano ${l}`}case"invalid_value":return u.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${J(u.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${u.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${u.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${n.prefix}"`:n.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${n.suffix}"`:n.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${n.includes}"`:n.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${n.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[n.format]??u.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${u.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${u.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${u.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function Tg(){return{localeError:Lw()}}s(Tg,"xd"),o(Tg,"default");var Vw=o(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Tipo inv\xE1lido: esperado instanceof ${u.expected}, recebido ${l}`:`Tipo inv\xE1lido: esperado ${n}, recebido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: esperado ${J(u.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Muito grande: esperado que ${u.origin??"valor"} tivesse ${n}${u.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${u.origin??"valor"} fosse ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Muito pequeno: esperado que ${u.origin} tivesse ${n}${u.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${u.origin} fosse ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${n.prefix}"`:n.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${n.suffix}"`:n.format==="includes"?`Texto inv\xE1lido: deve incluir "${n.includes}"`:n.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${n.pattern}`:`${r[n.format]??u.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Chave${u.keys.length>1?"s":""} desconhecida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${u.origin}`;default:return"Campo inv\xE1lido"}}},"error");function Pg(){return{localeError:Vw()}}s(Pg,"$d"),o(Pg,"default");var Jw=o(()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${n}, primit ${l}`}case"invalid_value":return u.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${J(u.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} s\u0103 fie ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Prea mic: a\u0219teptat ca ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${u.origin} s\u0103 fie ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${n.prefix}"`:n.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${n.suffix}"`:n.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${n.includes}"`:n.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${n.pattern}`:`Format invalid: ${r[n.format]??u.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${u.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${O(u.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${u.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${u.origin}`;default:return"Intrare invalid\u0103"}}},"error");function Ug(){return{localeError:Jw()}}s(Ug,"_d"),o(Ug,"default");function Bo(e,t,r,i){let u=Math.abs(e),n=u%10,a=u%100;return a>=11&&a<=19?i:n===1?t:n>=2&&n<=4?r:i}s(Bo,"Cw"),o(Bo,"getRussianPlural");var Ww=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Bo(l,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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${u.maximum.toString()} ${d}`}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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Bo(l,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 ${u.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${u.minimum.toString()} ${d}`}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 ${u.origin} \u0431\u0443\u0434\u0435\u0442 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${u.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0438":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${u.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 ${u.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function qg(){return{localeError:Ww()}}s(qg,"kd"),o(qg,"default");var Gw=o(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${u.expected}, prejeto ${l}`:`Neveljaven vnos: pri\u010Dakovano ${n}, prejeto ${l}`}case"invalid_value":return u.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${J(u.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} imelo ${n}${u.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${u.origin} imelo ${n}${u.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${n.prefix}"`:n.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${n.suffix}"`:n.format==="includes"?`Neveljaven niz: mora vsebovati "${n.includes}"`:n.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`:`Neveljaven ${r[n.format]??u.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${u.divisor}`;case"unrecognized_keys":return`Neprepoznan${u.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${u.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${u.origin}`;default:return"Neveljaven vnos"}}},"error");function Zg(){return{localeError:Gw()}}s(Zg,"Sd"),o(Zg,"default");var Kw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"antal",array:"lista"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${u.expected}, fick ${l}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${n}, fick ${l}`}case"invalid_value":return u.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${J(u.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${u.origin??"v\xE4rdet"} att ha ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${n.prefix}"`:n.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${n.suffix}"`:n.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${n.includes}"`:n.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${n.pattern}"`:`Ogiltig(t) ${r[n.format]??u.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${u.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${u.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function Lg(){return{localeError:Kw()}}s(Lg,"Id"),o(Lg,"default");var Hw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`:`\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}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${u.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 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${u.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.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 ${u.origin} ${n}${u.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 ${u.origin} ${n}${u.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${n.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[n.format]??u.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${u.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${u.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.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`${u.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"}}},"error");function Vg(){return{localeError:Hw()}}s(Vg,"Rd"),o(Vg,"default");var Xw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`:`\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} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`}case"invalid_value":return u.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:n.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 ${n.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[n.format]??u.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 ${u.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: ${O(u.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${u.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 ${u.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function Jg(){return{localeError:Xw()}}s(Jg,"Ed"),o(Jg,"default");var Yw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${u.expected}, al\u0131nan ${l}`:`Ge\xE7ersiz de\u011Fer: beklenen ${n}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${J(u.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${n}${u.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;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 ${r[n.format]??u.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${u.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${u.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function Wg(){return{localeError:Yw()}}s(Wg,"Td"),o(Wg,"default");var Qw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`:`\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}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${n}${u.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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.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 ${u.origin} ${a.verb} ${n}${u.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 ${u.origin} \u0431\u0443\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0456":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${u.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 ${u.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function xo(){return{localeError:Qw()}}s(xo,"Zn"),o(xo,"default");function Gg(){return xo()}s(Gg,"Ad"),o(Gg,"default");var eD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${u.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return u.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${J(u.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${O(u.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${n}${u.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: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${n}${u.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u06D2 ${n}${u.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u0627 ${n}${u.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${n.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${u.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${u.keys.length>1?"\u0632":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function Kg(){return{localeError:eD()}}s(Kg,"jd"),o(Kg,"default");var tD=o(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${u.expected}, qabul qilingan ${l}`:`Noto\u2018g\u2018ri kirish: kutilgan ${n}, qabul qilingan ${l}`}case"invalid_value":return u.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${J(u.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Juda katta: kutilgan ${u.origin??"qiymat"} ${n}${u.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${u.origin??"qiymat"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Juda kichik: kutilgan ${u.origin} ${n}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${n.prefix}" bilan boshlanishi kerak`:n.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${n.suffix}" bilan tugashi kerak`:n.format==="includes"?`Noto\u2018g\u2018ri satr: "${n.includes}" ni o\u2018z ichiga olishi kerak`:n.format==="regex"?`Noto\u2018g\u2018ri satr: ${n.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[n.format]??u.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${u.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${u.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function Hg(){return{localeError:tD()}}s(Hg,"zd"),o(Hg,"default");var uD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${u.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`}case"invalid_value":return u.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${J(u.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${n.prefix}"`:n.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${n.suffix}"`:n.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${n.includes}"`:n.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${n.pattern}`:`${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${O(u.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${u.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 ${u.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function Xg(){return{localeError:uD()}}s(Xg,"Od"),o(Xg,"default");var rD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${u.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`}case"invalid_value":return u.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${J(u.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${n}${u.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.prefix}" \u5F00\u5934`:n.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.suffix}" \u7ED3\u5C3E`:n.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${n.pattern}`:`\u65E0\u6548${r[n.format]??u.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${u.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${u.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function Yg(){return{localeError:rD()}}s(Yg,"Md"),o(Yg,"default");var iD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${u.expected}\uFF0C\u4F46\u6536\u5230 ${l}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n}\uFF0C\u4F46\u6536\u5230 ${l}`}case"invalid_value":return u.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${J(u.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${n}${u.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${n}${u.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.prefix}" \u958B\u982D`:n.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.suffix}" \u7D50\u5C3E`:n.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${n.pattern}`:`\u7121\u6548\u7684 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${u.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${u.keys.length>1?"\u5011":""}\uFF1A${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function Qg(){return{localeError:iD()}}s(Qg,"Nd"),o(Qg,"default");var nD=o(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${u.expected}, \xE0m\u1ECD\u0300 a r\xED ${l}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n}, \xE0m\u1ECD\u0300 a r\xED ${l}`}case"invalid_value":return u.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${J(u.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin??"iye"} ${a.verb} ${n}${u.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${u.maximum}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin} ${a.verb} ${n}${u.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${u.minimum}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${n.prefix}"`:n.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${n.suffix}"`:n.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${n.includes}"`:n.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${n.pattern}`:`A\u1E63\xEC\u1E63e: ${r[n.format]??u.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${u.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${O(u.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function ev(){return{localeError:nD()}}s(ev,"Pd"),o(ev,"default");var tv,uv=Symbol("ZodOutput"),rv=Symbol("ZodInput"),iv=class{static{s(this,"zi")}static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ni(){return new iv}s(Ni,"Oi"),o(Ni,"registry"),(tv=globalThis).__zod_globalRegistry??(tv.__zod_globalRegistry=Ni());var Re=globalThis.__zod_globalRegistry;function Co(e,t){return new e({type:"string",...T(t)})}s(Co,"Ud"),o(Co,"_string");function ko(e,t){return new e({type:"string",coerce:!0,...T(t)})}s(ko,"Ld"),o(ko,"_coercedString");function Mi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}s(Mi,"Mi"),o(Mi,"_email");function ar(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}s(ar,"Vn"),o(ar,"_guid");function Oi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}s(Oi,"Ni"),o(Oi,"_uuid");function Ri(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}s(Ri,"Pi"),o(Ri,"_uuidv4");function Ti(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}s(Ti,"Di"),o(Ti,"_uuidv6");function Pi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}s(Pi,"Ci"),o(Pi,"_uuidv7");function or(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}s(or,"Gn"),o(or,"_url");function Ui(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}s(Ui,"Ui"),o(Ui,"_emoji");function qi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}s(qi,"Li"),o(qi,"_nanoid");function Zi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}s(Zi,"Fi"),o(Zi,"_cuid");function Li(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}s(Li,"Bi"),o(Li,"_cuid2");function Vi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}s(Vi,"Zi"),o(Vi,"_ulid");function Ji(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}s(Ji,"qi"),o(Ji,"_xid");function Wi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}s(Wi,"Vi"),o(Wi,"_ksuid");function Gi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}s(Gi,"Gi"),o(Gi,"_ipv4");function Ki(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}s(Ki,"Ji"),o(Ki,"_ipv6");function Ao(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}s(Ao,"Fd"),o(Ao,"_mac");function Hi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}s(Hi,"Wi"),o(Hi,"_cidrv4");function Xi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}s(Xi,"Ki"),o(Xi,"_cidrv6");function Yi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}s(Yi,"Xi"),o(Yi,"_base64");function Qi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}s(Qi,"Hi"),o(Qi,"_base64url");function en(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}s(en,"Yi"),o(en,"_e164");function tn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}s(tn,"Qi"),o(tn,"_jwt");var nv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Io(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}s(Io,"Zd"),o(Io,"_isoDateTime");function _o(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}s(_o,"qd"),o(_o,"_isoDate");function So(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}s(So,"Vd"),o(So,"_isoTime");function Fo(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}s(Fo,"Gd"),o(Fo,"_isoDuration");function jo(e,t){return new e({type:"number",checks:[],...T(t)})}s(jo,"Jd"),o(jo,"_number");function zo(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}s(zo,"Wd"),o(zo,"_coercedNumber");function No(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}s(No,"Kd"),o(No,"_int");function Mo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}s(Mo,"Xd"),o(Mo,"_float32");function Oo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}s(Oo,"Hd"),o(Oo,"_float64");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}s(Ro,"Yd"),o(Ro,"_int32");function To(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}s(To,"Qd"),o(To,"_uint32");function Po(e,t){return new e({type:"boolean",...T(t)})}s(Po,"ep"),o(Po,"_boolean");function Uo(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}s(Uo,"tp"),o(Uo,"_coercedBoolean");function qo(e,t){return new e({type:"bigint",...T(t)})}s(qo,"rp"),o(qo,"_bigint");function Zo(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}s(Zo,"np"),o(Zo,"_coercedBigint");function Lo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}s(Lo,"op"),o(Lo,"_int64");function Vo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}s(Vo,"ip"),o(Vo,"_uint64");function Jo(e,t){return new e({type:"symbol",...T(t)})}s(Jo,"sp"),o(Jo,"_symbol");function Wo(e,t){return new e({type:"undefined",...T(t)})}s(Wo,"ap"),o(Wo,"_undefined");function Go(e,t){return new e({type:"null",...T(t)})}s(Go,"cp"),o(Go,"_null");function Ko(e){return new e({type:"any"})}s(Ko,"up"),o(Ko,"_any");function Ho(e){return new e({type:"unknown"})}s(Ho,"lp"),o(Ho,"_unknown");function Xo(e,t){return new e({type:"never",...T(t)})}s(Xo,"dp"),o(Xo,"_never");function Yo(e,t){return new e({type:"void",...T(t)})}s(Yo,"pp"),o(Yo,"_void");function Qo(e,t){return new e({type:"date",...T(t)})}s(Qo,"fp"),o(Qo,"_date");function e0(e,t){return new e({type:"date",coerce:!0,...T(t)})}s(e0,"mp"),o(e0,"_coercedDate");function t0(e,t){return new e({type:"nan",...T(t)})}s(t0,"hp"),o(t0,"_nan");function it(e,t){return new Za({check:"less_than",...T(t),value:e,inclusive:!1})}s(it,"st"),o(it,"_lt");function ze(e,t){return new Za({check:"less_than",...T(t),value:e,inclusive:!0})}s(ze,"Ze"),o(ze,"_lte");function nt(e,t){return new La({check:"greater_than",...T(t),value:e,inclusive:!1})}s(nt,"at"),o(nt,"_gt");function Ce(e,t){return new La({check:"greater_than",...T(t),value:e,inclusive:!0})}s(Ce,"je"),o(Ce,"_gte");function un(e){return nt(0,e)}s(un,"es"),o(un,"_positive");function rn(e){return it(0,e)}s(rn,"ts"),o(rn,"_negative");function nn(e){return ze(0,e)}s(nn,"rs"),o(nn,"_nonpositive");function sn(e){return Ce(0,e)}s(sn,"ns"),o(sn,"_nonnegative");function Nt(e,t){return new Sf({check:"multiple_of",...T(t),value:e})}s(Nt,"At"),o(Nt,"_multipleOf");function Mt(e,t){return new zf({check:"max_size",...T(t),maximum:e})}s(Mt,"jt"),o(Mt,"_maxSize");function st(e,t){return new Nf({check:"min_size",...T(t),minimum:e})}s(st,"ct"),o(st,"_minSize");function au(e,t){return new Mf({check:"size_equals",...T(t),size:e})}s(au,"tr"),o(au,"_size");function ou(e,t){return new Of({check:"max_length",...T(t),maximum:e})}s(ou,"rr"),o(ou,"_maxLength");function ht(e,t){return new Rf({check:"min_length",...T(t),minimum:e})}s(ht,"vt"),o(ht,"_minLength");function lu(e,t){return new Tf({check:"length_equals",...T(t),length:e})}s(lu,"nr"),o(lu,"_length");function lr(e,t){return new Pf({check:"string_format",format:"regex",...T(t),pattern:e})}s(lr,"Tr"),o(lr,"_regex");function dr(e){return new Uf({check:"string_format",format:"lowercase",...T(e)})}s(dr,"Ar"),o(dr,"_lowercase");function cr(e){return new qf({check:"string_format",format:"uppercase",...T(e)})}s(cr,"jr"),o(cr,"_uppercase");function pr(e,t){return new Zf({check:"string_format",format:"includes",...T(t),includes:e})}s(pr,"zr"),o(pr,"_includes");function mr(e,t){return new Lf({check:"string_format",format:"starts_with",...T(t),prefix:e})}s(mr,"Or"),o(mr,"_startsWith");function fr(e,t){return new Vf({check:"string_format",format:"ends_with",...T(t),suffix:e})}s(fr,"Mr"),o(fr,"_endsWith");function an(e,t,r){return new Jf({check:"property",property:e,schema:t,...T(r)})}s(an,"os"),o(an,"_property");function hr(e,t){return new Wf({check:"mime_type",mime:e,...T(t)})}s(hr,"Nr"),o(hr,"_mime");function Ke(e){return new Gf({check:"overwrite",tx:e})}s(Ke,"et"),o(Ke,"_overwrite");function gr(e){return Ke(t=>t.normalize(e))}s(gr,"Pr"),o(gr,"_normalize");function vr(){return Ke(e=>e.trim())}s(vr,"Dr"),o(vr,"_trim");function yr(){return Ke(e=>e.toLowerCase())}s(yr,"Cr"),o(yr,"_toLowerCase");function Er(){return Ke(e=>e.toUpperCase())}s(Er,"Ur"),o(Er,"_toUpperCase");function br(){return Ke(e=>ga(e))}s(br,"Lr"),o(br,"_slugify");function u0(e,t,r){return new e({type:"array",element:t,...T(r)})}s(u0,"gp"),o(u0,"_array");function sv(e,t,r){return new e({type:"union",options:t,...T(r)})}s(sv,"cR"),o(sv,"_union");function av(e,t,r){return new e({type:"union",options:t,inclusive:!1,...T(r)})}s(av,"uR"),o(av,"_xor");function ov(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...T(i)})}s(ov,"lR"),o(ov,"_discriminatedUnion");function lv(e,t,r){return new e({type:"intersection",left:t,right:r})}s(lv,"dR"),o(lv,"_intersection");function dv(e,t,r,i){let u=r instanceof X,n=u?i:r,a=u?r:null;return new e({type:"tuple",items:t,rest:a,...T(n)})}s(dv,"pR"),o(dv,"_tuple");function cv(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...T(i)})}s(cv,"fR"),o(cv,"_record");function pv(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...T(i)})}s(pv,"mR"),o(pv,"_map");function mv(e,t,r){return new e({type:"set",valueType:t,...T(r)})}s(mv,"hR"),o(mv,"_set");function fv(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(u=>[u,u])):t;return new e({type:"enum",entries:i,...T(r)})}s(fv,"gR"),o(fv,"_enum");function hv(e,t,r){return new e({type:"enum",entries:t,...T(r)})}s(hv,"vR"),o(hv,"_nativeEnum");function gv(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(r)})}s(gv,"yR"),o(gv,"_literal");function r0(e,t){return new e({type:"file",...T(t)})}s(r0,"vp"),o(r0,"_file");function vv(e,t){return new e({type:"transform",transform:t})}s(vv,"bR"),o(vv,"_transform");function yv(e,t){return new e({type:"optional",innerType:t})}s(yv,"wR"),o(yv,"_optional");function Ev(e,t){return new e({type:"nullable",innerType:t})}s(Ev,"xR"),o(Ev,"_nullable");function bv(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ya(r)}})}s(bv,"$R"),o(bv,"_default");function wv(e,t,r){return new e({type:"nonoptional",innerType:t,...T(r)})}s(wv,"_R"),o(wv,"_nonoptional");function Dv(e,t){return new e({type:"success",innerType:t})}s(Dv,"kR"),o(Dv,"_success");function $v(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}s($v,"SR"),o($v,"_catch");function Bv(e,t,r){return new e({type:"pipe",in:t,out:r})}s(Bv,"IR"),o(Bv,"_pipe");function xv(e,t){return new e({type:"readonly",innerType:t})}s(xv,"RR"),o(xv,"_readonly");function Cv(e,t,r){return new e({type:"template_literal",parts:t,...T(r)})}s(Cv,"ER"),o(Cv,"_templateLiteral");function kv(e,t){return new e({type:"lazy",getter:t})}s(kv,"TR"),o(kv,"_lazy");function Av(e,t){return new e({type:"promise",innerType:t})}s(Av,"AR"),o(Av,"_promise");function i0(e,t,r){let i=T(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}s(i0,"yp"),o(i0,"_custom");function n0(e,t,r){return new e({type:"custom",check:"custom",fn:t,...T(r)})}s(n0,"bp"),o(n0,"_refine");function s0(e,t){let r=a0(i=>(i.addIssue=u=>{if(typeof u=="string")i.issues.push(Ku(u,i.value,r._zod.def));else{let n=u;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=r),n.continue??(n.continue=!r._zod.def.abort),i.issues.push(Ku(n))}},e(i.value,i)),t);return r}s(s0,"wp"),o(s0,"_superRefine");function a0(e,t){let r=new de({check:"custom",...T(t)});return r._zod.check=e,r}s(a0,"Lw"),o(a0,"_check");function o0(e){let t=new de({check:"describe"});return t._zod.onattach=[r=>{let i=Re.get(r)??{};Re.add(r,{...i,description:e})}],t._zod.check=()=>{},t}s(o0,"xp"),o(o0,"describe");function l0(e){let t=new de({check:"meta"});return t._zod.onattach=[r=>{let i=Re.get(r)??{};Re.add(r,{...i,...e})}],t._zod.check=()=>{},t}s(l0,"$p"),o(l0,"meta");function d0(e,t){let r=T(t),i=r.truthy??["true","1","yes","on","y","enabled"],u=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),u=u.map(h=>typeof h=="string"?h.toLowerCase():h));let n=new Set(i),a=new Set(u),l=e.Codec??ho,d=e.Boolean??Ka,c=e.String??tr,p=new c({type:"string",error:r.error}),m=new d({type:"boolean",error:r.error}),f=new l({type:"pipe",in:p,out:m,transform:o(((h,g)=>{let b=h;return r.case!=="sensitive"&&(b=b.toLowerCase()),n.has(b)?!0:a.has(b)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:g.value,inst:f,continue:!1}),{})}),"transform"),reverseTransform:o(((h,g)=>h===!0?i[0]||"true":u[0]||"false"),"reverseTransform"),error:r.error});return f}s(d0,"_p"),o(d0,"_stringbool");function du(e,t,r,i={}){let u=T(i),n={...T(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...u};return r instanceof RegExp&&(n.pattern=r),new e(n)}s(du,"Fr"),o(du,"_stringFormat");function Ot(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}s(Ot,"zt"),o(Ot,"initializeContext");function ie(e,t,r={path:[],schemaPath:[]}){var i;let u=e._zod.def,n=t.seen.get(e);if(n)return n.count++,r.schemaPath.includes(e)&&(n.cycle=r.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{let m=a.schema,f=t.processors[u.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);f(e,t,m,c)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),ie(p,t,c),t.seen.get(p).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&xe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}s(ie,"te"),o(ie,"process");function Rt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let l=e.metadataRegistry.get(a[0])?.id;if(l){let d=i.get(l);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,a[0])}}let u=o(a=>{let l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${l}/${f}`}}if(a[1]===r)return{ref:"#"};let d=`#/${l}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:d+c}},"makeURI"),n=o(a=>{if(a[1].schema.$ref)return;let l=a[1],{ref:d,defId:c}=u(a);l.def={...l.schema},c&&(l.defId=c);let p=l.schema;for(let m in p)delete p[m];p.$ref=d},"extractToDef");if(e.cycles==="throw")for(let a of e.seen.entries()){let l=a[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
63
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let $=f.compile();return(w,k)=>$(m,w,k)},"generateFastpass"),n,a=jt,l=!Lu.jitless,d=l&&N4.value,c=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=i.value);let h=m.value;return a(h)?l&&d&&f?.async===!1&&f.jitless!==!0?(n||(n=u(t.shape)),m=n(m,f),c?Qa([],h,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),m)}});function eo(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let u=e.filter(n=>!mt(n));return u.length===1?(t.value=u[0].value,u[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ae(a,i,be())))}),t)}s(eo,"vw"),o(eo,"handleUnionResults");var ji=B("$ZodUnion",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Ju(u.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,u)=>{if(r)return r(i,u);let n=!1,a=[];for(let l of t.options){let d=l._zod.run({value:i.value,issues:[]},u);if(d instanceof Promise)a.push(d),n=!0;else{if(d.issues.length===0)return d;a.push(d)}}return n?Promise.all(a).then(l=>eo(l,i,e,u)):eo(a,i,e,u)}});function to(e,t,r,i){let u=e.filter(n=>n.issues.length===0);return u.length===1?(t.value=u[0].value,t):(u.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(a=>Ae(a,i,be())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}s(to,"yw"),o(to,"handleExclusiveUnionResults");var Mh=B("$ZodXor",(e,t)=>{ji.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,u)=>{if(r)return r(i,u);let n=!1,a=[];for(let l of t.options){let d=l._zod.run({value:i.value,issues:[]},u);d instanceof Promise?(a.push(d),n=!0):a.push(d)}return n?Promise.all(a).then(l=>to(l,i,e,u)):to(a,i,e,u)}}),Oh=B("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ji.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let u={};for(let n of t.options){let a=n._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[l,d]of Object.entries(a)){u[l]||(u[l]=new Set);for(let c of d)u[l].add(c)}}return u});let i=uu(()=>{let u=t.options,n=new Map;for(let a of u){let l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let d of l){if(n.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);n.set(d,a)}}return n});e._zod.parse=(u,n)=>{let a=u.value;if(!jt(a))return u.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),u;let l=i.value.get(a?.[t.discriminator]);return l?l._zod.run(u,n):t.unionFallback||n.direction==="backward"?r(u,n):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:a,path:[t.discriminator],inst:e}),u)}}),Rh=B("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value,n=t.left._zod.run({value:u,issues:[]},i),a=t.right._zod.run({value:u,issues:[]},i);return n instanceof Promise||a instanceof Promise?Promise.all([n,a]).then(([l,d])=>uo(r,l,d)):uo(r,n,a)}});function zi(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(pt(e)&&pt(t)){let r=Object.keys(t),i=Object.keys(e).filter(n=>r.indexOf(n)!==-1),u={...e,...t};for(let n of i){let a=zi(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};u[n]=a.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let u=e[i],n=t[i],a=zi(u,n);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}s(zi,"zu"),o(zi,"mergeValues");function uo(e,t,r){let i=new Map,u;for(let l of t.issues)if(l.code==="unrecognized_keys"){u??(u=l);for(let d of l.keys)i.has(d)||i.set(d,{}),i.get(d).l=!0}else e.issues.push(l);for(let l of r.issues)if(l.code==="unrecognized_keys")for(let d of l.keys)i.has(d)||i.set(d,{}),i.get(d).r=!0;else e.issues.push(l);let n=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(n.length&&u&&e.issues.push({...u,keys:n}),mt(e))return e;let a=zi(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}s(uo,"bw"),o(uo,"handleIntersectionResults");var ro=B("$ZodTuple",(e,t)=>{X.init(e,t);let r=t.items;e._zod.parse=(i,u)=>{let n=i.value;if(!Array.isArray(n))return i.issues.push({input:n,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],l=io(r,"optin"),d=io(r,"optout");if(!t.rest){if(n.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:n,inst:e,origin:"array"}),i;n.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:n,inst:e,origin:"array"})}let c=new Array(r.length);for(let p=0;p<r.length;p++){let m=r[p]._zod.run({value:n[p],issues:[]},u);m instanceof Promise?a.push(m.then(f=>{c[p]=f})):c[p]=m}if(t.rest){let p=r.length-1,m=n.slice(r.length);for(let f of m){p++;let h=t.rest._zod.run({value:f,issues:[]},u);h instanceof Promise?a.push(h.then(g=>no(g,i,p))):no(h,i,p)}}return a.length?Promise.all(a).then(()=>so(c,i,r,n,d)):so(c,i,r,n,d)}});function io(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}s(io,"ww"),o(io,"getTupleOptStart");function no(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}s(no,"xw"),o(no,"handleTupleResult");function so(e,t,r,i,u){for(let n=0;n<r.length;n++){let a=e[n],l=n<i.length;if(a.issues.length){if(!l&&n>=u){t.value.length=n;break}t.issues.push(...Fe(n,a.issues))}t.value[n]=a.value}for(let n=t.value.length-1;n>=i.length&&r[n]._zod.optout==="optional"&&t.value[n]===void 0;n--)t.value.length=n;return t}s(so,"$w"),o(so,"handleTupleResults");var Th=B("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!pt(u))return r.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),r;let n=[],a=t.keyType._zod.values;if(a){r.value={};let l=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);let p=t.keyType._zod.run({value:c,issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>Ae(h,i,be())),input:c,path:[c],inst:e});continue}let m=p.value,f=t.valueType._zod.run({value:u[c],issues:[]},i);f instanceof Promise?n.push(f.then(h=>{h.issues.length&&r.issues.push(...Fe(c,h.issues)),r.value[m]=h.value})):(f.issues.length&&r.issues.push(...Fe(c,f.issues)),r.value[m]=f.value)}let d;for(let c in u)l.has(c)||(d=d??[],d.push(c));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:d})}else{r.value={};for(let l of Reflect.ownKeys(u)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(u,l))continue;let d=t.keyType._zod.run({value:l,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&qa.test(l)&&d.issues.length){let p=t.keyType._zod.run({value:Number(l),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?r.value[l]=u[l]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Ae(p,i,be())),input:l,path:[l],inst:e});continue}let c=t.valueType._zod.run({value:u[l],issues:[]},i);c instanceof Promise?n.push(c.then(p=>{p.issues.length&&r.issues.push(...Fe(l,p.issues)),r.value[d.value]=p.value})):(c.issues.length&&r.issues.push(...Fe(l,c.issues)),r.value[d.value]=c.value)}}return n.length?Promise.all(n).then(()=>r):r}}),Ph=B("$ZodMap",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!(u instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:u,inst:e}),r;let n=[];r.value=new Map;for(let[a,l]of u){let d=t.keyType._zod.run({value:a,issues:[]},i),c=t.valueType._zod.run({value:l,issues:[]},i);d instanceof Promise||c instanceof Promise?n.push(Promise.all([d,c]).then(([p,m])=>{ao(p,m,r,a,u,e,i)})):ao(d,c,r,a,u,e,i)}return n.length?Promise.all(n).then(()=>r):r}});function ao(e,t,r,i,u,n,a){e.issues.length&&(Ii.has(typeof i)?r.issues.push(...Fe(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:u,inst:n,issues:e.issues.map(l=>Ae(l,a,be()))})),t.issues.length&&(Ii.has(typeof i)?r.issues.push(...Fe(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:u,inst:n,key:i,issues:t.issues.map(l=>Ae(l,a,be()))})),r.value.set(e.value,t.value)}s(ao,"_w"),o(ao,"handleMapResult");var Uh=B("$ZodSet",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;if(!(u instanceof Set))return r.issues.push({input:u,inst:e,expected:"set",code:"invalid_type"}),r;let n=[];r.value=new Set;for(let a of u){let l=t.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise?n.push(l.then(d=>oo(d,r))):oo(l,r)}return n.length?Promise.all(n).then(()=>r):r}});function oo(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}s(oo,"kw"),o(oo,"handleSetResult");var qh=B("$ZodEnum",(e,t)=>{X.init(e,t);let r=ki(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(u=>Ii.has(typeof u)).map(u=>typeof u=="string"?Ge(u):u.toString()).join("|")})$`),e._zod.parse=(u,n)=>{let a=u.value;return i.has(a)||u.issues.push({code:"invalid_value",values:r,input:a,inst:e}),u}}),Zh=B("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Ge(i):i?Ge(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,u)=>{let n=i.value;return r.has(n)||i.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),i}}),Lh=B("$ZodFile",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{let u=r.value;return u instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:u,inst:e}),r}}),Vh=B("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ci(e.constructor.name);let u=t.transform(r.value,r);if(i.async)return(u instanceof Promise?u:Promise.resolve(u)).then(n=>(r.value=n,r.fallback=!0,r));if(u instanceof Promise)throw new Ft;return r.value=u,r.fallback=!0,r}});function lo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}s(lo,"Sw"),o(lo,"handleOptionalResult");var co=B("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ju(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let u=r.value,n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(a=>lo(a,u)):lo(n,u)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),Jh=B("$ZodExactOptional",(e,t)=>{co.init(e,t),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Wh=B("$ZodNullable",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ju(r.source)}|null)$`):void 0}),ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Gh=B("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>po(n,t)):po(u,t)}});function po(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}s(po,"Iw"),o(po,"handleDefaultResult");var Kh=B("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),Hh=B("$ZodNonOptional",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>mo(n,e)):mo(u,e)}});function mo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}s(mo,"Rw"),o(mo,"handleNonOptionalResult");var Xh=B("$ZodSuccess",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ci("ZodSuccess");let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>(r.value=n.issues.length===0,r)):(r.value=u.issues.length===0,r)}}),Yh=B("$ZodCatch",(e,t)=>{X.init(e,t),e._zod.optin="optional",ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(n=>(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(a=>Ae(a,i,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(n=>Ae(n,i,be()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Qh=B("$ZodNaN",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),fo=B("$ZodPipe",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let n=t.out._zod.run(r,i);return n instanceof Promise?n.then(a=>rr(a,t.in,i)):rr(n,t.in,i)}let u=t.in._zod.run(r,i);return u instanceof Promise?u.then(n=>rr(n,t.out,i)):rr(u,t.out,i)}});function rr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}s(rr,"_i"),o(rr,"handlePipeResult");var ho=B("$ZodCodec",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let u=t.in._zod.run(r,i);return u instanceof Promise?u.then(n=>ir(n,t,i)):ir(u,t,i)}else{let u=t.out._zod.run(r,i);return u instanceof Promise?u.then(n=>ir(n,t,i)):ir(u,t,i)}}});function ir(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(u=>nr(e,u,t.out,r)):nr(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(u=>nr(e,u,t.in,r)):nr(e,i,t.in,r)}}s(ir,"ki"),o(ir,"handleCodecAResult");function nr(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}s(nr,"Si"),o(nr,"handleCodecTxResult");var eg=B("$ZodPreprocess",(e,t)=>{fo.init(e,t)}),tg=B("$ZodReadonly",(e,t)=>{X.init(e,t),ee(e._zod,"propValues",()=>t.innerType._zod.propValues),ee(e._zod,"values",()=>t.innerType._zod.values),ee(e._zod,"optin",()=>t.innerType?._zod?.optin),ee(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let u=t.innerType._zod.run(r,i);return u instanceof Promise?u.then(go):go(u)}});function go(e){return e.value=Object.freeze(e.value),e}s(go,"Ew"),o(go,"handleReadonlyResult");var ug=B("$ZodTemplateLiteral",(e,t)=>{X.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let u=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!u)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let n=u.startsWith("^")?1:0,a=u.endsWith("$")?u.length-1:u.length;r.push(u.slice(n,a))}else if(i===null||O4.has(typeof i))r.push(Ge(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,u)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",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:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),rg=B("$ZodFunction",(e,t)=>(X.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let u=e._def.input?ka(e._def.input,i):i,n=Reflect.apply(r,this,u);return e._def.output?ka(e._def.output,n):n}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let u=e._def.input?await Aa(e._def.input,i):i,n=await Reflect.apply(r,this,u);return e._def.output?await Aa(e._def.output,n):n}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new ro({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),ig=B("$ZodPromise",(e,t)=>{X.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(u=>t.innerType._zod.run({value:u,issues:[]},i))}),ng=B("$ZodLazy",(e,t)=>{X.init(e,t),ee(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ee(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ee(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ee(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ee(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),sg=B("$ZodCustom",(e,t)=>{de.init(e,t),X.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,u=t.fn(i);if(u instanceof Promise)return u.then(n=>vo(n,r,i,e));vo(u,r,i,e)}});function vo(e,t,r,i){if(!e){let u={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(u.params=i._zod.def.params),t.issues.push(Ku(u))}}s(vo,"Tw"),o(vo,"handleRefineResult");var yo={};ut(yo,{ar:s(()=>ag,"ar"),az:s(()=>og,"az"),be:s(()=>lg,"be"),bg:s(()=>dg,"bg"),ca:s(()=>cg,"ca"),cs:s(()=>pg,"cs"),da:s(()=>mg,"da"),de:s(()=>fg,"de"),el:s(()=>hg,"el"),en:s(()=>bo,"en"),eo:s(()=>gg,"eo"),es:s(()=>vg,"es"),fa:s(()=>yg,"fa"),fi:s(()=>Eg,"fi"),fr:s(()=>bg,"fr"),frCA:s(()=>wg,"frCA"),he:s(()=>Dg,"he"),hr:s(()=>$g,"hr"),hu:s(()=>Bg,"hu"),hy:s(()=>xg,"hy"),id:s(()=>Cg,"id"),is:s(()=>kg,"is"),it:s(()=>Ag,"it"),ja:s(()=>Ig,"ja"),ka:s(()=>_g,"ka"),kh:s(()=>Sg,"kh"),km:s(()=>Do,"km"),ko:s(()=>Fg,"ko"),lt:s(()=>jg,"lt"),mk:s(()=>zg,"mk"),ms:s(()=>Ng,"ms"),nl:s(()=>Mg,"nl"),no:s(()=>Og,"no"),ota:s(()=>Rg,"ota"),pl:s(()=>Pg,"pl"),ps:s(()=>Tg,"ps"),pt:s(()=>Ug,"pt"),ro:s(()=>qg,"ro"),ru:s(()=>Zg,"ru"),sl:s(()=>Lg,"sl"),sv:s(()=>Vg,"sv"),ta:s(()=>Jg,"ta"),th:s(()=>Wg,"th"),tr:s(()=>Gg,"tr"),ua:s(()=>Kg,"ua"),uk:s(()=>xo,"uk"),ur:s(()=>Hg,"ur"),uz:s(()=>Xg,"uz"),vi:s(()=>Yg,"vi"),yo:s(()=>tv,"yo"),zhCN:s(()=>Qg,"zhCN"),zhTW:s(()=>ev,"zhTW")});var cw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`:`\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}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${l}`}case"invalid_value":return u.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 ${J(u.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: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${u.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 ${u.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${u.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${u.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${u.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${u.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${u.keys.length>1?"\u0629":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${u.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 ${u.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function ag(){return{localeError:cw()}}s(ag,"Bl"),o(ag,"default");var pw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${u.expected}, daxil olan ${l}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n}, daxil olan ${l}`}case"invalid_value":return u.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${J(u.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${n}${u.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${u.origin??"d\u0259y\u0259r"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${n.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:n.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${n.suffix}" il\u0259 bitm\u0259lidir`:n.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${n.includes}" daxil olmal\u0131d\u0131r`:n.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${n.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[n.format]??u.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${u.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${u.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function og(){return{localeError:pw()}}s(og,"Zl"),o(og,"default");function Eo(e,t,r,i){let u=Math.abs(e),n=u%10,a=u%100;return a>=11&&a<=19?i:n===1?t:n>=2&&n<=4?r:i}s(Eo,"Nw"),o(Eo,"getBelarusianPlural");var mw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${u.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Eo(l,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 ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${n}${u.maximum.toString()} ${d}`}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 ${u.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Eo(l,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 ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${n}${u.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${u.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${u.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${u.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 ${u.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function lg(){return{localeError:mw()}}s(lg,"ql"),o(lg,"default");var fw=o(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",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:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${n}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${J(u.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${u.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${n}${u.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${u.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;if(n.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${n.prefix}"`;if(n.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${n.suffix}"`;if(n.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${n.includes}"`;if(n.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${n.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[n.format]??u.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${u.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u043E\u0432\u0435":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${u.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${u.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function dg(){return{localeError:fw()}}s(dg,"Vl"),o(dg,"default");var hw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${u.expected}, s'ha rebut ${l}`:`Tipus inv\xE0lid: s'esperava ${n}, s'ha rebut ${l}`}case"invalid_value":return u.values.length===1?`Valor inv\xE0lid: s'esperava ${J(u.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${O(u.values," o ")}`;case"too_big":{let n=u.inclusive?"com a m\xE0xim":"menys de",a=t(u.origin);return a?`Massa gran: s'esperava que ${u.origin??"el valor"} contingu\xE9s ${n} ${u.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${u.origin??"el valor"} fos ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(u.origin);return a?`Massa petit: s'esperava que ${u.origin} contingu\xE9s ${n} ${u.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${u.origin} fos ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${n.prefix}"`:n.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${n.suffix}"`:n.format==="includes"?`Format inv\xE0lid: ha d'incloure "${n.includes}"`:n.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${n.pattern}`:`Format inv\xE0lid per a ${r[n.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${u.divisor}`;case"unrecognized_keys":return`Clau${u.keys.length>1?"s":""} no reconeguda${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${u.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${u.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function cg(){return{localeError:hw()}}s(cg,"Gl"),o(cg,"default");var gw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${u.expected}, obdr\u017Eeno ${l}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n}, obdr\u017Eeno ${l}`}case"invalid_value":return u.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${J(u.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${n}${u.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED m\xEDt ${n}${u.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${u.origin??"hodnota"} mus\xED b\xFDt ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${n.prefix}"`:n.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${n.suffix}"`:n.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${n.includes}"`:n.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${n.pattern}`:`Neplatn\xFD form\xE1t ${r[n.format]??u.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${u.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${O(u.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${u.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${u.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function pg(){return{localeError:gw()}}s(pg,"Jl"),o(pg,"default");var vw=o(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldigt input: forventede instanceof ${u.expected}, fik ${l}`:`Ugyldigt input: forventede ${n}, fik ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig v\xE6rdi: forventede ${J(u.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`For stor: forventede ${l??"value"} ${a.verb} ${n} ${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`For lille: forventede ${l} ${a.verb} ${n} ${u.minimum.toString()} ${a.unit}`:`For lille: forventede ${l} havde ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ugyldig streng: skal starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: skal ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: skal indeholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${r[n.format]??u.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${u.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${u.origin}`;default:return"Ugyldigt input"}}},"error");function mg(){return{localeError:vw()}}s(mg,"Wl"),o(mg,"default");var yw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"Zahl",array:"Array"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${u.expected}, erhalten ${l}`:`Ung\xFCltige Eingabe: erwartet ${n}, erhalten ${l}`}case"invalid_value":return u.values.length===1?`Ung\xFCltige Eingabe: erwartet ${J(u.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${n}${u.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${u.origin??"Wert"} ${n}${u.maximum.toString()} ist`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Zu klein: erwartet, dass ${u.origin} ${n}${u.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${u.origin} ${n}${u.minimum.toString()} ist`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ung\xFCltiger String: muss mit "${n.prefix}" beginnen`:n.format==="ends_with"?`Ung\xFCltiger String: muss mit "${n.suffix}" enden`:n.format==="includes"?`Ung\xFCltiger String: muss "${n.includes}" enthalten`:n.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${n.pattern} entsprechen`:`Ung\xFCltig: ${r[n.format]??u.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${u.divisor} sein`;case"unrecognized_keys":return`${u.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${u.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${u.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function fg(){return{localeError:yw()}}s(fg,"Kl"),o(fg,"default");var Ew=o(()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return typeof u.expected=="string"&&/^[A-Z]/.test(u.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${u.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${l}`}case"invalid_value":return u.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${J(u.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${n}${u.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${n}${u.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${u.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${n.prefix}"`:n.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${n.suffix}"`:n.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${n.includes}"`:n.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${n.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[n.format]??u.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${u.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${u.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${u.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${u.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${u.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function hg(){return{localeError:Ew()}}s(hg,"Xl"),o(hg,"default");var bw=o(()=>{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"},map:{unit:"entries",verb:"to have"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return`Invalid input: expected ${n}, received ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${J(u.values[0])}`:`Invalid option: expected one of ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Too big: expected ${u.origin??"value"} to have ${n}${u.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${u.origin??"value"} to be ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Too small: expected ${u.origin} to have ${n}${u.minimum.toString()} ${a.unit}`:`Too small: expected ${u.origin} to be ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;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 ${r[n.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`Invalid discriminator value. Expected ${u.options.map(n=>`'${n}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}},"error");function bo(){return{localeError:bw()}}s(bo,"Ln"),o(bo,"default");var ww=o(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${u.expected}, ricevi\u011Dis ${l}`:`Nevalida enigo: atendi\u011Dis ${n}, ricevi\u011Dis ${l}`}case"invalid_value":return u.values.length===1?`Nevalida enigo: atendi\u011Dis ${J(u.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${n}${u.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${u.origin??"valoro"} havu ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Tro malgranda: atendi\u011Dis ke ${u.origin} havu ${n}${u.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${u.origin} estu ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;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 ${r[n.format]??u.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${u.divisor}`;case"unrecognized_keys":return`Nekonata${u.keys.length>1?"j":""} \u015Dlosilo${u.keys.length>1?"j":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${u.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${u.origin}`;default:return"Nevalida enigo"}}},"error");function gg(){return{localeError:ww()}}s(gg,"Hl"),o(gg,"default");var Dw=o(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${u.expected}, recibido ${l}`:`Entrada inv\xE1lida: se esperaba ${n}, recibido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: se esperaba ${J(u.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${n}${u.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${n}${u.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${n.prefix}"`:n.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${n.suffix}"`:n.format==="includes"?`Cadena inv\xE1lida: debe incluir "${n.includes}"`:n.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${n.pattern}`:`Inv\xE1lido ${r[n.format]??u.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Llave${u.keys.length>1?"s":""} desconocida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[u.origin]??u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[u.origin]??u.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function vg(){return{localeError:Dw()}}s(vg,"Yl"),o(vg,"default");var $w=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${u.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${l} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return u.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${J(u.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 ${O(u.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${u.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:n.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:n.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${n.includes}" \u0628\u0627\u0634\u062F`:n.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${n.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[n.format]??u.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 ${u.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${u.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${O(u.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${u.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 ${u.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function yg(){return{localeError:$w()}}s(yg,"Ql"),o(yg,"default");var Bw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Virheellinen tyyppi: odotettiin instanceof ${u.expected}, oli ${l}`:`Virheellinen tyyppi: odotettiin ${n}, oli ${l}`}case"invalid_value":return u.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${J(u.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${n}${u.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${n}${u.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${n.prefix}"`:n.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${n.suffix}"`:n.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${n.includes}"`:n.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${n.pattern}`:`Virheellinen ${r[n.format]??u.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${u.divisor} monikerta`;case"unrecognized_keys":return`${u.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(u.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"}}},"error");function Eg(){return{localeError:Bw()}}s(Eg,"ed"),o(Eg,"default");var xw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : instanceof ${u.expected} attendu, ${l} re\xE7u`:`Entr\xE9e invalide : ${n} attendu, ${l} re\xE7u`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : ${J(u.values[0])} attendu`:`Option invalide : une valeur parmi ${O(u.values,"|")} attendue`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Trop grand : ${i[u.origin]??"valeur"} doit ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[u.origin]??"valeur"} doit \xEAtre ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Trop petit : ${i[u.origin]??"valeur"} doit ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Trop petit : ${i[u.origin]??"valeur"} doit \xEAtre ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${n.pattern}`:`${r[n.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function bg(){return{localeError:xw()}}s(bg,"td"),o(bg,"default");var Cw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Entr\xE9e invalide : attendu instanceof ${u.expected}, re\xE7u ${l}`:`Entr\xE9e invalide : attendu ${n}, re\xE7u ${l}`}case"invalid_value":return u.values.length===1?`Entr\xE9e invalide : attendu ${J(u.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"\u2264":"<",a=t(u.origin);return a?`Trop grand : attendu que ${u.origin??"la valeur"} ait ${n}${u.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${u.origin??"la valeur"} soit ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"\u2265":">",a=t(u.origin);return a?`Trop petit : attendu que ${u.origin} ait ${n}${u.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${u.origin} soit ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${n.pattern}`:`${r[n.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${u.divisor}`;case"unrecognized_keys":return`Cl\xE9${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${O(u.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${u.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entr\xE9e invalide"}}},"error");function wg(){return{localeError:Cw()}}s(wg,"rd"),o(wg,"default");var kw=o(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=o(c=>c?e[c]:void 0,"typeEntry"),i=o(c=>{let p=r(c);return p?p.label:c??e.unknown.label},"typeLabel"),u=o(c=>`\u05D4${i(c)}`,"withDefinite"),n=o(c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),a=o(c=>c?t[c]??null:null,"getSizing"),l={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,m=d[p??""]??i(p),f=G(c.input),h=d[f]??e[f]?.label??f;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${J(c.values[0])}`;let p=c.values.map(f=>J(f));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let m=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case"too_big":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",b=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let f=c.inclusive?"<=":"<",h=n(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),m=u(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let g=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(c.origin==="array"||c.origin==="set"){let g=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin,"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let b=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`.trim()}let f=c.inclusive?">=":">",h=n(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${h} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let m=l[p.format],f=m?.label??p.format,h=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${h}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${O(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";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${u(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function Dg(){return{localeError:kw()}}s(Dg,"nd"),o(Dg,"default");var Aw=o(()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${u.expected}, a primljeno je ${l}`:`Neispravan unos: o\u010Dekuje se ${n}, a primljeno je ${l}`}case"invalid_value":return u.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${J(u.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Preveliko: o\u010Dekivano da ${l??"vrijednost"} ima ${n}${u.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${l??"vrijednost"} bude ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=i[u.origin]??u.origin;return a?`Premalo: o\u010Dekivano da ${l} ima ${n}${u.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${l} bude ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${n.prefix}"`:n.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${n.suffix}"`:n.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${n.includes}"`:n.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${n.pattern}`:`Neispravna ${r[n.format]??u.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${u.divisor}`;case"unrecognized_keys":return`Neprepoznat${u.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[u.origin]??u.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[u.origin]??u.origin}`;default:return"Neispravan unos"}}},"error");function $g(){return{localeError:Aw()}}s($g,"od"),o($g,"default");var Iw=o(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${u.expected}, a kapott \xE9rt\xE9k ${l}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n}, a kapott \xE9rt\xE9k ${l}`}case"invalid_value":return u.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${J(u.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xFAl nagy: ${u.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${n}${u.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${u.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} m\xE9rete t\xFAl kicsi ${n}${u.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${u.origin} t\xFAl kicsi ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\xC9rv\xE9nytelen string: "${n.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:n.format==="ends_with"?`\xC9rv\xE9nytelen string: "${n.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:n.format==="includes"?`\xC9rv\xE9nytelen string: "${n.includes}" \xE9rt\xE9ket kell tartalmaznia`:n.format==="regex"?`\xC9rv\xE9nytelen string: ${n.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[n.format]??u.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${u.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${u.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${u.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function Bg(){return{localeError:Iw()}}s(Bg,"id"),o(Bg,"default");function wo(e,t,r){return Math.abs(e)===1?t:r}s(wo,"Pw"),o(wo,"getArmenianPlural");function zt(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}s(zt,"Er"),o(zt,"withDefiniteArticle");var _w=o(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${u.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${n}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${l}`}case"invalid_value":return u.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${J(u.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=wo(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${n}${u.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=wo(l,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${n}${u.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zt(u.origin)} \u056C\u056B\u0576\u056B ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${n.prefix}"-\u0578\u057E`:n.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${n.suffix}"-\u0578\u057E`:n.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${n.includes}"`:n.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${n.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[n.format]??u.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${u.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${u.keys.length>1?"\u0576\u0565\u0580":""}. ${O(u.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${zt(u.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${zt(u.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function xg(){return{localeError:_w()}}s(xg,"sd"),o(xg,"default");var Sw=o(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak valid: diharapkan instanceof ${u.expected}, diterima ${l}`:`Input tidak valid: diharapkan ${n}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak valid: diharapkan ${J(u.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: diharapkan ${u.origin??"value"} memiliki ${n}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${u.origin??"value"} menjadi ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: diharapkan ${u.origin} memiliki ${n}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${u.origin} menjadi ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`String tidak valid: harus dimulai dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak valid: harus berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak valid: harus menyertakan "${n.includes}"`:n.format==="regex"?`String tidak valid: harus sesuai pola ${n.pattern}`:`${r[n.format]??u.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${u.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${u.origin}`;default:return"Input tidak valid"}}},"error");function Cg(){return{localeError:Sw()}}s(Cg,"ad"),o(Cg,"default");var Fw=o(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera instanceof ${u.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${l} \xFEar sem \xE1 a\xF0 vera ${n}`}case"invalid_value":return u.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${J(u.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} hafi ${n}${u.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin??"gildi"} s\xE9 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} hafi ${n}${u.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${u.origin} s\xE9 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${r[n.format]??u.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${u.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${u.keys.length>1?"ir lyklar":"ur lykill"}: ${O(u.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${u.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${u.origin}`;default:return"Rangt gildi"}}},"error");function kg(){return{localeError:Fw()}}s(kg,"cd"),o(kg,"default");var jw=o(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"numero",array:"vettore"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input non valido: atteso instanceof ${u.expected}, ricevuto ${l}`:`Input non valido: atteso ${n}, ricevuto ${l}`}case"invalid_value":return u.values.length===1?`Input non valido: atteso ${J(u.values[0])}`:`Opzione non valida: atteso uno tra ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Troppo grande: ${u.origin??"valore"} deve avere ${n}${u.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${u.origin??"valore"} deve essere ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Troppo piccolo: ${u.origin} deve avere ${n}${u.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${u.origin} deve essere ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Stringa non valida: deve iniziare con "${n.prefix}"`:n.format==="ends_with"?`Stringa non valida: deve terminare con "${n.suffix}"`:n.format==="includes"?`Stringa non valida: deve includere "${n.includes}"`:n.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${n.pattern}`:`Input non valido: ${r[n.format]??u.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${u.divisor}`;case"unrecognized_keys":return`Chiav${u.keys.length>1?"i":"e"} non riconosciut${u.keys.length>1?"e":"a"}: ${O(u.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${u.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${u.origin}`;default:return"Input non valido"}}},"error");function Ag(){return{localeError:jw()}}s(Ag,"ud"),o(Ag,"default");var zw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${u.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${n}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${l}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return u.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${J(u.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${O(u.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let n=u.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(u.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${a.unit??"\u8981\u7D20"}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${u.origin??"\u5024"}\u306F${u.maximum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let n=u.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(u.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${a.unit}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${u.origin}\u306F${u.minimum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${n.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[n.format]??u.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${u.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${u.keys.length>1?"\u7FA4":""}: ${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${u.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function Ig(){return{localeError:zw()}}s(Ig,"ld"),o(Ig,"default");var Nw=o(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${u.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${l}`}case"invalid_value":return u.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${J(u.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${O(u.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${u.origin} \u10D8\u10E7\u10DD\u10E1 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${u.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${u.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${u.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${u.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function _g(){return{localeError:Nw()}}s(_g,"dd"),o(_g,"default");var Mw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`:`\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} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${u.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${n} ${u.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${u.origin} ${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${O(u.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 ${u.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 ${u.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Do(){return{localeError:Mw()}}s(Do,"Fn"),o(Do,"default");function Sg(){return Do()}s(Sg,"pd"),o(Sg,"default");var Ow=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${u.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${l}\uC785\uB2C8\uB2E4`}case"invalid_value":return u.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${J(u.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${O(u.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let n=u.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=n==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()}${d} ${n}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${u.maximum.toString()} ${n}${a}`}case"too_small":{let n=u.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=n==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=t(u.origin),d=l?.unit??"\uC694\uC18C";return l?`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()}${d} ${n}${a}`:`${u.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${u.minimum.toString()} ${n}${a}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:n.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${n.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[n.format]??u.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${u.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${O(u.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${u.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${u.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function Fg(){return{localeError:Ow()}}s(Fg,"fd"),o(Fg,"default");var sr=o(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function $o(e){let t=Math.abs(e),r=t%10,i=t%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}s($o,"Dw"),o($o,"getUnitTypeFromNumber");var Rw=o(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(u,n,a,l){let d=e[u]??null;return d===null?d:{unit:d.unit[n],verb:d.verb[l][a?"inclusive":"notInclusive"]}}s(t,"t"),o(t,"getSizing");let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Gautas tipas ${l}, o tik\u0117tasi - instanceof ${u.expected}`:`Gautas tipas ${l}, o tik\u0117tasi - ${n}`}case"invalid_value":return u.values.length===1?`Privalo b\u016Bti ${J(u.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${O(u.values,"|")} pasirinkim\u0173`;case"too_big":{let n=i[u.origin]??u.origin,a=t(u.origin,$o(Number(u.maximum)),u.inclusive??!1,"smaller");if(a?.verb)return`${sr(n??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.maximum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${sr(n??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.maximum.toString()} ${a?.unit}`}case"too_small":{let n=i[u.origin]??u.origin,a=t(u.origin,$o(Number(u.minimum)),u.inclusive??!1,"bigger");if(a?.verb)return`${sr(n??u.origin??"reik\u0161m\u0117")} ${a.verb} ${u.minimum.toString()} ${a.unit??"element\u0173"}`;let l=u.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${sr(n??u.origin??"reik\u0161m\u0117")} turi b\u016Bti ${l} ${u.minimum.toString()} ${a?.unit}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${r[n.format]??u.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${u.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${u.keys.length>1?"i":"as"} rakt${u.keys.length>1?"ai":"as"}: ${O(u.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=i[u.origin]??u.origin;return`${sr(n??u.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function jg(){return{localeError:Rw()}}s(jg,"md"),o(jg,"default");var Tw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${u.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${n}${u.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 ${u.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0438\u043C\u0430 ${n}${u.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${u.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`Invalid ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`${u.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"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${u.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 ${u.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function zg(){return{localeError:Tw()}}s(zg,"hd"),o(zg,"default");var Pw=o(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"nombor"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Input tidak sah: dijangka instanceof ${u.expected}, diterima ${l}`:`Input tidak sah: dijangka ${n}, diterima ${l}`}case"invalid_value":return u.values.length===1?`Input tidak sah: dijangka ${J(u.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Terlalu besar: dijangka ${u.origin??"nilai"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${u.origin??"nilai"} adalah ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Terlalu kecil: dijangka ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${u.origin} adalah ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`String tidak sah: mesti bermula dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak sah: mesti mengandungi "${n.includes}"`:n.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${n.pattern}`:`${r[n.format]??u.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(u.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${u.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${u.origin}`;default:return"Input tidak sah"}}},"error");function Ng(){return{localeError:Pw()}}s(Ng,"gd"),o(Ng,"default");var Uw=o(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"getal"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ongeldige invoer: verwacht instanceof ${u.expected}, ontving ${l}`:`Ongeldige invoer: verwacht ${n}, ontving ${l}`}case"invalid_value":return u.values.length===1?`Ongeldige invoer: verwacht ${J(u.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin),l=u.origin==="date"?"laat":u.origin==="string"?"lang":"groot";return a?`Te ${l}: verwacht dat ${u.origin??"waarde"} ${n}${u.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin??"waarde"} ${n}${u.maximum.toString()} is`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin),l=u.origin==="date"?"vroeg":u.origin==="string"?"kort":"klein";return a?`Te ${l}: verwacht dat ${u.origin} ${n}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${l}: verwacht dat ${u.origin} ${n}${u.minimum.toString()} is`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ongeldige tekst: moet met "${n.prefix}" beginnen`:n.format==="ends_with"?`Ongeldige tekst: moet op "${n.suffix}" eindigen`:n.format==="includes"?`Ongeldige tekst: moet "${n.includes}" bevatten`:n.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`:`Ongeldig: ${r[n.format]??u.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${u.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${u.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${u.origin}`;default:return"Ongeldige invoer"}}},"error");function Mg(){return{localeError:Uw()}}s(Mg,"vd"),o(Mg,"default");var qw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"tall",array:"liste"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ugyldig input: forventet instanceof ${u.expected}, fikk ${l}`:`Ugyldig input: forventet ${n}, fikk ${l}`}case"invalid_value":return u.values.length===1?`Ugyldig verdi: forventet ${J(u.values[0])}`:`Ugyldig valg: forventet en av ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${n}${u.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${u.origin??"value"} til \xE5 ha ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`For lite(n): forventet ${u.origin} til \xE5 ha ${n}${u.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${u.origin} til \xE5 ha ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${r[n.format]??u.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${u.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${u.origin}`;default:return"Ugyldig input"}}},"error");function Og(){return{localeError:qw()}}s(Og,"yd"),o(Og,"default");var Zw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`F\xE2sit giren: umulan instanceof ${u.expected}, al\u0131nan ${l}`:`F\xE2sit giren: umulan ${n}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`F\xE2sit giren: umulan ${J(u.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${n}${u.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${u.origin??"value"}, ${n}${u.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${n}${u.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${u.origin}, ${n}${u.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let n=u;return n.format==="starts_with"?`F\xE2sit metin: "${n.prefix}" ile ba\u015Flamal\u0131.`:n.format==="ends_with"?`F\xE2sit metin: "${n.suffix}" ile bitmeli.`:n.format==="includes"?`F\xE2sit metin: "${n.includes}" ihtiv\xE2 etmeli.`:n.format==="regex"?`F\xE2sit metin: ${n.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[n.format]??u.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${u.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${u.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function Rg(){return{localeError:Zw()}}s(Rg,"bd"),o(Rg,"default");var Lw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${u.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${l} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return u.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${J(u.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${O(u.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${u.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${u.maximum.toString()} \u0648\u064A`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${u.origin} \u0628\u0627\u06CC\u062F ${n}${u.minimum.toString()} \u0648\u064A`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:n.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:n.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${n.includes}" \u0648\u0644\u0631\u064A`:n.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${n.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[n.format]??u.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${u.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${u.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${O(u.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${u.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 ${u.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function Tg(){return{localeError:Lw()}}s(Tg,"wd"),o(Tg,"default");var Vw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"liczba",array:"tablica"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${u.expected}, otrzymano ${l}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n}, otrzymano ${l}`}case"invalid_value":return u.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${J(u.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${u.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${u.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${u.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${n.prefix}"`:n.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${n.suffix}"`:n.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${n.includes}"`:n.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${n.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[n.format]??u.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${u.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${u.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${u.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function Pg(){return{localeError:Vw()}}s(Pg,"xd"),o(Pg,"default");var Jw=o(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Tipo inv\xE1lido: esperado instanceof ${u.expected}, recebido ${l}`:`Tipo inv\xE1lido: esperado ${n}, recebido ${l}`}case"invalid_value":return u.values.length===1?`Entrada inv\xE1lida: esperado ${J(u.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Muito grande: esperado que ${u.origin??"valor"} tivesse ${n}${u.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${u.origin??"valor"} fosse ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Muito pequeno: esperado que ${u.origin} tivesse ${n}${u.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${u.origin} fosse ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${n.prefix}"`:n.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${n.suffix}"`:n.format==="includes"?`Texto inv\xE1lido: deve incluir "${n.includes}"`:n.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${n.pattern}`:`${r[n.format]??u.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${u.divisor}`;case"unrecognized_keys":return`Chave${u.keys.length>1?"s":""} desconhecida${u.keys.length>1?"s":""}: ${O(u.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${u.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${u.origin}`;default:return"Campo inv\xE1lido"}}},"error");function Ug(){return{localeError:Jw()}}s(Ug,"$d"),o(Ug,"default");var Ww=o(()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${n}, primit ${l}`}case"invalid_value":return u.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${J(u.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${u.origin??"valoarea"} s\u0103 fie ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Prea mic: a\u0219teptat ca ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${u.origin} s\u0103 fie ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${n.prefix}"`:n.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${n.suffix}"`:n.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${n.includes}"`:n.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${n.pattern}`:`Format invalid: ${r[n.format]??u.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${u.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${O(u.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${u.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${u.origin}`;default:return"Intrare invalid\u0103"}}},"error");function qg(){return{localeError:Ww()}}s(qg,"_d"),o(qg,"default");function Bo(e,t,r,i){let u=Math.abs(e),n=u%10,a=u%100;return a>=11&&a<=19?i:n===1?t:n>=2&&n<=4?r:i}s(Bo,"Cw"),o(Bo,"getRussianPlural");var Gw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${u.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${l}`}case"invalid_value":return u.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);if(a){let l=Number(u.maximum),d=Bo(l,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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${u.maximum.toString()} ${d}`}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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);if(a){let l=Number(u.minimum),d=Bo(l,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 ${u.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${u.minimum.toString()} ${d}`}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 ${u.origin} \u0431\u0443\u0434\u0435\u0442 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${u.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0438":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${u.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 ${u.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function Zg(){return{localeError:Gw()}}s(Zg,"kd"),o(Zg,"default");var Kw=o(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${u.expected}, prejeto ${l}`:`Neveljaven vnos: pri\u010Dakovano ${n}, prejeto ${l}`}case"invalid_value":return u.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${J(u.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} imelo ${n}${u.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${u.origin??"vrednost"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${u.origin} imelo ${n}${u.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${n.prefix}"`:n.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${n.suffix}"`:n.format==="includes"?`Neveljaven niz: mora vsebovati "${n.includes}"`:n.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`:`Neveljaven ${r[n.format]??u.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${u.divisor}`;case"unrecognized_keys":return`Neprepoznan${u.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${O(u.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${u.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${u.origin}`;default:return"Neveljaven vnos"}}},"error");function Lg(){return{localeError:Kw()}}s(Lg,"Sd"),o(Lg,"default");var Hw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"antal",array:"lista"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${u.expected}, fick ${l}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${n}, fick ${l}`}case"invalid_value":return u.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${J(u.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${u.origin??"v\xE4rdet"} att ha ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${u.origin??"v\xE4rdet"} att ha ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${n.prefix}"`:n.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${n.suffix}"`:n.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${n.includes}"`:n.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${n.pattern}"`:`Ogiltig(t) ${r[n.format]??u.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${O(u.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${u.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${u.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function Vg(){return{localeError:Hw()}}s(Vg,"Id"),o(Vg,"default");var Xw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`:`\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}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${u.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 ${u.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${u.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.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 ${u.origin} ${n}${u.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 ${u.origin} ${n}${u.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${n.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[n.format]??u.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${u.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${u.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.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`${u.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"}}},"error");function Jg(){return{localeError:Xw()}}s(Jg,"Rd"),o(Jg,"default");var Yw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`:`\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} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${l}`}case"invalid_value":return u.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(u.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${u.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:n.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 ${n.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[n.format]??u.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 ${u.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: ${O(u.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${u.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 ${u.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function Wg(){return{localeError:Yw()}}s(Wg,"Ed"),o(Wg,"default");var Qw=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${u.expected}, al\u0131nan ${l}`:`Ge\xE7ersiz de\u011Fer: beklenen ${n}, al\u0131nan ${l}`}case"invalid_value":return u.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${J(u.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${n}${u.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${u.origin??"de\u011Fer"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;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 ${r[n.format]??u.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${u.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${u.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function Gg(){return{localeError:Qw()}}s(Gg,"Td"),o(Gg,"default");var eD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\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 instanceof ${u.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`:`\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}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${l}`}case"invalid_value":return u.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 ${J(u.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 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${n}${u.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 ${u.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.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 ${u.origin} ${a.verb} ${n}${u.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 ${u.origin} \u0431\u0443\u0434\u0435 ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${u.keys.length>1?"\u0456":""}: ${O(u.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${u.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 ${u.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function xo(){return{localeError:eD()}}s(xo,"Zn"),o(xo,"default");function Kg(){return xo()}s(Kg,"Ad"),o(Kg,"default");var tD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${u.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${l} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return u.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${J(u.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${O(u.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${n}${u.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: ${u.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${n}${u.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u06D2 ${n}${u.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${u.origin} \u06A9\u0627 ${n}${u.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${n.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${u.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${u.keys.length>1?"\u0632":""}: ${O(u.keys,"\u060C ")}`;case"invalid_key":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${u.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function Hg(){return{localeError:tD()}}s(Hg,"jd"),o(Hg,"default");var uD=o(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${u.expected}, qabul qilingan ${l}`:`Noto\u2018g\u2018ri kirish: kutilgan ${n}, qabul qilingan ${l}`}case"invalid_value":return u.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${J(u.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Juda katta: kutilgan ${u.origin??"qiymat"} ${n}${u.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${u.origin??"qiymat"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Juda kichik: kutilgan ${u.origin} ${n}${u.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${n.prefix}" bilan boshlanishi kerak`:n.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${n.suffix}" bilan tugashi kerak`:n.format==="includes"?`Noto\u2018g\u2018ri satr: "${n.includes}" ni o\u2018z ichiga olishi kerak`:n.format==="regex"?`Noto\u2018g\u2018ri satr: ${n.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[n.format]??u.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${u.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${u.keys.length>1?"lar":""}: ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${u.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function Xg(){return{localeError:uD()}}s(Xg,"zd"),o(Xg,"default");var rD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${u.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n}, nh\u1EADn \u0111\u01B0\u1EE3c ${l}`}case"invalid_value":return u.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${J(u.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${n}${u.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${u.origin??"gi\xE1 tr\u1ECB"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${a.verb} ${n}${u.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${n.prefix}"`:n.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${n.suffix}"`:n.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${n.includes}"`:n.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${n.pattern}`:`${r[n.format]??u.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 ${u.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${O(u.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${u.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 ${u.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function Yg(){return{localeError:rD()}}s(Yg,"Od"),o(Yg,"default");var iD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${u.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n}\uFF0C\u5B9E\u9645\u63A5\u6536 ${l}`}case"invalid_value":return u.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${J(u.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${n}${u.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${u.origin??"\u503C"} ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${n}${u.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${u.origin} ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.prefix}" \u5F00\u5934`:n.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.suffix}" \u7ED3\u5C3E`:n.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${n.pattern}`:`\u65E0\u6548${r[n.format]??u.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${u.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${O(u.keys,", ")}`;case"invalid_key":return`${u.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${u.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function Qg(){return{localeError:iD()}}s(Qg,"Md"),o(Qg,"default");var nD=o(()=>{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(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let 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"},i={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${u.expected}\uFF0C\u4F46\u6536\u5230 ${l}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n}\uFF0C\u4F46\u6536\u5230 ${l}`}case"invalid_value":return u.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${J(u.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${n}${u.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${u.origin??"\u503C"} \u61C9\u70BA ${n}${u.maximum.toString()}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${n}${u.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${u.origin} \u61C9\u70BA ${n}${u.minimum.toString()}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.prefix}" \u958B\u982D`:n.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.suffix}" \u7D50\u5C3E`:n.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${n.pattern}`:`\u7121\u6548\u7684 ${r[n.format]??u.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${u.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${u.keys.length>1?"\u5011":""}\uFF1A${O(u.keys,"\u3001")}`;case"invalid_key":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${u.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function ev(){return{localeError:nD()}}s(ev,"Nd"),o(ev,"default");var sD=o(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(u){return e[u]??null}s(t,"t"),o(t,"getSizing");let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return u=>{switch(u.code){case"invalid_type":{let n=i[u.expected]??u.expected,a=G(u.input),l=i[a]??a;return/^[A-Z]/.test(u.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${u.expected}, \xE0m\u1ECD\u0300 a r\xED ${l}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n}, \xE0m\u1ECD\u0300 a r\xED ${l}`}case"invalid_value":return u.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${J(u.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${O(u.values,"|")}`;case"too_big":{let n=u.inclusive?"<=":"<",a=t(u.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin??"iye"} ${a.verb} ${n}${u.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${u.maximum}`}case"too_small":{let n=u.inclusive?">=":">",a=t(u.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${u.origin} ${a.verb} ${n}${u.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${u.minimum}`}case"invalid_format":{let n=u;return n.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${n.prefix}"`:n.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${n.suffix}"`:n.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${n.includes}"`:n.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${n.pattern}`:`A\u1E63\xEC\u1E63e: ${r[n.format]??u.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${u.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${O(u.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${u.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function tv(){return{localeError:sD()}}s(tv,"Pd"),o(tv,"default");var uv,rv=Symbol("ZodOutput"),iv=Symbol("ZodInput"),nv=class{static{s(this,"zi")}static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ni(){return new nv}s(Ni,"Oi"),o(Ni,"registry"),(uv=globalThis).__zod_globalRegistry??(uv.__zod_globalRegistry=Ni());var Re=globalThis.__zod_globalRegistry;function Co(e,t){return new e({type:"string",...T(t)})}s(Co,"Ud"),o(Co,"_string");function ko(e,t){return new e({type:"string",coerce:!0,...T(t)})}s(ko,"Ld"),o(ko,"_coercedString");function Mi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}s(Mi,"Mi"),o(Mi,"_email");function ar(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}s(ar,"Vn"),o(ar,"_guid");function Oi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}s(Oi,"Ni"),o(Oi,"_uuid");function Ri(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}s(Ri,"Pi"),o(Ri,"_uuidv4");function Ti(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}s(Ti,"Di"),o(Ti,"_uuidv6");function Pi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}s(Pi,"Ci"),o(Pi,"_uuidv7");function or(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}s(or,"Gn"),o(or,"_url");function Ui(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}s(Ui,"Ui"),o(Ui,"_emoji");function qi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}s(qi,"Li"),o(qi,"_nanoid");function Zi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}s(Zi,"Fi"),o(Zi,"_cuid");function Li(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}s(Li,"Bi"),o(Li,"_cuid2");function Vi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}s(Vi,"Zi"),o(Vi,"_ulid");function Ji(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}s(Ji,"qi"),o(Ji,"_xid");function Wi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}s(Wi,"Vi"),o(Wi,"_ksuid");function Gi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}s(Gi,"Gi"),o(Gi,"_ipv4");function Ki(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}s(Ki,"Ji"),o(Ki,"_ipv6");function Ao(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}s(Ao,"Fd"),o(Ao,"_mac");function Hi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}s(Hi,"Wi"),o(Hi,"_cidrv4");function Xi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}s(Xi,"Ki"),o(Xi,"_cidrv6");function Yi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}s(Yi,"Xi"),o(Yi,"_base64");function Qi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}s(Qi,"Hi"),o(Qi,"_base64url");function en(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}s(en,"Yi"),o(en,"_e164");function tn(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}s(tn,"Qi"),o(tn,"_jwt");var sv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Io(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}s(Io,"Zd"),o(Io,"_isoDateTime");function _o(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}s(_o,"qd"),o(_o,"_isoDate");function So(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}s(So,"Vd"),o(So,"_isoTime");function Fo(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}s(Fo,"Gd"),o(Fo,"_isoDuration");function jo(e,t){return new e({type:"number",checks:[],...T(t)})}s(jo,"Jd"),o(jo,"_number");function zo(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}s(zo,"Wd"),o(zo,"_coercedNumber");function No(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}s(No,"Kd"),o(No,"_int");function Mo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}s(Mo,"Xd"),o(Mo,"_float32");function Oo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}s(Oo,"Hd"),o(Oo,"_float64");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}s(Ro,"Yd"),o(Ro,"_int32");function To(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}s(To,"Qd"),o(To,"_uint32");function Po(e,t){return new e({type:"boolean",...T(t)})}s(Po,"ep"),o(Po,"_boolean");function Uo(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}s(Uo,"tp"),o(Uo,"_coercedBoolean");function qo(e,t){return new e({type:"bigint",...T(t)})}s(qo,"rp"),o(qo,"_bigint");function Zo(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}s(Zo,"np"),o(Zo,"_coercedBigint");function Lo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}s(Lo,"op"),o(Lo,"_int64");function Vo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}s(Vo,"ip"),o(Vo,"_uint64");function Jo(e,t){return new e({type:"symbol",...T(t)})}s(Jo,"sp"),o(Jo,"_symbol");function Wo(e,t){return new e({type:"undefined",...T(t)})}s(Wo,"ap"),o(Wo,"_undefined");function Go(e,t){return new e({type:"null",...T(t)})}s(Go,"cp"),o(Go,"_null");function Ko(e){return new e({type:"any"})}s(Ko,"up"),o(Ko,"_any");function Ho(e){return new e({type:"unknown"})}s(Ho,"lp"),o(Ho,"_unknown");function Xo(e,t){return new e({type:"never",...T(t)})}s(Xo,"dp"),o(Xo,"_never");function Yo(e,t){return new e({type:"void",...T(t)})}s(Yo,"pp"),o(Yo,"_void");function Qo(e,t){return new e({type:"date",...T(t)})}s(Qo,"fp"),o(Qo,"_date");function e0(e,t){return new e({type:"date",coerce:!0,...T(t)})}s(e0,"mp"),o(e0,"_coercedDate");function t0(e,t){return new e({type:"nan",...T(t)})}s(t0,"hp"),o(t0,"_nan");function it(e,t){return new Za({check:"less_than",...T(t),value:e,inclusive:!1})}s(it,"st"),o(it,"_lt");function ze(e,t){return new Za({check:"less_than",...T(t),value:e,inclusive:!0})}s(ze,"Ze"),o(ze,"_lte");function nt(e,t){return new La({check:"greater_than",...T(t),value:e,inclusive:!1})}s(nt,"at"),o(nt,"_gt");function Ce(e,t){return new La({check:"greater_than",...T(t),value:e,inclusive:!0})}s(Ce,"je"),o(Ce,"_gte");function un(e){return nt(0,e)}s(un,"es"),o(un,"_positive");function rn(e){return it(0,e)}s(rn,"ts"),o(rn,"_negative");function nn(e){return ze(0,e)}s(nn,"rs"),o(nn,"_nonpositive");function sn(e){return Ce(0,e)}s(sn,"ns"),o(sn,"_nonnegative");function Nt(e,t){return new Ff({check:"multiple_of",...T(t),value:e})}s(Nt,"At"),o(Nt,"_multipleOf");function Mt(e,t){return new Nf({check:"max_size",...T(t),maximum:e})}s(Mt,"jt"),o(Mt,"_maxSize");function st(e,t){return new Mf({check:"min_size",...T(t),minimum:e})}s(st,"ct"),o(st,"_minSize");function au(e,t){return new Of({check:"size_equals",...T(t),size:e})}s(au,"tr"),o(au,"_size");function ou(e,t){return new Rf({check:"max_length",...T(t),maximum:e})}s(ou,"rr"),o(ou,"_maxLength");function ht(e,t){return new Tf({check:"min_length",...T(t),minimum:e})}s(ht,"vt"),o(ht,"_minLength");function lu(e,t){return new Pf({check:"length_equals",...T(t),length:e})}s(lu,"nr"),o(lu,"_length");function lr(e,t){return new Uf({check:"string_format",format:"regex",...T(t),pattern:e})}s(lr,"Tr"),o(lr,"_regex");function dr(e){return new qf({check:"string_format",format:"lowercase",...T(e)})}s(dr,"Ar"),o(dr,"_lowercase");function cr(e){return new Zf({check:"string_format",format:"uppercase",...T(e)})}s(cr,"jr"),o(cr,"_uppercase");function pr(e,t){return new Lf({check:"string_format",format:"includes",...T(t),includes:e})}s(pr,"zr"),o(pr,"_includes");function mr(e,t){return new Vf({check:"string_format",format:"starts_with",...T(t),prefix:e})}s(mr,"Or"),o(mr,"_startsWith");function fr(e,t){return new Jf({check:"string_format",format:"ends_with",...T(t),suffix:e})}s(fr,"Mr"),o(fr,"_endsWith");function an(e,t,r){return new Wf({check:"property",property:e,schema:t,...T(r)})}s(an,"os"),o(an,"_property");function hr(e,t){return new Gf({check:"mime_type",mime:e,...T(t)})}s(hr,"Nr"),o(hr,"_mime");function Ke(e){return new Kf({check:"overwrite",tx:e})}s(Ke,"et"),o(Ke,"_overwrite");function gr(e){return Ke(t=>t.normalize(e))}s(gr,"Pr"),o(gr,"_normalize");function vr(){return Ke(e=>e.trim())}s(vr,"Dr"),o(vr,"_trim");function yr(){return Ke(e=>e.toLowerCase())}s(yr,"Cr"),o(yr,"_toLowerCase");function Er(){return Ke(e=>e.toUpperCase())}s(Er,"Ur"),o(Er,"_toUpperCase");function br(){return Ke(e=>ga(e))}s(br,"Lr"),o(br,"_slugify");function u0(e,t,r){return new e({type:"array",element:t,...T(r)})}s(u0,"gp"),o(u0,"_array");function av(e,t,r){return new e({type:"union",options:t,...T(r)})}s(av,"uR"),o(av,"_union");function ov(e,t,r){return new e({type:"union",options:t,inclusive:!1,...T(r)})}s(ov,"lR"),o(ov,"_xor");function lv(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...T(i)})}s(lv,"dR"),o(lv,"_discriminatedUnion");function dv(e,t,r){return new e({type:"intersection",left:t,right:r})}s(dv,"pR"),o(dv,"_intersection");function cv(e,t,r,i){let u=r instanceof X,n=u?i:r,a=u?r:null;return new e({type:"tuple",items:t,rest:a,...T(n)})}s(cv,"fR"),o(cv,"_tuple");function pv(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...T(i)})}s(pv,"mR"),o(pv,"_record");function mv(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...T(i)})}s(mv,"hR"),o(mv,"_map");function fv(e,t,r){return new e({type:"set",valueType:t,...T(r)})}s(fv,"gR"),o(fv,"_set");function hv(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(u=>[u,u])):t;return new e({type:"enum",entries:i,...T(r)})}s(hv,"vR"),o(hv,"_enum");function gv(e,t,r){return new e({type:"enum",entries:t,...T(r)})}s(gv,"yR"),o(gv,"_nativeEnum");function vv(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(r)})}s(vv,"bR"),o(vv,"_literal");function r0(e,t){return new e({type:"file",...T(t)})}s(r0,"vp"),o(r0,"_file");function yv(e,t){return new e({type:"transform",transform:t})}s(yv,"wR"),o(yv,"_transform");function Ev(e,t){return new e({type:"optional",innerType:t})}s(Ev,"xR"),o(Ev,"_optional");function bv(e,t){return new e({type:"nullable",innerType:t})}s(bv,"$R"),o(bv,"_nullable");function wv(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ya(r)}})}s(wv,"_R"),o(wv,"_default");function Dv(e,t,r){return new e({type:"nonoptional",innerType:t,...T(r)})}s(Dv,"kR"),o(Dv,"_nonoptional");function $v(e,t){return new e({type:"success",innerType:t})}s($v,"SR"),o($v,"_success");function Bv(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}s(Bv,"IR"),o(Bv,"_catch");function xv(e,t,r){return new e({type:"pipe",in:t,out:r})}s(xv,"RR"),o(xv,"_pipe");function Cv(e,t){return new e({type:"readonly",innerType:t})}s(Cv,"ER"),o(Cv,"_readonly");function kv(e,t,r){return new e({type:"template_literal",parts:t,...T(r)})}s(kv,"TR"),o(kv,"_templateLiteral");function Av(e,t){return new e({type:"lazy",getter:t})}s(Av,"AR"),o(Av,"_lazy");function Iv(e,t){return new e({type:"promise",innerType:t})}s(Iv,"jR"),o(Iv,"_promise");function i0(e,t,r){let i=T(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}s(i0,"yp"),o(i0,"_custom");function n0(e,t,r){return new e({type:"custom",check:"custom",fn:t,...T(r)})}s(n0,"bp"),o(n0,"_refine");function s0(e,t){let r=a0(i=>(i.addIssue=u=>{if(typeof u=="string")i.issues.push(Ku(u,i.value,r._zod.def));else{let n=u;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=r),n.continue??(n.continue=!r._zod.def.abort),i.issues.push(Ku(n))}},e(i.value,i)),t);return r}s(s0,"wp"),o(s0,"_superRefine");function a0(e,t){let r=new de({check:"custom",...T(t)});return r._zod.check=e,r}s(a0,"Lw"),o(a0,"_check");function o0(e){let t=new de({check:"describe"});return t._zod.onattach=[r=>{let i=Re.get(r)??{};Re.add(r,{...i,description:e})}],t._zod.check=()=>{},t}s(o0,"xp"),o(o0,"describe");function l0(e){let t=new de({check:"meta"});return t._zod.onattach=[r=>{let i=Re.get(r)??{};Re.add(r,{...i,...e})}],t._zod.check=()=>{},t}s(l0,"$p"),o(l0,"meta");function d0(e,t){let r=T(t),i=r.truthy??["true","1","yes","on","y","enabled"],u=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),u=u.map(h=>typeof h=="string"?h.toLowerCase():h));let n=new Set(i),a=new Set(u),l=e.Codec??ho,d=e.Boolean??Ka,c=e.String??tr,p=new c({type:"string",error:r.error}),m=new d({type:"boolean",error:r.error}),f=new l({type:"pipe",in:p,out:m,transform:o(((h,g)=>{let b=h;return r.case!=="sensitive"&&(b=b.toLowerCase()),n.has(b)?!0:a.has(b)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:g.value,inst:f,continue:!1}),{})}),"transform"),reverseTransform:o(((h,g)=>h===!0?i[0]||"true":u[0]||"false"),"reverseTransform"),error:r.error});return f}s(d0,"_p"),o(d0,"_stringbool");function du(e,t,r,i={}){let u=T(i),n={...T(i),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...u};return r instanceof RegExp&&(n.pattern=r),new e(n)}s(du,"Fr"),o(du,"_stringFormat");function Ot(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}s(Ot,"zt"),o(Ot,"initializeContext");function ie(e,t,r={path:[],schemaPath:[]}){var i;let u=e._zod.def,n=t.seen.get(e);if(n)return n.count++,r.schemaPath.includes(e)&&(n.cycle=r.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{let m=a.schema,f=t.processors[u.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);f(e,t,m,c)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),ie(p,t,c),t.seen.get(p).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&xe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}s(ie,"te"),o(ie,"process");function Rt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let l=e.metadataRegistry.get(a[0])?.id;if(l){let d=i.get(l);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,a[0])}}let u=o(a=>{let l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(h=>h);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${l}/${f}`}}if(a[1]===r)return{ref:"#"};let d=`#/${l}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:d+c}},"makeURI"),n=o(a=>{if(a[1].schema.$ref)return;let l=a[1],{ref:d,defId:c}=u(a);l.def={...l.schema},c&&(l.defId=c);let p=l.schema;for(let m in p)delete p[m];p.$ref=d},"extractToDef");if(e.cycles==="throw")for(let a of e.seen.entries()){let l=a[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
64
64
|
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let l=a[1];if(t===a[0]){n(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(l.cycle){n(a);continue}if(l.count>1&&e.reused==="ref"){n(a);continue}}}s(Rt,"Ot"),o(Rt,"extractDefs");function Tt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=o(l=>{let d=e.seen.get(l);if(d.ref===null)return;let c=d.def??d.schema,p={...c},m=d.ref;if(d.ref=null,m){i(m);let h=e.seen.get(m),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,p),l._zod.parent===m)for(let b in c)b==="$ref"||b==="allOf"||b in p||delete c[b];if(g.$ref&&h.def)for(let b in c)b==="$ref"||b==="allOf"||b in h.def&&JSON.stringify(c[b])===JSON.stringify(h.def[b])&&delete c[b]}let f=l._zod.parent;if(f&&f!==m){i(f);let h=e.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(let g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}e.override({zodSchema:l,jsonSchema:c,path:d.path??[]})},"flattenRef");for(let l of[...e.seen.entries()].reverse())i(l[0]);let u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(l)}Object.assign(u,r.def??r.schema);let n=e.metadataRegistry.get(t)?.id;n!==void 0&&u.id===n&&delete u.id;let a=e.external?.defs??{};for(let l of e.seen.entries()){let d=l[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?u.$defs=a:u.definitions=a);try{let l=JSON.parse(JSON.stringify(u));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:wr(t,"input",e.processors),output:wr(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}s(Tt,"Mt"),o(Tt,"finalize");function xe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xe(i.element,r);if(i.type==="set")return xe(i.valueType,r);if(i.type==="lazy")return xe(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return xe(i.innerType,r);if(i.type==="intersection")return xe(i.left,r)||xe(i.right,r);if(i.type==="record"||i.type==="map")return xe(i.keyType,r)||xe(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xe(i.in,r)||xe(i.out,r);if(i.type==="object"){for(let u in i.shape)if(xe(i.shape[u],r))return!0;return!1}if(i.type==="union"){for(let u of i.options)if(xe(u,r))return!0;return!1}if(i.type==="tuple"){for(let u of i.items)if(xe(u,r))return!0;return!!(i.rest&&xe(i.rest,r))}return!1}s(xe,"ze"),o(xe,"isTransforming");var Iv=o((e,t={})=>r=>{let i=Ot({...r,processors:t});return ie(e,i),Rt(i,e),Tt(i,e)},"createToJSONSchemaMethod"),wr=o((e,t,r={})=>i=>{let{libraryOptions:u,target:n}=i??{},a=Ot({...u??{},target:n,io:t,processors:r});return ie(e,a),Rt(a,e),Tt(a,e)},"createStandardJSONSchemaMethod"),sD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_v=o((e,t,r,i)=>{let u=r;u.type="string";let{minimum:n,maximum:a,format:l,patterns:d,contentEncoding:c}=e._zod.bag;if(typeof n=="number"&&(u.minLength=n),typeof a=="number"&&(u.maxLength=a),l&&(u.format=sD[l]??l,u.format===""&&delete u.format,l==="time"&&delete u.format),c&&(u.contentEncoding=c),d&&d.size>0){let p=[...d];p.length===1?u.pattern=p[0].source:p.length>1&&(u.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Sv=o((e,t,r,i)=>{let u=r,{minimum:n,maximum:a,format:l,multipleOf:d,exclusiveMaximum:c,exclusiveMinimum:p}=e._zod.bag;typeof l=="string"&&l.includes("int")?u.type="integer":u.type="number";let m=typeof p=="number"&&p>=(n??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";m?h?(u.minimum=p,u.exclusiveMinimum=!0):u.exclusiveMinimum=p:typeof n=="number"&&(u.minimum=n),f?h?(u.maximum=c,u.exclusiveMaximum=!0):u.exclusiveMaximum=c:typeof a=="number"&&(u.maximum=a),typeof d=="number"&&(u.multipleOf=d)},"numberProcessor"),Fv=o((e,t,r,i)=>{r.type="boolean"},"booleanProcessor"),jv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),zv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Nv=o((e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),Mv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Ov=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Rv=o((e,t,r,i)=>{r.not={}},"neverProcessor"),Tv=o((e,t,r,i)=>{},"anyProcessor"),Pv=o((e,t,r,i)=>{},"unknownProcessor"),Uv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),qv=o((e,t,r,i)=>{let u=e._zod.def,n=ki(u.entries);n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),r.enum=n},"enumProcessor"),Zv=o((e,t,r,i)=>{let u=e._zod.def,n=[];for(let a of u.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),n.every(a=>typeof a=="boolean")&&(r.type="boolean"),n.every(a=>a===null)&&(r.type="null"),r.enum=n},"literalProcessor"),Lv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Vv=o((e,t,r,i)=>{let u=r,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");u.type="string",u.pattern=n.source},"templateLiteralProcessor"),Jv=o((e,t,r,i)=>{let u=r,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:l,mime:d}=e._zod.bag;a!==void 0&&(n.minLength=a),l!==void 0&&(n.maxLength=l),d?d.length===1?(n.contentMediaType=d[0],Object.assign(u,n)):(Object.assign(u,n),u.anyOf=d.map(c=>({contentMediaType:c}))):Object.assign(u,n)},"fileProcessor"),Wv=o((e,t,r,i)=>{r.type="boolean"},"successProcessor"),Gv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),Kv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Hv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),Xv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),Yv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),Qv=o((e,t,r,i)=>{let u=r,n=e._zod.def,{minimum:a,maximum:l}=e._zod.bag;typeof a=="number"&&(u.minItems=a),typeof l=="number"&&(u.maxItems=l),u.type="array",u.items=ie(n.element,t,{...i,path:[...i.path,"items"]})},"arrayProcessor"),e1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="object",u.properties={};let a=n.shape;for(let c in a)u.properties[c]=ie(a[c],t,{...i,path:[...i.path,"properties",c]});let l=new Set(Object.keys(a)),d=new Set([...l].filter(c=>{let p=n.shape[c]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(u.required=Array.from(d)),n.catchall?._zod.def.type==="never"?u.additionalProperties=!1:n.catchall?n.catchall&&(u.additionalProperties=ie(n.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(u.additionalProperties=!1)},"objectProcessor"),c0=o((e,t,r,i)=>{let u=e._zod.def,n=u.inclusive===!1,a=u.options.map((l,d)=>ie(l,t,{...i,path:[...i.path,n?"oneOf":"anyOf",d]}));n?r.oneOf=a:r.anyOf=a},"unionProcessor"),t1=o((e,t,r,i)=>{let u=e._zod.def,n=ie(u.left,t,{...i,path:[...i.path,"allOf",0]}),a=ie(u.right,t,{...i,path:[...i.path,"allOf",1]}),l=o(c=>"allOf"in c&&Object.keys(c).length===1,"isSimpleIntersection"),d=[...l(n)?n.allOf:[n],...l(a)?a.allOf:[a]];r.allOf=d},"intersectionProcessor"),u1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=n.items.map((f,h)=>ie(f,t,{...i,path:[...i.path,a,h]})),c=n.rest?ie(n.rest,t,{...i,path:[...i.path,l,...t.target==="openapi-3.0"?[n.items.length]:[]]}):null;t.target==="draft-2020-12"?(u.prefixItems=d,c&&(u.items=c)):t.target==="openapi-3.0"?(u.items={anyOf:d},c&&u.items.anyOf.push(c),u.minItems=d.length,c||(u.maxItems=d.length)):(u.items=d,c&&(u.additionalItems=c));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(u.minItems=p),typeof m=="number"&&(u.maxItems=m)},"tupleProcessor"),r1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="object";let a=n.keyType,l=a._zod.bag?.patterns;if(n.mode==="loose"&&l&&l.size>0){let c=ie(n.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});u.patternProperties={};for(let p of l)u.patternProperties[p.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(u.propertyNames=ie(n.keyType,t,{...i,path:[...i.path,"propertyNames"]})),u.additionalProperties=ie(n.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let d=a._zod.values;if(d){let c=[...d].filter(p=>typeof p=="string"||typeof p=="number");c.length>0&&(u.required=c)}},"recordProcessor"),i1=o((e,t,r,i)=>{let u=e._zod.def,n=ie(u.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=u.innerType,r.nullable=!0):r.anyOf=[n,{type:"null"}]},"nullableProcessor"),n1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"nonoptionalProcessor"),s1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,r.default=JSON.parse(JSON.stringify(u.defaultValue))},"defaultProcessor"),a1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},"prefaultProcessor"),o1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType;let a;try{a=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},"catchProcessor"),l1=o((e,t,r,i)=>{let u=e._zod.def,n=u.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?n?u.out:u.in:u.out;ie(a,t,i);let l=t.seen.get(e);l.ref=a},"pipeProcessor"),d1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,r.readOnly=!0},"readonlyProcessor"),c1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"promiseProcessor"),p0=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"optionalProcessor"),p1=o((e,t,r,i)=>{let u=e._zod.innerType;ie(u,t,i);let n=t.seen.get(e);n.ref=u},"lazyProcessor"),m0={string:_v,number:Sv,boolean:Fv,bigint:jv,symbol:zv,null:Nv,undefined:Mv,void:Ov,never:Rv,any:Tv,unknown:Pv,date:Uv,enum:qv,literal:Zv,nan:Lv,template_literal:Vv,file:Jv,success:Wv,custom:Gv,function:Kv,transform:Hv,map:Xv,set:Yv,array:Qv,object:e1,union:c0,intersection:t1,tuple:u1,record:r1,nullable:i1,nonoptional:n1,default:s1,prefault:a1,catch:o1,pipe:l1,readonly:d1,promise:c1,optional:p0,lazy:p1};function f0(e,t){if("_idmap"in e){let i=e,u=Ot({...t,processors:m0}),n={};for(let d of i._idmap.entries()){let[c,p]=d;ie(p,u)}let a={},l={registry:i,uri:t?.uri,defs:n};u.external=l;for(let d of i._idmap.entries()){let[c,p]=d;Rt(u,p),a[c]=Tt(u,p)}if(Object.keys(n).length>0){let d=u.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:n}}return{schemas:a}}let r=Ot({...t,processors:m0});return ie(e,r),Rt(r,e),Tt(r,e)}s(f0,"cs"),o(f0,"toJSONSchema");var aD=class{static{s(this,"us")}static{o(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Ot({processors:m0,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return ie(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Rt(this.ctx,e);let r=Tt(this.ctx,e),{"~standard":i,...u}=r;return u}},oD={},m1={};ut(m1,{ZodAny:s(()=>cl,"ZodAny"),ZodArray:s(()=>yl,"ZodArray"),ZodBase64:s(()=>wn,"ZodBase64"),ZodBase64URL:s(()=>Dn,"ZodBase64URL"),ZodBigInt:s(()=>Ar,"ZodBigInt"),ZodBigIntFormat:s(()=>kn,"ZodBigIntFormat"),ZodBoolean:s(()=>kr,"ZodBoolean"),ZodCIDRv4:s(()=>En,"ZodCIDRv4"),ZodCIDRv6:s(()=>bn,"ZodCIDRv6"),ZodCUID:s(()=>pn,"ZodCUID"),ZodCUID2:s(()=>mn,"ZodCUID2"),ZodCatch:s(()=>Gl,"ZodCatch"),ZodCodec:s(()=>Or,"ZodCodec"),ZodCustom:s(()=>Tr,"ZodCustom"),ZodCustomStringFormat:s(()=>mu,"ZodCustomStringFormat"),ZodDate:s(()=>In,"ZodDate"),ZodDefault:s(()=>Ll,"ZodDefault"),ZodDiscriminatedUnion:s(()=>xl,"ZodDiscriminatedUnion"),ZodE164:s(()=>$n,"ZodE164"),ZodEmail:s(()=>ln,"ZodEmail"),ZodEmoji:s(()=>dn,"ZodEmoji"),ZodEnum:s(()=>gu,"ZodEnum"),ZodExactOptional:s(()=>Ul,"ZodExactOptional"),ZodFile:s(()=>Rl,"ZodFile"),ZodFunction:s(()=>sd,"ZodFunction"),ZodGUID:s(()=>$r,"ZodGUID"),ZodIPv4:s(()=>vn,"ZodIPv4"),ZodIPv6:s(()=>yn,"ZodIPv6"),ZodIntersection:s(()=>kl,"ZodIntersection"),ZodJWT:s(()=>Bn,"ZodJWT"),ZodKSUID:s(()=>gn,"ZodKSUID"),ZodLazy:s(()=>rd,"ZodLazy"),ZodLiteral:s(()=>Ml,"ZodLiteral"),ZodMAC:s(()=>P0,"ZodMAC"),ZodMap:s(()=>Sl,"ZodMap"),ZodNaN:s(()=>Kl,"ZodNaN"),ZodNanoID:s(()=>cn,"ZodNanoID"),ZodNever:s(()=>fl,"ZodNever"),ZodNonOptional:s(()=>On,"ZodNonOptional"),ZodNull:s(()=>dl,"ZodNull"),ZodNullable:s(()=>ql,"ZodNullable"),ZodNumber:s(()=>xr,"ZodNumber"),ZodNumberFormat:s(()=>Pt,"ZodNumberFormat"),ZodObject:s(()=>_r,"ZodObject"),ZodOptional:s(()=>jn,"ZodOptional"),ZodPipe:s(()=>Nr,"ZodPipe"),ZodPrefault:s(()=>Vl,"ZodPrefault"),ZodPreprocess:s(()=>Ql,"ZodPreprocess"),ZodPromise:s(()=>id,"ZodPromise"),ZodReadonly:s(()=>ed,"ZodReadonly"),ZodRecord:s(()=>hu,"ZodRecord"),ZodSet:s(()=>jl,"ZodSet"),ZodString:s(()=>Dr,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>Jl,"ZodSuccess"),ZodSymbol:s(()=>sl,"ZodSymbol"),ZodTemplateLiteral:s(()=>td,"ZodTemplateLiteral"),ZodTransform:s(()=>Pl,"ZodTransform"),ZodTuple:s(()=>Al,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>fn,"ZodULID"),ZodURL:s(()=>Br,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>ol,"ZodUndefined"),ZodUnion:s(()=>Sr,"ZodUnion"),ZodUnknown:s(()=>ml,"ZodUnknown"),ZodVoid:s(()=>hl,"ZodVoid"),ZodXID:s(()=>hn,"ZodXID"),ZodXor:s(()=>$l,"ZodXor"),_ZodString:s(()=>on,"_ZodString"),_default:s(()=>Nn,"_default"),_function:s(()=>Rr,"_function"),any:s(()=>pl,"any"),array:s(()=>fu,"array"),base64:s(()=>V0,"base64"),base64url:s(()=>J0,"base64url"),bigint:s(()=>rl,"bigint"),boolean:s(()=>Cn,"boolean"),catch:s(()=>Tn,"catch"),check:s(()=>ad,"check"),cidrv4:s(()=>Z0,"cidrv4"),cidrv6:s(()=>L0,"cidrv6"),codec:s(()=>Xl,"codec"),cuid:s(()=>z0,"cuid"),cuid2:s(()=>N0,"cuid2"),custom:s(()=>od,"custom"),date:s(()=>vl,"date"),describe:s(()=>I1,"describe"),discriminatedUnion:s(()=>Cl,"discriminatedUnion"),e164:s(()=>W0,"e164"),email:s(()=>B0,"email"),emoji:s(()=>F0,"emoji"),enum:s(()=>jr,"enum"),exactOptional:s(()=>zn,"exactOptional"),file:s(()=>Tl,"file"),float32:s(()=>Q0,"float32"),float64:s(()=>el,"float64"),function:s(()=>Rr,"function"),guid:s(()=>x0,"guid"),hash:s(()=>Y0,"hash"),hex:s(()=>X0,"hex"),hostname:s(()=>H0,"hostname"),httpUrl:s(()=>S0,"httpUrl"),instanceof:s(()=>ld,"instanceof"),int:s(()=>Cr,"int"),int32:s(()=>tl,"int32"),int64:s(()=>il,"int64"),intersection:s(()=>_n,"intersection"),invertCodec:s(()=>Yl,"invertCodec"),ipv4:s(()=>T0,"ipv4"),ipv6:s(()=>q0,"ipv6"),json:s(()=>dd,"json"),jwt:s(()=>G0,"jwt"),keyof:s(()=>El,"keyof"),ksuid:s(()=>R0,"ksuid"),lazy:s(()=>Un,"lazy"),literal:s(()=>Ol,"literal"),looseObject:s(()=>Dl,"looseObject"),looseRecord:s(()=>_l,"looseRecord"),mac:s(()=>U0,"mac"),map:s(()=>Fl,"map"),meta:s(()=>_1,"meta"),nan:s(()=>Hl,"nan"),nanoid:s(()=>j0,"nanoid"),nativeEnum:s(()=>Nl,"nativeEnum"),never:s(()=>Ir,"never"),nonoptional:s(()=>Rn,"nonoptional"),null:s(()=>An,"null"),nullable:s(()=>yu,"nullable"),nullish:s(()=>Zl,"nullish"),number:s(()=>xn,"number"),object:s(()=>bl,"object"),optional:s(()=>vu,"optional"),partialRecord:s(()=>Il,"partialRecord"),pipe:s(()=>Mr,"pipe"),prefault:s(()=>Mn,"prefault"),preprocess:s(()=>cd,"preprocess"),promise:s(()=>nd,"promise"),readonly:s(()=>Pn,"readonly"),record:s(()=>Fn,"record"),refine:s(()=>qn,"refine"),set:s(()=>zl,"set"),strictObject:s(()=>wl,"strictObject"),string:s(()=>pu,"string"),stringFormat:s(()=>K0,"stringFormat"),stringbool:s(()=>S1,"stringbool"),success:s(()=>Wl,"success"),superRefine:s(()=>Zn,"superRefine"),symbol:s(()=>al,"symbol"),templateLiteral:s(()=>ud,"templateLiteral"),transform:s(()=>zr,"transform"),tuple:s(()=>Sn,"tuple"),uint32:s(()=>ul,"uint32"),uint64:s(()=>nl,"uint64"),ulid:s(()=>M0,"ulid"),undefined:s(()=>ll,"undefined"),union:s(()=>Fr,"union"),unknown:s(()=>gt,"unknown"),url:s(()=>_0,"url"),uuid:s(()=>C0,"uuid"),uuidv4:s(()=>k0,"uuidv4"),uuidv6:s(()=>A0,"uuidv6"),uuidv7:s(()=>I0,"uuidv7"),void:s(()=>gl,"void"),xid:s(()=>O0,"xid"),xor:s(()=>Bl,"xor")});var f1={};ut(f1,{endsWith:s(()=>fr,"endsWith"),gt:s(()=>nt,"gt"),gte:s(()=>Ce,"gte"),includes:s(()=>pr,"includes"),length:s(()=>lu,"length"),lowercase:s(()=>dr,"lowercase"),lt:s(()=>it,"lt"),lte:s(()=>ze,"lte"),maxLength:s(()=>ou,"maxLength"),maxSize:s(()=>Mt,"maxSize"),mime:s(()=>hr,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Nt,"multipleOf"),negative:s(()=>rn,"negative"),nonnegative:s(()=>sn,"nonnegative"),nonpositive:s(()=>nn,"nonpositive"),normalize:s(()=>gr,"normalize"),overwrite:s(()=>Ke,"overwrite"),positive:s(()=>un,"positive"),property:s(()=>an,"property"),regex:s(()=>lr,"regex"),size:s(()=>au,"size"),slugify:s(()=>br,"slugify"),startsWith:s(()=>mr,"startsWith"),toLowerCase:s(()=>yr,"toLowerCase"),toUpperCase:s(()=>Er,"toUpperCase"),trim:s(()=>vr,"trim"),uppercase:s(()=>cr,"uppercase")});var h0={};ut(h0,{ZodISODate:s(()=>y0,"ZodISODate"),ZodISODateTime:s(()=>g0,"ZodISODateTime"),ZodISODuration:s(()=>D0,"ZodISODuration"),ZodISOTime:s(()=>b0,"ZodISOTime"),date:s(()=>E0,"date"),datetime:s(()=>v0,"datetime"),duration:s(()=>$0,"duration"),time:s(()=>w0,"time")});var g0=B("ZodISODateTime",(e,t)=>{oh.init(e,t),ae.init(e,t)});function v0(e){return Io(g0,e)}s(v0,"uf"),o(v0,"datetime");var y0=B("ZodISODate",(e,t)=>{lh.init(e,t),ae.init(e,t)});function E0(e){return _o(y0,e)}s(E0,"lf"),o(E0,"date");var b0=B("ZodISOTime",(e,t)=>{dh.init(e,t),ae.init(e,t)});function w0(e){return So(b0,e)}s(w0,"df"),o(w0,"time");var D0=B("ZodISODuration",(e,t)=>{ch.init(e,t),ae.init(e,t)});function $0(e){return Fo(D0,e)}s($0,"pf"),o($0,"duration");var h1=o((e,t)=>{$a.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o(r=>Si(e,r),"value")},flatten:{value:o(r=>_i(e,r),"value")},addIssue:{value:o(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Vu,2)},"value")},addIssues:{value:o(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Vu,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),lD=B("ZodError",h1),Ne=B("ZodError",h1,{Parent:Error}),g1=Hu(Ne),v1=Xu(Ne),y1=Yu(Ne),E1=Qu(Ne),b1=Ia(Ne),w1=_a(Ne),D1=Sa(Ne),$1=Fa(Ne),B1=ja(Ne),x1=za(Ne),C1=Na(Ne),k1=Ma(Ne),A1=new WeakMap;function cu(e,t,r){let i=Object.getPrototypeOf(e),u=A1.get(i);if(u||(u=new Set,A1.set(i,u)),!u.has(t)){u.add(t);for(let n in r){let a=r[n];Object.defineProperty(i,n,{configurable:!0,enumerable:!1,get(){let l=a.bind(this);return Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}s(cu,"Yn"),o(cu,"_installLazyMethods");var Q=B("ZodType",(e,t)=>(X.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wr(e,"input"),output:wr(e,"output")}}),e.toJSONSchema=Iv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>g1(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>y1(e,r,i),e.parseAsync=async(r,i)=>v1(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>E1(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>b1(e,r,i),e.decode=(r,i)=>w1(e,r,i),e.encodeAsync=async(r,i)=>D1(e,r,i),e.decodeAsync=async(r,i)=>$1(e,r,i),e.safeEncode=(r,i)=>B1(e,r,i),e.safeDecode=(r,i)=>x1(e,r,i),e.safeEncodeAsync=async(r,i)=>C1(e,r,i),e.safeDecodeAsync=async(r,i)=>k1(e,r,i),cu(e,"ZodType",{check(...r){let i=this.def;return this.clone(te.mergeDefs(i,{checks:[...i.checks??[],...r.map(u=>typeof u=="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Se(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(qn(r,i))},superRefine(r,i){return this.check(Zn(r,i))},overwrite(r){return this.check(Ke(r))},optional(){return vu(this)},exactOptional(){return zn(this)},nullable(){return yu(this)},nullish(){return vu(yu(this))},nonoptional(r){return Rn(this,r)},array(){return fu(this)},or(r){return Fr([this,r])},and(r){return _n(this,r)},transform(r){return Mr(this,zr(r))},default(r){return Nn(this,r)},prefault(r){return Mn(this,r)},catch(r){return Tn(this,r)},pipe(r){return Mr(this,r)},readonly(){return Pn(this)},describe(r){let i=this.clone();return Re.add(i,{description:r}),i},meta(...r){if(r.length===0)return Re.get(this);let i=this.clone();return Re.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Re.get(e)?.description},configurable:!0}),e)),on=B("_ZodString",(e,t)=>{tr.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>_v(e,i,u,n);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,cu(e,"_ZodString",{regex(...i){return this.check(lr(...i))},includes(...i){return this.check(pr(...i))},startsWith(...i){return this.check(mr(...i))},endsWith(...i){return this.check(fr(...i))},min(...i){return this.check(ht(...i))},max(...i){return this.check(ou(...i))},length(...i){return this.check(lu(...i))},nonempty(...i){return this.check(ht(1,...i))},lowercase(i){return this.check(dr(i))},uppercase(i){return this.check(cr(i))},trim(){return this.check(vr())},normalize(...i){return this.check(gr(...i))},toLowerCase(){return this.check(yr())},toUpperCase(){return this.check(Er())},slugify(){return this.check(br())}})}),Dr=B("ZodString",(e,t)=>{tr.init(e,t),on.init(e,t),e.email=r=>e.check(Mi(ln,r)),e.url=r=>e.check(or(Br,r)),e.jwt=r=>e.check(tn(Bn,r)),e.emoji=r=>e.check(Ui(dn,r)),e.guid=r=>e.check(ar($r,r)),e.uuid=r=>e.check(Oi(He,r)),e.uuidv4=r=>e.check(Ri(He,r)),e.uuidv6=r=>e.check(Ti(He,r)),e.uuidv7=r=>e.check(Pi(He,r)),e.nanoid=r=>e.check(qi(cn,r)),e.guid=r=>e.check(ar($r,r)),e.cuid=r=>e.check(Zi(pn,r)),e.cuid2=r=>e.check(Li(mn,r)),e.ulid=r=>e.check(Vi(fn,r)),e.base64=r=>e.check(Yi(wn,r)),e.base64url=r=>e.check(Qi(Dn,r)),e.xid=r=>e.check(Ji(hn,r)),e.ksuid=r=>e.check(Wi(gn,r)),e.ipv4=r=>e.check(Gi(vn,r)),e.ipv6=r=>e.check(Ki(yn,r)),e.cidrv4=r=>e.check(Hi(En,r)),e.cidrv6=r=>e.check(Xi(bn,r)),e.e164=r=>e.check(en($n,r)),e.datetime=r=>e.check(v0(r)),e.date=r=>e.check(E0(r)),e.time=r=>e.check(w0(r)),e.duration=r=>e.check($0(r))});function pu(e){return Co(Dr,e)}s(pu,"Wn"),o(pu,"string");var ae=B("ZodStringFormat",(e,t)=>{se.init(e,t),on.init(e,t)}),ln=B("ZodEmail",(e,t)=>{Qf.init(e,t),ae.init(e,t)});function B0(e){return Mi(ln,e)}s(B0,"qw"),o(B0,"email");var $r=B("ZodGUID",(e,t)=>{Xf.init(e,t),ae.init(e,t)});function x0(e){return ar($r,e)}s(x0,"Vw"),o(x0,"guid");var He=B("ZodUUID",(e,t)=>{Yf.init(e,t),ae.init(e,t)});function C0(e){return Oi(He,e)}s(C0,"Gw"),o(C0,"uuid");function k0(e){return Ri(He,e)}s(k0,"Jw"),o(k0,"uuidv4");function A0(e){return Ti(He,e)}s(A0,"Ww"),o(A0,"uuidv6");function I0(e){return Pi(He,e)}s(I0,"Kw"),o(I0,"uuidv7");var Br=B("ZodURL",(e,t)=>{eh.init(e,t),ae.init(e,t)});function _0(e){return or(Br,e)}s(_0,"Xw"),o(_0,"url");function S0(e){return or(Br,{protocol:ft.httpProtocol,hostname:ft.domain,...te.normalizeParams(e)})}s(S0,"Hw"),o(S0,"httpUrl");var dn=B("ZodEmoji",(e,t)=>{th.init(e,t),ae.init(e,t)});function F0(e){return Ui(dn,e)}s(F0,"Yw"),o(F0,"emoji");var cn=B("ZodNanoID",(e,t)=>{uh.init(e,t),ae.init(e,t)});function j0(e){return qi(cn,e)}s(j0,"Qw"),o(j0,"nanoid");var pn=B("ZodCUID",(e,t)=>{rh.init(e,t),ae.init(e,t)});function z0(e){return Zi(pn,e)}s(z0,"ex"),o(z0,"cuid");var mn=B("ZodCUID2",(e,t)=>{ih.init(e,t),ae.init(e,t)});function N0(e){return Li(mn,e)}s(N0,"tx"),o(N0,"cuid2");var fn=B("ZodULID",(e,t)=>{nh.init(e,t),ae.init(e,t)});function M0(e){return Vi(fn,e)}s(M0,"rx"),o(M0,"ulid");var hn=B("ZodXID",(e,t)=>{sh.init(e,t),ae.init(e,t)});function O0(e){return Ji(hn,e)}s(O0,"nx"),o(O0,"xid");var gn=B("ZodKSUID",(e,t)=>{ah.init(e,t),ae.init(e,t)});function R0(e){return Wi(gn,e)}s(R0,"ox"),o(R0,"ksuid");var vn=B("ZodIPv4",(e,t)=>{ph.init(e,t),ae.init(e,t)});function T0(e){return Gi(vn,e)}s(T0,"ix"),o(T0,"ipv4");var P0=B("ZodMAC",(e,t)=>{fh.init(e,t),ae.init(e,t)});function U0(e){return Ao(P0,e)}s(U0,"sx"),o(U0,"mac");var yn=B("ZodIPv6",(e,t)=>{mh.init(e,t),ae.init(e,t)});function q0(e){return Ki(yn,e)}s(q0,"ax"),o(q0,"ipv6");var En=B("ZodCIDRv4",(e,t)=>{hh.init(e,t),ae.init(e,t)});function Z0(e){return Hi(En,e)}s(Z0,"cx"),o(Z0,"cidrv4");var bn=B("ZodCIDRv6",(e,t)=>{gh.init(e,t),ae.init(e,t)});function L0(e){return Xi(bn,e)}s(L0,"ux"),o(L0,"cidrv6");var wn=B("ZodBase64",(e,t)=>{vh.init(e,t),ae.init(e,t)});function V0(e){return Yi(wn,e)}s(V0,"lx"),o(V0,"base64");var Dn=B("ZodBase64URL",(e,t)=>{yh.init(e,t),ae.init(e,t)});function J0(e){return Qi(Dn,e)}s(J0,"dx"),o(J0,"base64url");var $n=B("ZodE164",(e,t)=>{Eh.init(e,t),ae.init(e,t)});function W0(e){return en($n,e)}s(W0,"px"),o(W0,"e164");var Bn=B("ZodJWT",(e,t)=>{bh.init(e,t),ae.init(e,t)});function G0(e){return tn(Bn,e)}s(G0,"fx"),o(G0,"jwt");var mu=B("ZodCustomStringFormat",(e,t)=>{wh.init(e,t),ae.init(e,t)});function K0(e,t,r={}){return du(mu,e,t,r)}s(K0,"mx"),o(K0,"stringFormat");function H0(e){return du(mu,"hostname",ft.hostname,e)}s(H0,"hx"),o(H0,"hostname");function X0(e){return du(mu,"hex",ft.hex,e)}s(X0,"gx"),o(X0,"hex");function Y0(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,u=ft[i];if(!u)throw new Error(`Unrecognized hash format: ${i}`);return du(mu,i,u,t)}s(Y0,"vx"),o(Y0,"hash");var xr=B("ZodNumber",(e,t)=>{Ga.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Sv(e,i,u,n),cu(e,"ZodNumber",{gt(i,u){return this.check(nt(i,u))},gte(i,u){return this.check(Ce(i,u))},min(i,u){return this.check(Ce(i,u))},lt(i,u){return this.check(it(i,u))},lte(i,u){return this.check(ze(i,u))},max(i,u){return this.check(ze(i,u))},int(i){return this.check(Cr(i))},safe(i){return this.check(Cr(i))},positive(i){return this.check(nt(0,i))},nonnegative(i){return this.check(Ce(0,i))},negative(i){return this.check(it(0,i))},nonpositive(i){return this.check(ze(0,i))},multipleOf(i,u){return this.check(Nt(i,u))},step(i,u){return this.check(Nt(i,u))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function xn(e){return jo(xr,e)}s(xn,"If"),o(xn,"number");var Pt=B("ZodNumberFormat",(e,t)=>{Dh.init(e,t),xr.init(e,t)});function Cr(e){return No(Pt,e)}s(Cr,"hs"),o(Cr,"int");function Q0(e){return Mo(Pt,e)}s(Q0,"yx"),o(Q0,"float32");function el(e){return Oo(Pt,e)}s(el,"bx"),o(el,"float64");function tl(e){return Ro(Pt,e)}s(tl,"wx"),o(tl,"int32");function ul(e){return To(Pt,e)}s(ul,"xx"),o(ul,"uint32");var kr=B("ZodBoolean",(e,t)=>{Ka.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Fv(e,r,i,u)});function Cn(e){return Po(kr,e)}s(Cn,"Rf"),o(Cn,"boolean");var Ar=B("ZodBigInt",(e,t)=>{Ha.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>jv(e,i,u,n),e.gte=(i,u)=>e.check(Ce(i,u)),e.min=(i,u)=>e.check(Ce(i,u)),e.gt=(i,u)=>e.check(nt(i,u)),e.gte=(i,u)=>e.check(Ce(i,u)),e.min=(i,u)=>e.check(Ce(i,u)),e.lt=(i,u)=>e.check(it(i,u)),e.lte=(i,u)=>e.check(ze(i,u)),e.max=(i,u)=>e.check(ze(i,u)),e.positive=i=>e.check(nt(BigInt(0),i)),e.negative=i=>e.check(it(BigInt(0),i)),e.nonpositive=i=>e.check(ze(BigInt(0),i)),e.nonnegative=i=>e.check(Ce(BigInt(0),i)),e.multipleOf=(i,u)=>e.check(Nt(i,u));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function rl(e){return qo(Ar,e)}s(rl,"$x"),o(rl,"bigint");var kn=B("ZodBigIntFormat",(e,t)=>{$h.init(e,t),Ar.init(e,t)});function il(e){return Lo(kn,e)}s(il,"_x"),o(il,"int64");function nl(e){return Vo(kn,e)}s(nl,"kx"),o(nl,"uint64");var sl=B("ZodSymbol",(e,t)=>{Bh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>zv(e,r,i,u)});function al(e){return Jo(sl,e)}s(al,"Sx"),o(al,"symbol");var ol=B("ZodUndefined",(e,t)=>{xh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Mv(e,r,i,u)});function ll(e){return Wo(ol,e)}s(ll,"Ix"),o(ll,"_undefined");var dl=B("ZodNull",(e,t)=>{Ch.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Nv(e,r,i,u)});function An(e){return Go(dl,e)}s(An,"jf"),o(An,"_null");var cl=B("ZodAny",(e,t)=>{kh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Tv(e,r,i,u)});function pl(){return Ko(cl)}s(pl,"Rx"),o(pl,"any");var ml=B("ZodUnknown",(e,t)=>{Ah.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Pv(e,r,i,u)});function gt(){return Ho(ml)}s(gt,"or"),o(gt,"unknown");var fl=B("ZodNever",(e,t)=>{Ih.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Rv(e,r,i,u)});function Ir(e){return Xo(fl,e)}s(Ir,"Ns"),o(Ir,"never");var hl=B("ZodVoid",(e,t)=>{_h.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Ov(e,r,i,u)});function gl(e){return Yo(hl,e)}s(gl,"Ex"),o(gl,"_void");var In=B("ZodDate",(e,t)=>{Sh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Uv(e,i,u,n),e.min=(i,u)=>e.check(Ce(i,u)),e.max=(i,u)=>e.check(ze(i,u));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function vl(e){return Qo(In,e)}s(vl,"Tx"),o(vl,"date");var yl=B("ZodArray",(e,t)=>{Fh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Qv(e,r,i,u),e.element=t.element,cu(e,"ZodArray",{min(r,i){return this.check(ht(r,i))},nonempty(r){return this.check(ht(1,r))},max(r,i){return this.check(ou(r,i))},length(r,i){return this.check(lu(r,i))},unwrap(){return this.element}})});function fu(e,t){return u0(yl,e,t)}s(fu,"to"),o(fu,"array");function El(e){let t=e._zod.def.shape;return jr(Object.keys(t))}s(El,"Ax"),o(El,"keyof");var _r=B("ZodObject",(e,t)=>{zh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>e1(e,r,i,u),te.defineLazy(e,"shape",()=>t.shape),cu(e,"ZodObject",{keyof(){return jr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:gt()})},loose(){return this.clone({...this._zod.def,catchall:gt()})},strict(){return this.clone({...this._zod.def,catchall:Ir()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return te.extend(this,r)},safeExtend(r){return te.safeExtend(this,r)},merge(r){return te.merge(this,r)},pick(r){return te.pick(this,r)},omit(r){return te.omit(this,r)},partial(...r){return te.partial(jn,this,r[0])},required(...r){return te.required(On,this,r[0])}})});function bl(e,t){let r={type:"object",shape:e??{},...te.normalizeParams(t)};return new _r(r)}s(bl,"jx"),o(bl,"object");function wl(e,t){return new _r({type:"object",shape:e,catchall:Ir(),...te.normalizeParams(t)})}s(wl,"zx"),o(wl,"strictObject");function Dl(e,t){return new _r({type:"object",shape:e,catchall:gt(),...te.normalizeParams(t)})}s(Dl,"Ox"),o(Dl,"looseObject");var Sr=B("ZodUnion",(e,t)=>{ji.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c0(e,r,i,u),e.options=t.options});function Fr(e,t){return new Sr({type:"union",options:e,...te.normalizeParams(t)})}s(Fr,"Ps"),o(Fr,"union");var $l=B("ZodXor",(e,t)=>{Sr.init(e,t),Nh.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c0(e,r,i,u),e.options=t.options});function Bl(e,t){return new $l({type:"union",options:e,inclusive:!1,...te.normalizeParams(t)})}s(Bl,"Mx"),o(Bl,"xor");var xl=B("ZodDiscriminatedUnion",(e,t)=>{Sr.init(e,t),Mh.init(e,t)});function Cl(e,t,r){return new xl({type:"union",options:t,discriminator:e,...te.normalizeParams(r)})}s(Cl,"Nx"),o(Cl,"discriminatedUnion");var kl=B("ZodIntersection",(e,t)=>{Oh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>t1(e,r,i,u)});function _n(e,t){return new kl({type:"intersection",left:e,right:t})}s(_n,"Lf"),o(_n,"intersection");var Al=B("ZodTuple",(e,t)=>{ro.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>u1(e,r,i,u),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Sn(e,t,r){let i=t instanceof X,u=i?r:t,n=i?t:null;return new Al({type:"tuple",items:e,rest:n,...te.normalizeParams(u)})}s(Sn,"Bf"),o(Sn,"tuple");var hu=B("ZodRecord",(e,t)=>{Rh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>r1(e,r,i,u),e.keyType=t.keyType,e.valueType=t.valueType});function Fn(e,t,r){return!t||!t._zod?new hu({type:"record",keyType:pu(),valueType:e,...te.normalizeParams(t)}):new hu({type:"record",keyType:e,valueType:t,...te.normalizeParams(r)})}s(Fn,"Zf"),o(Fn,"record");function Il(e,t,r){let i=Se(e);return i._zod.values=void 0,new hu({type:"record",keyType:i,valueType:t,...te.normalizeParams(r)})}s(Il,"Px"),o(Il,"partialRecord");function _l(e,t,r){return new hu({type:"record",keyType:e,valueType:t,mode:"loose",...te.normalizeParams(r)})}s(_l,"Dx"),o(_l,"looseRecord");var Sl=B("ZodMap",(e,t)=>{Th.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Xv(e,r,i,u),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Mt(...r)),e.size=(...r)=>e.check(au(...r))});function Fl(e,t,r){return new Sl({type:"map",keyType:e,valueType:t,...te.normalizeParams(r)})}s(Fl,"Cx"),o(Fl,"map");var jl=B("ZodSet",(e,t)=>{Ph.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Yv(e,r,i,u),e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Mt(...r)),e.size=(...r)=>e.check(au(...r))});function zl(e,t){return new jl({type:"set",valueType:e,...te.normalizeParams(t)})}s(zl,"Ux"),o(zl,"set");var gu=B("ZodEnum",(e,t)=>{Uh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>qv(e,i,u,n),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,u)=>{let n={};for(let a of i)if(r.has(a))n[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new gu({...t,checks:[],...te.normalizeParams(u),entries:n})},e.exclude=(i,u)=>{let n={...t.entries};for(let a of i)if(r.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new gu({...t,checks:[],...te.normalizeParams(u),entries:n})}});function jr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new gu({type:"enum",entries:r,...te.normalizeParams(t)})}s(jr,"Ds"),o(jr,"_enum");function Nl(e,t){return new gu({type:"enum",entries:e,...te.normalizeParams(t)})}s(Nl,"Lx"),o(Nl,"nativeEnum");var Ml=B("ZodLiteral",(e,t)=>{qh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Zv(e,r,i,u),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 Ol(e,t){return new Ml({type:"literal",values:Array.isArray(e)?e:[e],...te.normalizeParams(t)})}s(Ol,"Fx"),o(Ol,"literal");var Rl=B("ZodFile",(e,t)=>{Zh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Jv(e,r,i,u),e.min=(r,i)=>e.check(st(r,i)),e.max=(r,i)=>e.check(Mt(r,i)),e.mime=(r,i)=>e.check(hr(Array.isArray(r)?r:[r],i))});function Tl(e){return r0(Rl,e)}s(Tl,"Bx"),o(Tl,"file");var Pl=B("ZodTransform",(e,t)=>{Lh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Hv(e,r,i,u),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ci(e.constructor.name);r.addIssue=n=>{if(typeof n=="string")r.issues.push(te.issue(n,r.value,t));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(te.issue(a))}};let u=t.transform(r.value,r);return u instanceof Promise?u.then(n=>(r.value=n,r.fallback=!0,r)):(r.value=u,r.fallback=!0,r)}});function zr(e){return new Pl({type:"transform",transform:e})}s(zr,"Cs"),o(zr,"transform");var jn=B("ZodOptional",(e,t)=>{co.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p0(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function vu(e){return new jn({type:"optional",innerType:e})}s(vu,"Xn"),o(vu,"optional");var Ul=B("ZodExactOptional",(e,t)=>{Vh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p0(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function zn(e){return new Ul({type:"optional",innerType:e})}s(zn,"Xf"),o(zn,"exactOptional");var ql=B("ZodNullable",(e,t)=>{Jh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>i1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function yu(e){return new ql({type:"nullable",innerType:e})}s(yu,"Hn"),o(yu,"nullable");function Zl(e){return vu(yu(e))}s(Zl,"Zx"),o(Zl,"nullish");var Ll=B("ZodDefault",(e,t)=>{Wh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>s1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nn(e,t){return new Ll({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(Nn,"Qf"),o(Nn,"_default");var Vl=B("ZodPrefault",(e,t)=>{Gh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>a1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Mn(e,t){return new Vl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(Mn,"tm"),o(Mn,"prefault");var On=B("ZodNonOptional",(e,t)=>{Kh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>n1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Rn(e,t){return new On({type:"nonoptional",innerType:e,...te.normalizeParams(t)})}s(Rn,"rm"),o(Rn,"nonoptional");var Jl=B("ZodSuccess",(e,t)=>{Hh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Wv(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Wl(e){return new Jl({type:"success",innerType:e})}s(Wl,"qx"),o(Wl,"success");var Gl=B("ZodCatch",(e,t)=>{Xh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>o1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tn(e,t){return new Gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}s(Tn,"im"),o(Tn,"_catch");var Kl=B("ZodNaN",(e,t)=>{Yh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Lv(e,r,i,u)});function Hl(e){return t0(Kl,e)}s(Hl,"Vx"),o(Hl,"nan");var Nr=B("ZodPipe",(e,t)=>{fo.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>l1(e,r,i,u),e.in=t.in,e.out=t.out});function Mr(e,t){return new Nr({type:"pipe",in:e,out:t})}s(Mr,"gs"),o(Mr,"pipe");var Or=B("ZodCodec",(e,t)=>{Nr.init(e,t),ho.init(e,t)});function Xl(e,t,r){return new Or({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}s(Xl,"Gx"),o(Xl,"codec");function Yl(e){let t=e._zod.def;return new Or({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}s(Yl,"Jx"),o(Yl,"invertCodec");var Ql=B("ZodPreprocess",(e,t)=>{Nr.init(e,t),Qh.init(e,t)}),ed=B("ZodReadonly",(e,t)=>{eg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>d1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Pn(e){return new ed({type:"readonly",innerType:e})}s(Pn,"um"),o(Pn,"readonly");var td=B("ZodTemplateLiteral",(e,t)=>{tg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Vv(e,r,i,u)});function ud(e,t){return new td({type:"template_literal",parts:e,...te.normalizeParams(t)})}s(ud,"Wx"),o(ud,"templateLiteral");var rd=B("ZodLazy",(e,t)=>{ig.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p1(e,r,i,u),e.unwrap=()=>e._zod.def.getter()});function Un(e){return new rd({type:"lazy",getter:e})}s(Un,"pm"),o(Un,"lazy");var id=B("ZodPromise",(e,t)=>{rg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function nd(e){return new id({type:"promise",innerType:e})}s(nd,"Kx"),o(nd,"promise");var sd=B("ZodFunction",(e,t)=>{ug.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Kv(e,r,i,u)});function Rr(e){return new sd({type:"function",input:Array.isArray(e?.input)?Sn(e?.input):e?.input??fu(gt()),output:e?.output??gt()})}s(Rr,"Xx"),o(Rr,"_function");var Tr=B("ZodCustom",(e,t)=>{ng.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Gv(e,r,i,u)});function ad(e){let t=new de({check:"custom"});return t._zod.check=e,t}s(ad,"Hx"),o(ad,"check");function od(e,t){return i0(Tr,e??(()=>!0),t)}s(od,"Yx"),o(od,"custom");function qn(e,t={}){return n0(Tr,e,t)}s(qn,"hm"),o(qn,"refine");function Zn(e,t){return s0(e,t)}s(Zn,"gm"),o(Zn,"superRefine");var I1=o0,_1=l0;function ld(e,t={}){let r=new Tr({type:"custom",check:"custom",fn:o(i=>i instanceof e,"fn"),abort:!0,...te.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}s(ld,"t$"),o(ld,"_instanceof");var S1=o((...e)=>d0({Codec:Or,Boolean:kr,String:Dr},...e),"stringbool");function dd(e){let t=Un(()=>Fr([pu(e),xn(),Cn(),An(),fu(t),Fn(pu(),t)]));return t}s(dd,"n$"),o(dd,"json");function cd(e,t){return new Ql({type:"pipe",in:zr(e),out:t})}s(cd,"o$"),o(cd,"preprocess");var dD={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 F1(e){be({customError:e})}s(F1,"PR"),o(F1,"setErrorMap");function j1(){return be().customError}s(j1,"DR"),o(j1,"getErrorMap");var pd;pd||(pd={});var q={...m1,...f1,iso:h0},cD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function z1(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}s(z1,"UR"),o(z1,"detectVersion");function N1(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let u=r[1];if(!u||!t.defs[u])throw new Error(`Reference not found: ${e}`);return t.defs[u]}throw new Error(`Reference not found: ${e}`)}s(N1,"LR"),o(N1,"resolveRef");function md(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let u=e.$ref;if(t.refs.has(u))return t.refs.get(u);if(t.processing.has(u))return q.lazy(()=>{if(!t.refs.has(u))throw new Error(`Circular reference not resolved: ${u}`);return t.refs.get(u)});t.processing.add(u);let n=N1(u,t),a=$e(n,t);return t.refs.set(u,a),t.processing.delete(u),a}if(e.enum!==void 0){let u=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&u.length===1&&u[0]===null)return q.null();if(u.length===0)return q.never();if(u.length===1)return q.literal(u[0]);if(u.every(a=>typeof a=="string"))return q.enum(u);let n=u.map(a=>q.literal(a));return n.length<2?n[0]:q.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let r=e.type;if(Array.isArray(r)){let u=r.map(n=>{let a={...e,type:n};return md(a,t)});return u.length===0?q.never():u.length===1?u[0]:q.union(u)}if(!r)return q.any();let i;switch(r){case"string":{let u=q.string();if(e.format){let n=e.format;n==="email"?u=u.check(q.email()):n==="uri"||n==="uri-reference"?u=u.check(q.url()):n==="uuid"||n==="guid"?u=u.check(q.uuid()):n==="date-time"?u=u.check(q.iso.datetime()):n==="date"?u=u.check(q.iso.date()):n==="time"?u=u.check(q.iso.time()):n==="duration"?u=u.check(q.iso.duration()):n==="ipv4"?u=u.check(q.ipv4()):n==="ipv6"?u=u.check(q.ipv6()):n==="mac"?u=u.check(q.mac()):n==="cidr"?u=u.check(q.cidrv4()):n==="cidr-v6"?u=u.check(q.cidrv6()):n==="base64"?u=u.check(q.base64()):n==="base64url"?u=u.check(q.base64url()):n==="e164"?u=u.check(q.e164()):n==="jwt"?u=u.check(q.jwt()):n==="emoji"?u=u.check(q.emoji()):n==="nanoid"?u=u.check(q.nanoid()):n==="cuid"?u=u.check(q.cuid()):n==="cuid2"?u=u.check(q.cuid2()):n==="ulid"?u=u.check(q.ulid()):n==="xid"?u=u.check(q.xid()):n==="ksuid"&&(u=u.check(q.ksuid()))}typeof e.minLength=="number"&&(u=u.min(e.minLength)),typeof e.maxLength=="number"&&(u=u.max(e.maxLength)),e.pattern&&(u=u.regex(new RegExp(e.pattern))),i=u;break}case"number":case"integer":{let u=r==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(u=u.min(e.minimum)),typeof e.maximum=="number"&&(u=u.max(e.maximum)),typeof e.exclusiveMinimum=="number"?u=u.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(u=u.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?u=u.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(u=u.lt(e.maximum)),typeof e.multipleOf=="number"&&(u=u.multipleOf(e.multipleOf)),i=u;break}case"boolean":{i=q.boolean();break}case"null":{i=q.null();break}case"object":{let u={},n=e.properties||{},a=new Set(e.required||[]);for(let[d,c]of Object.entries(n)){let p=$e(c,t);u[d]=a.has(d)?p:p.optional()}if(e.propertyNames){let d=$e(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?$e(e.additionalProperties,t):q.any();if(Object.keys(u).length===0){i=q.record(d,c);break}let p=q.object(u).passthrough(),m=q.looseRecord(d,c);i=q.intersection(p,m);break}if(e.patternProperties){let d=e.patternProperties,c=Object.keys(d),p=[];for(let f of c){let h=$e(d[f],t),g=q.string().regex(new RegExp(f));p.push(q.looseRecord(g,h))}let m=[];if(Object.keys(u).length>0&&m.push(q.object(u).passthrough()),m.push(...p),m.length===0)i=q.object({}).passthrough();else if(m.length===1)i=m[0];else{let f=q.intersection(m[0],m[1]);for(let h=2;h<m.length;h++)f=q.intersection(f,m[h]);i=f}break}let l=q.object(u);e.additionalProperties===!1?i=l.strict():typeof e.additionalProperties=="object"?i=l.catchall($e(e.additionalProperties,t)):i=l.passthrough();break}case"array":{let u=e.prefixItems,n=e.items;if(u&&Array.isArray(u)){let a=u.map(d=>$e(d,t)),l=n&&typeof n=="object"&&!Array.isArray(n)?$e(n,t):void 0;l?i=q.tuple(a).rest(l):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=n.map(d=>$e(d,t)),l=e.additionalItems&&typeof e.additionalItems=="object"?$e(e.additionalItems,t):void 0;l?i=q.tuple(a).rest(l):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(n!==void 0){let a=$e(n,t),l=q.array(a);typeof e.minItems=="number"&&(l=l.min(e.minItems)),typeof e.maxItems=="number"&&(l=l.max(e.maxItems)),i=l}else i=q.array(q.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}s(md,"i$"),o(md,"convertBaseSchema");function $e(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r=md(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let l=e.anyOf.map(c=>$e(c,t)),d=q.union(l);r=i?q.intersection(r,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let l=e.oneOf.map(c=>$e(c,t)),d=q.xor(l);r=i?q.intersection(r,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:q.any();else{let l=i?r:$e(e.allOf[0],t),d=i?0:1;for(let c=d;c<e.allOf.length;c++)l=q.intersection(l,$e(e.allOf[c],t));r=l}e.nullable===!0&&t.version==="openapi-3.0"&&(r=q.nullable(r)),e.readOnly===!0&&(r=q.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let u={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let l of n)l in e&&(u[l]=e[l]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let l of a)l in e&&(u[l]=e[l]);for(let l of Object.keys(e))cD.has(l)||(u[l]=e[l]);return Object.keys(u).length>0&&t.registry.add(r,u),e.description&&(r=r.describe(e.description)),r}s($e,"Re"),o($e,"convertSchema");function M1(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=z1(r,t?.defaultTarget),u=r.$defs||r.definitions||{},n={version:i,defs:u,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Re};return $e(r,n)}s(M1,"s$"),o(M1,"fromJSONSchema");var O1={};ut(O1,{bigint:s(()=>U1,"bigint"),boolean:s(()=>P1,"boolean"),date:s(()=>q1,"date"),number:s(()=>T1,"number"),string:s(()=>R1,"string")});function R1(e){return ko(Dr,e)}s(R1,"FR"),o(R1,"string");function T1(e){return zo(xr,e)}s(T1,"BR"),o(T1,"number");function P1(e){return Uo(kr,e)}s(P1,"ZR"),o(P1,"boolean");function U1(e){return Zo(Ar,e)}s(U1,"qR"),o(U1,"bigint");function q1(e){return e0(In,e)}s(q1,"VR"),o(q1,"date"),be(bo());var fd=v.object({file:v.string(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),symbol:v.string().optional(),componentName:v.string().optional(),hookName:v.string().optional()}),pD=v.enum(["user-click","user-input","keyboard","route-load","effect","memo-recompute","timer","raf","idle-callback","websocket-message","broadcast-channel","post-message","storage-event","service-worker-message","media-query-change","visibility-change","resize","intersection-observer","mutation-observer","backend-response","hmr-update","ai-turn","page-load","form-submit","input-change"]),Z1=v.object({sessionId:v.string(),browserContextId:v.string().optional(),tabId:v.string().optional(),frameId:v.string().optional(),route:v.string().optional(),url:v.string().optional(),flowId:v.string().optional(),originType:pD.optional(),originNodeId:v.string().optional(),causedByNodeId:v.string().optional(),requestId:v.string().optional(),parentRequestId:v.string().optional(),traceparent:v.string().optional(),projectName:v.string().optional(),userActionId:v.string().optional(),userIdHash:v.string().optional(),tenantIdHash:v.string().optional()}),mD=v.enum(["nx","vite","typescript","eslint","rollup","client-runtime","chrome","react","valtio","nestjs","nextjs","db","redis","queue","memory","visual","perf","security","gateway","external","ai","lens"]),fD=v.enum(["build","lint","typecheck","test","runtime","render","visual","trace","state","network","backend","db","memory","performance","security","deps","cluster","ai"]),hd=v.enum(["debug","info","warning","error","fatal"]),r_=v.object({id:v.string(),sessionId:v.string(),timestamp:v.number().int().nonnegative(),source:mD,category:fD,severity:hd,context:Z1,fingerprint:v.string(),title:v.string(),message:v.string().optional(),location:fd.optional(),relatedFiles:v.array(v.string()).optional(),relatedUrls:v.array(v.string()).optional(),raw:v.unknown().optional()}),hD=v.enum(["session","browser-context","tab","renderer","router","route","page","component","element","slot","render","react-mount","react-unmount","hook","effect","effect-run","memo","memo-compute","ui-event","handler","animation","animation-frame","transition","timer","api-client-call","http-request","http-response","server-process","nest-app","nest-module","nest-provider","singleton-instance","server-request","guard","controller","service-method","loop","loop-iteration","queue-job","db-query","redis-op","promise","promise-continuation","state-store","state-update","selector","selector-update","visual-frame","visual-violation","style-change","layout-change","memory-owner","memory-mutation","memory-retention","heap-snapshot","build-event","lint-event","typecheck-event","test-event","bundle-report","hmr-update"]),gD=v.enum(["created","active","completed","disposed","errored"]),i_=v.object({id:v.string(),parentTraceNodeId:v.string().optional(),type:hD,logicalId:v.string().optional(),instanceId:v.string().optional(),generation:v.number().int().nonnegative().optional(),lifecycle:gD,context:Z1,name:v.string(),startTime:v.number().int().nonnegative(),endTime:v.number().int().nonnegative().optional(),durationMs:v.number().nonnegative().optional(),location:fd.optional(),attributes:v.record(v.string(),v.unknown())}),vD=v.enum(["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"]),n_=v.object({id:v.string(),from:v.string(),to:v.string(),axis:vD,type:v.string(),timestamp:v.number().int().nonnegative(),attributes:v.record(v.string(),v.unknown()).optional()}),yD=v.enum(["mount","update"]),ED=v.discriminatedUnion("type",[v.object({type:v.literal("props"),changedKeys:v.array(v.string())}),v.object({type:v.literal("react-state"),hookIndex:v.number().int()}),v.object({type:v.literal("context"),contextName:v.string()}),v.object({type:v.literal("valtio-path"),path:v.string(),changedKeys:v.array(v.string())}),v.object({type:v.literal("parent-render"),parentRenderId:v.string()}),v.object({type:v.literal("hook-dep-changed"),hookInstanceId:v.string(),depsHashBefore:v.string(),depsHashAfter:v.string()}),v.object({type:v.literal("force"),reason:v.string()})]),s_=v.object({phase:yD,actualDurationMs:v.number().nonnegative(),baseDurationMs:v.number().nonnegative(),startTime:v.number().nonnegative(),commitTime:v.number().nonnegative(),why:v.array(ED)}),a_=v.object({hookInstanceId:v.string(),depsHash:v.string(),prevDepsHash:v.string().optional(),durationMs:v.number().nonnegative(),cleanupRan:v.boolean().optional()}),o_=v.object({storeId:v.string(),path:v.string(),changedKeys:v.array(v.string()),beforeHash:v.string(),afterHash:v.string(),preview:v.unknown().optional()}),l_=v.object({method:v.string(),route:v.string(),status:v.number().int().optional(),durationMs:v.number().nonnegative().optional(),traceparent:v.string().optional()}),bD=v.enum(["N+1","sequential-await","growing-allocation"]),d_=v.object({iterations:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),dbCallsInsideLoop:v.number().int().nonnegative(),redisCallsInsideLoop:v.number().int().nonnegative(),awaitedOperationsInsideLoop:v.number().int().nonnegative(),slowestIterations:v.array(v.object({index:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),childNodeIds:v.array(v.string())})).optional(),patterns:v.array(bD).optional()}),wD=v.enum(["Map","Set","Array","EventEmitter","Queue","RxSubject","Timer","Interval","Custom"]),c_=v.object({ownerInstanceId:v.string(),containerKind:wD,fieldName:v.string(),itemCount:v.number().int().nonnegative(),estimatedBytes:v.number().nonnegative(),retainedBytes:v.number().nonnegative().optional(),growthSinceStart:v.number()}),DD=v.enum(["set","push","add","delete","clear","subscribe","listen","schedule"]),p_=v.object({ownerNodeId:v.string(),operation:DD,beforeCount:v.number().int().nonnegative(),afterCount:v.number().int().nonnegative(),estimatedDeltaBytes:v.number(),keyPreview:v.string().optional(),valueType:v.string().optional()}),L1=v.object({x:v.number(),y:v.number(),width:v.number().nonnegative(),height:v.number().nonnegative()}),$D=v.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]),BD=v.enum(["computed-style","layout","paint-order"]),m_=v.object({causedBy:$D,viewport:L1,layoutSnapshotId:v.string(),styleSnapshotId:v.string(),screenshotId:v.string().optional(),changedNodes:v.array(v.object({uid:v.string(),component:v.string().optional(),change:BD,property:v.string().optional(),before:v.unknown().optional(),after:v.unknown().optional()}))}),xD=v.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]),CD=v.enum(["always","after-animation","stable-only","during-animation"]),kD=v.enum(["info","warning","error"]),f_=v.object({ruleId:v.string(),ruleType:xD,severity:kD,timing:CD,element:v.object({uid:v.string(),component:v.string().optional(),rect:L1}),expected:v.record(v.string(),v.unknown()),actual:v.record(v.string(),v.unknown()),evidence:v.object({computedStyle:v.string().optional(),screenshotCrop:v.string().optional(),trace:v.string().optional(),cssCause:v.object({selector:v.string(),file:v.string().optional(),line:v.number().int().optional(),declaration:v.string().optional()}).optional()})}),AD=v.enum(["none","connected"]),ID=v.enum(["running","clean","failing","error"]),_D=v.object({id:v.string(),tool:v.string(),project:v.string().optional(),firstReportedAt:v.number().int().nonnegative(),lastReportedAt:v.number().int().nonnegative(),lastRunStatus:ID,lastRunDurationMs:v.number().int().nonnegative().optional(),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative().optional(),error:v.string().optional()}),Ln=v.object({producer:AD,producers:v.array(_D),lastReportedAt:v.number().int().nonnegative().optional(),ageMs:v.number().int().nonnegative().optional(),stale:v.boolean(),detail:v.string()}),V1=10*6e4;function Vn(e){let t=e.now??Date.now(),r=[...e.producers].sort((c,p)=>p.lastReportedAt-c.lastReportedAt);if(r.length===0)return{producer:"none",producers:[],stale:!1,detail:`No ${e.domain} producer has ever reported into this session \u2014 this is NOT a clean result, nothing is watching. ${e.noProducerHint}`};let i=r[0].lastReportedAt,u=Math.max(0,t-i),n=u>V1,a=r.filter(c=>c.lastRunStatus==="failing"),l=r.filter(c=>c.lastRunStatus==="error"),d=[`${r.length} ${e.domain} producer${r.length===1?"":"s"} reporting (${r.map(c=>c.id).join(", ")}); newest report ${J1(u)}.`];return l.length>0&&d.push(`${l.length} produced NO verdict (the tool itself failed): ${l.map(c=>`${c.id} \u2014 ${c.error??"unknown error"}`).join("; ")}.`),a.length>0&&d.push(`${a.length} reporting errors.`),n&&d.push(`Older than ${Math.round(V1/6e4)}m \u2014 the verdict may predate the current source.`),{producer:"connected",producers:r,lastReportedAt:i,ageMs:u,stale:n,detail:d.join(" ")}}s(Vn,"Yr"),o(Vn,"summariseProducers");function J1(e){return e<1e3?"just now":e<6e4?`${Math.round(e/1e3)}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(J1,"dE"),o(J1,"describeAge");var Eu=v.object({$schema:v.string().optional(),schemaVersion:v.literal(1),revision:v.number().int().nonnegative(),updatedAt:v.string().datetime().optional()}),SD=v.enum(["starting","clean","warning","failing"]),W1=v.object({source:v.string(),severity:hd,title:v.string(),fingerprint:v.string(),resource:v.string(),pageId:v.string().optional(),flowId:v.string().optional(),location:fd.optional(),rule:v.string().optional(),fix:v.string().optional(),verify:v.string().optional(),docs:v.string().optional()}),FD=v.object({typecheck:v.enum(["passed","failed","unknown"]).optional(),lint:v.enum(["passed","failed","unknown"]).optional(),build:v.enum(["passed","failed","unknown"]).optional(),runtime:v.enum(["passed","failed","warning","unknown"]).optional(),visual:v.enum(["passed","failed","warning","unknown"]).optional(),memory:v.enum(["passed","failed","warning","unknown"]).optional()}),jD=v.enum(["embedded","shared"]),zD=v.object({mode:jD,pid:v.number(),startedAt:v.string(),url:v.string().optional()}),h_=Eu.extend({sessionId:v.string(),status:SD,activeTab:v.string().optional(),tabsWithIssues:v.array(v.string()).optional(),blocking:v.array(W1),warnings:v.array(W1).default([]),suggestedReads:v.array(v.string()),checks:FD.optional(),server:zD.optional()}),ND=v.object({eventsResident:v.number().int().nonnegative(),eventsResidentBytes:v.number().int().nonnegative(),eventsIngested:v.number().int().nonnegative(),eventsDropped:v.number().int().nonnegative(),eventsDroppedForBytes:v.number().int().nonnegative().optional(),eventCap:v.number().int().nonnegative().optional(),eventByteCap:v.number().int().nonnegative().optional(),artifactsResident:v.number().int().nonnegative().optional(),artifactsResidentBytes:v.number().int().nonnegative().optional(),artifactsDropped:v.number().int().nonnegative().optional(),artifactByteCap:v.number().int().nonnegative().optional(),truncatedEvents:v.number().int().nonnegative().optional(),truncatedBytesReclaimed:v.number().int().nonnegative().optional(),rawByteLimit:v.number().int().nonnegative().optional(),reducers:v.record(v.string(),v.object({residentEvents:v.number().int().nonnegative(),residentBytes:v.number().int().nonnegative(),evictedEvents:v.number().int().nonnegative(),evictedForBytes:v.number().int().nonnegative(),eventCap:v.number().int().nonnegative(),byteCap:v.number().int().nonnegative()})).optional()}),g_=Eu.extend({sessionId:v.string(),supportedResources:v.array(v.string()),supportedTools:v.array(v.string()),supportedJobs:v.array(v.string()),supportedChannels:v.array(v.string()),subscribedByDefault:v.array(v.string()),transports:v.array(v.enum(["stdio","http","socket"])),host:v.object({platform:v.string(),node:v.string()}),project:v.object({name:v.string(),nxVersion:v.string().optional()}),storage:ND.optional()}),MD=v.object({id:v.string(),timestamp:v.number().int().nonnegative(),message:v.string(),fingerprint:v.string(),code:v.string().optional(),rule:v.string().optional(),severity:hd.optional(),file:v.string().optional(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),project:v.string().optional()}),v_=Eu.merge(Ln).extend({status:v.enum(["unknown","clean","failing"]),errorCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),y_=Eu.merge(Ln).extend({errors:v.array(MD)}),E_=Eu.merge(Ln).extend({status:v.enum(["unknown","clean","warning","failing"]),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),b_=Eu.merge(Ln).extend({status:v.enum(["unknown","clean","warning","failing"]),hmrUpdates:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),Pr=Symbol.for("@lensmcp/session/Session"),Ur=Symbol.for("@lensmcp/core/EventBus"),OD=Symbol.for("@lensmcp/core/GraphStore"),Z=Symbol.for("@lensmcp/core/ResourceStore"),RD=Symbol.for("@lensmcp/storage/Storage"),TD="capture-request.json",PD="capture-runner.json",UD="capture-rules.json",gd="__lensmcpTruncation",qD="__lensmcpTruncated";function Xe(e,t=Number.POSITIVE_INFINITY,r=12){return Ut(e,t,r,32)}s(Xe,"We"),o(Xe,"estimateJsonBytes");function vd(e,t,r=12){return Ut(e,t,r,Number.POSITIVE_INFINITY)>t}s(vd,"Zs"),o(vd,"exceedsJsonByteBudget");function Ut(e,t,r,i){switch(typeof e){case"undefined":case"function":case"symbol":return 0;case"boolean":return 5;case"number":return Number.isFinite(e)?8:4;case"bigint":return 20;case"string":return e.length+2;default:break}if(e===null)return 4;if(r<=0)return i;if(e instanceof Date)return 26;if(Array.isArray(e)){let a=2;for(let l=0;l<e.length;l++)if(a+=Ut(e[l],t-a,r-1,i)+1,a>t)return a;return a}let u=2,n=e;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let l=Ut(n[a],t-u,r-1,i);if(l!==0&&(u+=a.length+4+l,u>t))return u}return u}s(Ut,"en"),o(Ut,"walk");function Jn(e,t){e.truncatedAnything=!0,e.paths.length<20&&e.paths.push(t||"<root>")}s(Jn,"bm"),o(Jn,"record");function G1(e,t,r){return Jn(e,r),{[qD]:!0,originalBytes:Xe(t,Number.POSITIVE_INFINITY,64)}}s(G1,"yE"),o(G1,"stub");function K1(e){if(e===null)return!0;let t=typeof e;return t==="number"||t==="boolean"||t==="string"||t==="bigint"}s(K1,"bE"),o(K1,"isScalar");function bu(e,t,r,i){if(typeof e=="string"){let u=t.budget<=0?256:t.maxStringBytes;if(e.length+2<=u)return t.budget-=e.length+2,e;let n=Math.max(0,u-64);return Jn(t,i),t.budget-=n,`${e.slice(0,n)}\u2026[lensmcp truncated: ${e.length-n} more chars]`}return e===null||typeof e!="object"?(t.budget-=Ut(e,Number.POSITIVE_INFINITY,1,32),e):r<=0?G1(t,e,i):e instanceof Date?(t.budget-=26,e):Array.isArray(e)?H1(e,t,r,i):X1(e,t,r,i)}s(bu,"tn"),o(bu,"clampValue");function H1(e,t,r,i){let u=[],n=Math.min(e.length,t.maxArrayItems);for(let a=0;a<n&&!(t.budget<=0);a++)u.push(bu(e[a],t,r-1,`${i}[${a}]`));return u.length<e.length&&Jn(t,`${i}[] (+${e.length-u.length} items dropped)`),u}s(H1,"wE"),o(H1,"clampArray");function X1(e,t,r,i){let u={},n,a=t.budget<=0;for(let l in e){if(!Object.prototype.hasOwnProperty.call(e,l))continue;let d=e[l],c=Ut(d,512,r-1,Number.POSITIVE_INFINITY);if(c<=512&&(!a||K1(d))){u[l]=d,t.budget-=l.length+4+c;continue}(n??=[]).push({key:l,bytes:c})}if(!n)return u;n.sort((l,d)=>l.bytes===d.bytes?0:l.bytes<d.bytes?-1:1);for(let{key:l}of n){let d=i?`${i}.${l}`:l;u[l]=bu(e[l],t,r-1,d)}return u}s(X1,"xE"),o(X1,"clampObject");function Y1(e,t={}){let r=t.rawByteLimit??32768,i=t.maxDepth??12;if(r<=0)return{value:void 0,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(e==null)return{value:e,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(!vd(e,r,i)){let d=Xe(e,r,i),c={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1};return{value:bu(e,c,i,""),truncated:!1,originalBytes:d,keptBytes:d,paths:[]}}let u=Xe(e,Number.POSITIVE_INFINITY,64),n={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},a=bu(e,n,i,""),l=Xe(a,Number.POSITIVE_INFINITY,i);if(n.truncatedAnything&&a!==null&&typeof a=="object"&&!Array.isArray(a)){let d={truncated:!0,originalBytes:u,keptBytes:l,paths:n.paths};a[gd]=d}return{value:a,truncated:n.truncatedAnything,originalBytes:u,keptBytes:l,paths:n.paths}}s(Y1,"wm"),o(Y1,"boundedClone");function qt(e,t){if(e.size<=t)return 0;let r=0,i=e.keys();for(;e.size>t;){let u=i.next();if(u.done)break;e.delete(u.value)&&(r+=1)}return r}s(qt,"tt"),o(qt,"capMap");var qr=256,wu="error-dismissed",Wn="error-restored",Q1="lens",ZD=new Set(["dashboard","cli","agent"]);function yd(e){if(e.source!==Q1||!e.raw||typeof e.raw!="object")return;let t=e.raw,r=t.groupId;if(typeof r!="string"||r.length===0||r.length>2048)return;if(t.kind===Wn)return{kind:Wn,groupId:r};if(t.kind!==wu)return;let i=t.until;if(typeof i!="number"||!Number.isFinite(i))return;let u=Array.isArray(t.eventIds)?t.eventIds.filter(c=>typeof c=="string"&&c.length>0).slice(0,200):[],n=ZD.has(t.by)?t.by:void 0,a=o((c,p)=>typeof c=="string"&&c.trim()?c.trim().slice(0,p):void 0,"text"),l=a(t.reason,500),d=a(t.title,300);return{kind:wu,groupId:r,until:Math.min(i,e.timestamp),eventIds:u,...n?{by:n}:{},...l?{reason:l}:{},...d?{title:d}:{}}}s(yd,"qs"),o(yd,"readErrorDismissal");var LD=["pod-memory","pod-memory-retained","pod-memory-released","pod-memory-exited"];function Gn(e){if(!e||typeof e!="object")return;let t=e;if(LD.includes(t.kind)&&!(typeof t.project!="string"||!t.project)&&!(typeof t.pod!="number"||typeof t.pid!="number")&&!(t.kind==="pod-memory"&&(typeof t.live!="number"||!Number.isFinite(t.live)))&&!((t.kind==="pod-memory-retained"||t.kind==="pod-memory-released")&&typeof t.gen!="number"))return e}s(Gn,"nn"),o(Gn,"asPodMemoryRaw");var VD=["perf-rule-finding","perf-rule-retracted","perf-rule-scan"],Ed="https://github.com/kiwiapps-ltd/lensmcp/blob/main/docs/lensmcp/concepts/memory-and-build-cost.mdx",e3={"bundle/heavy-barrel-import":`${Ed}#bundleheavy-barrel-import`,"pod/heap-budget":`${Ed}#podheap-budget`,"pod/retained-generation":`${Ed}#podretained-generation`};function t3(e,t,r){return`perf-rule:${e}:${t}:${r}`}s(t3,"g$"),o(t3,"perfRuleFingerprint");var JD=/^[a-z][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/,WD=12,GD=4e3,vt=o((e,t=GD)=>typeof e=="string"&&e.length>0&&e.length<=t,"isText");function u3(e){if(!e||typeof e!="object")return;let t=e;if(!VD.includes(t.kind)||typeof t.rule!="string"||!JD.test(t.rule)||!vt(t.project,512))return;if(t.kind==="perf-rule-scan"){let i=t.open;return!Array.isArray(i)||i.length>256||!i.every(u=>vt(u,512))?void 0:e}if(!vt(t.subject,512))return;if(t.kind==="perf-rule-retracted")return e;if(t.severity!=="warning"&&t.severity!=="error"||!vt(t.title)||!vt(t.summary)||!vt(t.verify)||!vt(t.docs,1024))return;let r=t.fix;if(!(!Array.isArray(r)||r.length===0||r.length>WD||!r.every(i=>vt(i)))&&!(!t.evidence||typeof t.evidence!="object"||Array.isArray(t.evidence))&&!(!t.cost||typeof t.cost!="object"||Array.isArray(t.cost)))return e}s(u3,"v$"),o(u3,"asPerfRuleRaw");function bd(e){let{source:t,category:r,title:i,kind:u}=e;return t==="ai"?"ai":u?.startsWith("memory")||u==="db-query"?"data":t==="gateway"||u==="gateway-request"?"gateway":u==="queue-process"||u==="queue-active"||u==="queue-completed"||u==="queue-failed"?"services":t==="db"||t==="redis"||t==="queue"||u==="redis-op"||u?.startsWith("queue-")?"data":t==="external"||u==="egress"?"network":t==="nestjs"||t==="nest"?/(?:Repository|Repo|Dao|Store)\./.test(i)?"data":"services":t==="valtio"?"state":r==="network"?"network":"browser"}s(bd,"Sm"),o(bd,"areaOf");var r3=240,KD=new Set(["systemPrompt","prompt","prompts","messages","completion","completions","input","output","draft","text","content","result","arguments","params"]),HD=new Set(["tenantId","caller","userId","accountId","email","subject"]),XD=8;function i3(e){let t=Kn(e,0);return Y1(Zu({redacted:!0,...t}),{rawByteLimit:16*1024}).value}s(i3,"jE"),o(i3,"aiProjection");function Kn(e,t){if(typeof e=="string")return n3(e);if(e===null||typeof e!="object")return e;if(t>=XD)return;if(Array.isArray(e))return e.slice(0,32).map(i=>Kn(i,t+1));let r={};for(let[i,u]of Object.entries(e))if(!HD.has(i)){if(KD.has(i)){typeof u=="string"?r[`${i}Chars`]=u.length:Array.isArray(u)?r[`${i}Count`]=u.length:u!=null&&(r[`${i}Present`]=!0);continue}r[i]=Kn(u,t+1)}return r}s(Kn,"km"),o(Kn,"projectAi");function n3(e){return e.length<=r3?dt(e):`${dt(e.slice(0,r3))}\u2026`}s(n3,"zE"),o(n3,"clipText");function s3(e,t={}){let r=e.raw??{},i=r.render??{},u=r.span??{},n=r.request??{},a=o(y=>typeof y=="number"?y:void 0,"num"),l=r.loop??{},d=r.effect??{},c=a(r.durationMs)??a(u.durationMs)??a(n.durationMs)??a(l.durationMs)??a(i.actualDurationMs)??a(d.durationMs),p=typeof r.kind=="string"?r.kind:void 0,m=p==="fetch-done"||p==="fetch-error",f=a(i.commitTime),h=p==="render"&&f!==void 0&&Math.abs(f-e.timestamp)<6e4,g=m?e.timestamp:h?f:a(r.startedAt)??a(u.startTime)??a(n.startedAt)??a(l.startedAt)??(c!==void 0?e.timestamp-c:e.timestamp),b;if(typeof r.query=="string"){let y=Array.isArray(r.params)?` [${r.params.join(", ")}]`:"",D=typeof r.result=="string"?` \u2192 ${r.result}`:"";b=r.query+y+D}else if(typeof r.command=="string"){let y=typeof r.value=="string"?` \u2192 ${r.value}`:r.hit===!1?" \u2192 (miss)":"";b=r.command+y}else if(p==="state-update"){let y=r.update??{},D="";try{D=JSON.stringify(y.preview)}catch{}b=`${y.storeId??""}.${y.path??""} = ${D}`}else p==="queue-completed"&&typeof r.returned=="string"?b=`returned ${r.returned}`:p==="queue-enqueued"&&(b=`${r.job??"job"}#${r.jobId??"?"} \u2192 ${r.queue??""}${typeof r.data=="string"?" "+r.data:""}`);let x;if(p==="gateway-request")x=`${r.host??""}${String(r.url??"").split("?")[0]}`;else if(p==="fetch-start"||p==="fetch-done"||p==="fetch-error")try{let y=new URL(String(r.href??r.url??""));x=`${y.hostname}${y.pathname}`}catch{}let $;if(p==="gateway-request"&&Array.isArray(r.steps))$=r.steps.map(y=>{let D=[String(y.step)];return y.project&&D.push(String(y.project)),y.prefix&&D.push(String(y.prefix)),y.mode&&D.push(String(y.mode)+(y.ok===!1?" \u2717":y.ok===!0?" \u2713":"")),y.caller&&D.push("by "+String(y.caller)),y.pod&&D.push(String(y.pod)),typeof y.atMs=="number"&&D.push(`@${y.atMs}ms`),D.join(" ")}),b=$.map(y=>y.replace(/ @\d+ms$/,"")).join(" \u2192 ");else if(p==="egress")b=`${r.method??"GET"} ${r.host??""} \u2192 ${r.status??"?"}`;else if(e.source==="ai"){if(p==="ai-call"){let y=r.usage??{},D=y.promptTokens!==void 0||y.completionTokens!==void 0?` \xB7 ${a(y.promptTokens)??"?"}\u2192${a(y.completionTokens)??"?"} tok`:"",A=r.status!==void 0?` \xB7 ${String(r.status)}`:r.error?" \xB7 failed":"",j=a(r.toolCallCount)?` \xB7 ${a(r.toolCallCount)} tool call${a(r.toolCallCount)===1?"":"s"}`:"",N=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${r.provider??""}/${r.model??"?"}${D}${A}${j}${N}${r.stream===!0?" \xB7 stream":""}`}else if(p==="ai-round"){let y=r.model??{},D=r.usage??{},A=Array.isArray(r.toolCalls)?r.toolCalls:[],j=`${a(D.promptTokens)??"?"}\u2192${a(D.completionTokens)??"?"} tok`,N=A.length?` \xB7 ${A.length} tool call${A.length===1?"":"s"}`:"",K=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${y.provider??""}/${y.model??""} \xB7 ${j}${N}${K}`}else if(p==="ai-turn-start"){let y=Array.isArray(r.tools)?r.tools:[];b=`skill ${r.skill??""} \xB7 ${r.output??""}${y.length?" \xB7 tools: "+y.join(", "):""}`}else if(p==="ai-tool-call"){let y=r.call??{},D=r.result??{},A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${y.name??"tool"} ${D.error!=null?"\u2717 "+String(D.error):"\u2713"}${A}`}else if(p==="ai-turn-end"){let y=r.usage??{},D=a(r.rounds)!==void 0?` \xB7 ${a(r.rounds)} round${a(r.rounds)===1?"":"s"}`:"",A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${r.ok===!1?"FAILED":"ok"} \xB7 ${a(y.promptTokens)??"?"}+${a(y.completionTokens)??"?"} tok${D}${A}`}}let w;p==="db-query"&&typeof r.query=="string"?w=r.query:p==="redis-op"?w=`${r.op??""} ${String(r.key??"").replace(/\d+/g,"#")}`:p==="egress"?w=`${r.method??"GET"} ${r.host??""}`:p==="ai-call"?w=`ai ${r.provider??""} ${r.model??""} ${r.api??""}`:p==="queue-enqueued"?w=`enqueue ${r.queue??""}`:p==="span"&&typeof u.name=="string"?w=u.name:p==="memory-mutation"&&(w=e.title);let k=e.context??{},C=i.commitId??d.commitId??r.commitId,M=Array.isArray(i.why)?i.why.map(y=>typeof y?.type=="string"?y.type:void 0).filter(y=>!!y):[];return{id:e.id,t:e.timestamp,start:g,...w?{sig:w}:{},...x?{urlKey:x}:{},...typeof r.queue=="string"?{queue:r.queue}:{},...r.jobId!=null?{jobId:String(r.jobId)}:{},source:e.source,category:e.category,severity:e.severity,title:e.title,kind:p,area:bd({source:e.source,category:e.category,title:e.title,kind:p}),...typeof u.role=="string"?{role:u.role}:{},...typeof k.requestId=="string"?{requestId:k.requestId}:{},...typeof k.parentRequestId=="string"?{parentRequestId:k.parentRequestId}:{},...typeof C=="string"?{commitId:C}:{},...typeof i.componentName=="string"?{component:i.componentName}:{},...typeof i.phase=="string"?{phase:i.phase}:{},...M.length?{why:M}:{},...p==="effect-run"&&typeof d.hookLogicalId=="string"?{hook:d.hookLogicalId}:{},...p==="effect-run"&&d.cleanupRan===!0?{cleanup:!0}:{},...p==="render-commit-truncated"?{renderTotal:a(r.total),renderPublished:a(r.published)}:{},...typeof k.projectName=="string"?{project:k.projectName}:typeof r.project=="string"?{project:r.project}:{},...c!==void 0?{durationMs:c}:{},...m&&a(r.startedAt)!==void 0?{fetchStartedAt:a(r.startedAt)}:{},...e.source==="ai"?{ai:t.includeRaw?r:i3(r)}:{},...b?{detail:b}:{},...$?{steps:$}:{}}}s(s3,"OE"),o(s3,"trimFlowEvent");var a3=1;function o3(e){return e==="flow-origin"?0:e?.endsWith("-start")?1:e==="gateway-request"?2:e==="server-request"?3:e==="span"?4:e==="render"||e==="render-commit-truncated"?6:e==="effect-run"?7:5}s(o3,"ME"),o(o3,"kindRank");function Du(e){return e.kind==="span"&&e.role==="controller"?3.5:e.kind==="queue-process"?3:o3(e.kind)}s(Du,"uo"),o(Du,"causalRank");function Hn(e,t={}){let r=xi(e),i=e.slice().filter(E=>{let _=E.raw??{},I=typeof _.kind=="string"?_.kind:"";if(I==="subscription-added"||I==="subscription-removed"||I==="hook-run"||I==="store-created"||I==="singleton-instance"||I===da)return!1;let S=_.span;return!(typeof S?.name=="string"&&S.name.startsWith("nest.request "))}).map(E=>s3(E,t)),u=new Set;for(let E=i.length-1;E>=0;E--)u.has(i[E].id)?i.splice(E,1):u.add(i[E].id);let n=new Map;for(let E of i)(E.kind==="gateway-request"||E.kind==="queue-process")&&E.requestId&&!n.has(E.requestId)&&n.set(E.requestId,E.start);let a=o(E=>E.source!=="react"&&E.source!=="valtio"&&E.requestId&&n.has(E.requestId)?n.get(E.requestId):E.start,"anchorOf");i.sort((E,_)=>a(E)-a(_)||E.start-_.start||Du(E)-Du(_)||(_.durationMs??0)-(E.durationMs??0)||E.t-_.t);let l=o(E=>(E.kind==="span"||E.kind==="server-request"||E.kind==="gateway-request"||E.kind==="queue-process")&&(E.durationMs??0)>0,"spanLike"),d=i;for(let E of d)E.group=E.source==="react"||E.source==="valtio"||E.source==="client-runtime"||E.source==="visual"?"browser":"server";let c=new Map;for(let E of d)if((E.kind==="gateway-request"||E.kind==="queue-process")&&E.requestId&&E.project){let _=c.get(E.requestId)??[];_.push({project:E.project,start:E.start,end:E.start+(E.durationMs??0)}),c.set(E.requestId,_)}let p=o((E,_)=>{let I=c.get(E);if(I?.length)return I.every(S=>S.project===I[0].project)?I[0].project:I.filter(S=>S.start<=_+1&&S.end>=_-1).sort((S,U)=>U.start-S.start)[0]?.project},"projectOf");for(let E of d)if(!E.project&&E.source==="nestjs"&&E.requestId){let _=p(E.requestId,E.start);_&&(E.project=_)}for(let E of d){let _,I=E.requestId;for(let S of d){if(S===E||!l(S)||S.group!==E.group||S.requestId!==I)continue;let U=S.project,W=E.project;if(S.kind!=="gateway-request"&&E.kind!=="gateway-request"&&U!==void 0&&W!==void 0&&U!==W)continue;let ue=S.durationMs??0,re=E.durationMs??0,L=Math.abs(S.start-E.start)<=a3,V=Du(S),Y=Du(E),ne=S.start<=E.start;if(!(S.start+ue>E.start&&(ne||L&&V<Y)&&(!L||(V!==Y?V<Y:ne&&ue>re))))continue;let Ee=_?Du(_):-1,me=_?Math.abs(S.start-_.start)<=a3:!1;(!_||!me&&S.start>_.start||me&&V>Ee||me&&V===Ee&&(S.durationMs??0)<(_.durationMs??0))&&(_=S)}_&&(E.parent=_.id)}let m=new Map;for(let E of d){if(!E.requestId)continue;let _=m.get(E.requestId);_?_.push(E):m.set(E.requestId,[E])}let f=new Map(d.map(E=>[E.id,E])),h=o((E,_)=>{let I=(m.get(E)??[]).filter(S=>l(S)&&S.start<=_&&S.start+(S.durationMs??0)>=_);if(I.length!==0)return I.sort((S,U)=>U.start-S.start||(S.durationMs??0)-(U.durationMs??0)),I[0]},"callerNodeFor");for(let E of d){if(!E.parentRequestId||E.kind!=="server-request"&&E.kind!=="gateway-request")continue;let _=E.parent?f.get(E.parent):void 0;if(_&&_.requestId===E.requestId)continue;let I=h(E.parentRequestId,E.start);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}let g=d,b=new Map;for(let E of g)E.kind==="gateway-request"&&E.requestId&&!b.has(E.requestId)&&b.set(E.requestId,E);for(let E of g)if(E.group==="server"&&!E.parent&&E.requestId&&E.kind!=="gateway-request"){let _=b.get(E.requestId);_&&_!==E&&_.start<=E.start&&(E.parent=_.id)}let x=new Set,$=new Set,w=[];for(let E of g){if(E.kind!=="gateway-request")continue;if(!E.requestId){w.push(E);continue}let _=m.get(E.requestId)??[];if(_.filter(U=>U.kind==="gateway-request").sort((U,W)=>U.start-W.start)[0]!==E)continue;let I=_.find(U=>U.kind==="fetch-start"),S=_.find(U=>U.kind==="fetch-done"||U.kind==="fetch-error");if(!I&&!S){w.push(E);continue}I&&(E.fetchStartId=I.id,x.add(I.id)),S&&(E.fetchDoneId=S.id,$.add(S.id))}let k=new Map;for(let E of g){if(!E.urlKey)continue;let _=k.get(E.urlKey)??{gws:[],starts:[],dones:[]};E.kind==="gateway-request"?w.includes(E)&&_.gws.push(E):E.kind==="fetch-start"?x.has(E.id)||_.starts.push(E):(E.kind==="fetch-done"||E.kind==="fetch-error")&&($.has(E.id)||_.dones.push(E)),k.set(E.urlKey,_)}for(let{gws:E,starts:_,dones:I}of k.values()){E.sort((U,W)=>U.start-W.start),_.sort((U,W)=>U.start-W.start);let S=new Set;E.forEach((U,W)=>{let ue=_[W];ue&&(U.fetchStartId=ue.id);let re=ue?ue.t:U.start,L,V=1/0;for(let Y of I){if(S.has(Y.id))continue;let ne=Y.fetchStartedAt??Y.start-(Y.durationMs??0),Ee=Math.abs(ne-re);Ee<V&&(V=Ee,L=Y)}L&&(U.fetchDoneId=L.id,S.add(L.id))})}let C=new Map,M=new Map;for(let E of g)!E.queue||!E.jobId||(E.kind==="queue-enqueued"&&C.set(`${E.queue}#${E.jobId}`,E),E.kind==="queue-process"&&M.set(`${E.queue}#${E.jobId}`,E));for(let E of g){if(!E.queue||!E.jobId)continue;let _=`${E.queue}#${E.jobId}`;if(E.kind==="queue-process"&&!E.parent){let I=C.get(_);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}else if(E.kind==="queue-active"||E.kind==="queue-completed"||E.kind==="queue-failed"){let I=M.get(_);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}}let y=d;{let E=new Map;for(let I of y)I.kind==="fetch-start"&&E.set(I.id,I);let _=new Map;for(let I of y){if(I.kind!=="fetch-done"&&I.kind!=="fetch-error")continue;let S=[...E.values()].find(ue=>ue.requestId&&ue.requestId===I.requestId)?.id,U=S?E.get(S):void 0;if(!U)continue;let W=I.fetchStartedAt??U.start;U.title=I.title,U.severity=I.severity,U.durationMs=I.durationMs??Math.max(0,I.t-W),U.kind="fetch",I.detail&&!U.detail&&(U.detail=I.detail),_.set(I.id,U.id)}if(_.size>0){y=y.filter(I=>!_.has(I.id));for(let I of y)for(I.fetchDoneId&&_.has(I.fetchDoneId)&&(I.fetchDoneId=_.get(I.fetchDoneId));I.parent&&_.has(I.parent);)I.parent=_.get(I.parent)}}let D=o(E=>!!E.commitId&&(E.kind==="render"||E.kind==="effect-run"||E.kind==="render-commit-truncated"),"commitMember"),A=o(E=>[...new Set(E)],"uniq"),j=o(E=>A(E.map(_=>_.component).filter(_=>!!_)),"named"),N=o(E=>E.length<=2?E.join(" + "):`${E[0]} + ${E.length-1} more`,"nameList"),K=o(E=>{let _=new Map;for(let I of E)I.component&&_.set(I.component,(_.get(I.component)??0)+1);return[..._].map(([I,S])=>S>1?`${I} \xD7${S}`:I).join(", ")},"tally"),H=o(E=>{if(!E)return"effect";let _=/([^/\\]+?):(\d+)(?::\d+)?$/.exec(E);return _?`${_[1]}:${_[2]}`:E},"shortHook"),ye=o(E=>`${H(E.hook)}${E.cleanup?" (cleanup)":""}`,"hookLabel"),Ze=o(E=>{let _=Math.min(...E.map(S=>S.start)),I=Math.max(...E.map(S=>S.start+(S.durationMs??0)));return{start:_,durationMs:I-_}},"extent"),Je=o(E=>(delete E.component,delete E.why,delete E.phase,delete E.hook,delete E.cleanup,delete E.renderTotal,delete E.renderPublished,E),"asGroup");function It(E){let _=E[0],I=E.filter(he=>he.kind==="render"),S=E.filter(he=>he.kind==="effect-run"),U=E.find(he=>he.kind==="render-commit-truncated"),W=[...I].sort((he,qu)=>(qu.durationMs??0)-(he.durationMs??0)),ue=W.filter(he=>(he.why??[]).some(qu=>qu!=="parent-render")),re=A(ue.flatMap(he=>(he.why??[]).filter(qu=>qu!=="parent-render"))),L=j(ue),V=I.filter(he=>he.phase==="mount"),Y=I.filter(he=>he.phase!=="mount"&&!ue.includes(he)),ne=W[0]?.component??"view",Ee=I.length>0&&V.length===I.length,me=re.length?re.join(" + "):void 0,_t=Ee?"mount":"update",St=L.length?`view update \xB7 ${N(L)} \u2190 ${me}`:Ee?`view mount \xB7 ${ne}`:`view update \xB7 ${ne}`,Pm=U?.renderTotal??I.length,n5=[V.length?`mounted ${K(V)}`:"",Y.length?`re-rendered ${K(Y)}`:"",!L.length&&!Ee&&I.length?"trigger not recorded \u2014 every captured render came from its parent":"",U?`${Pm} renders, ${U.renderPublished??I.length} recorded (per-commit cap)`:`${I.length} render${I.length===1?"":"s"}`,S.length?`${S.length} effect${S.length===1?"":"s"}: ${S.map(ye).join(", ")}`:""].filter(Boolean).join(" \xB7 "),Um=j(I);return Je({..._,...Ze(E),kind:"view-update",title:St,detail:n5,commitId:_.commitId,viewPhase:_t,...me?{cause:me}:{},causeComponents:L,components:Um,mounted:j(V),renderCount:Pm,recordedRenders:I.length,effects:S.length,effectHooks:S.map(ye),memberIds:E.map(he=>he.id),sig:`commit:${_t}:${me??"-"}:${L.join(",")}:${Um.slice().sort().join(",")}`,severity:E.some(he=>he.severity==="error")?"error":_.severity})}s(It,"pr"),o(It,"viewUpdateNode");function tt(E){let _=E[0],I=E.map(ye);return Je({..._,...Ze(E),kind:"commit-effects",title:E.length===1?`effect \xB7 ${I[0]}`:`effects \xB7 ${I[0]} + ${E.length-1} more`,detail:I.join(", "),commitId:_.commitId,effects:E.length,effectHooks:I,memberIds:E.map(S=>S.id),sig:`effects:${I.slice().sort().join(",")}`})}s(tt,"_t"),o(tt,"effectsNode");let $i=o(E=>A(E.map(_=>_==="state-update"?"state update":_==="fetch-start"?"request":_==="flow-origin"?"interaction":"response")).join(" + "),"describeInputs");function Uu(E,_){let I=E[0],S=E[E.length-1],U=E.length,W=I.detail,ue=Math.min(...E.map(Y=>Y.start)),re=Math.max(...E.map(Y=>Y.start+(Y.durationMs??0))),L=Math.round(E.reduce((Y,ne)=>Y+(ne.durationMs??0),0)/U*10)/10,V=Math.round((re-ue)*10)/10;I.count=U,I.avgMs=L,I.wallMs=V,I.durationMs=re-ue,I.items=E.slice(0,12).map(Y=>({start:Y.start-ue,...Y.durationMs!=null?{durationMs:Y.durationMs}:{}})),I.memberIds=E.flatMap(Y=>Y.memberIds??[Y.id]),I.title=`\xD7${U} ${I.title}`,E.some(Y=>Y.severity==="error")&&(I.severity="error"),I.kind==="view-update"?I.detail=[`${U} commits, ${_.length?`one per ${$i(_)}`:"back to back"}`,`avg ${L}ms \xB7 wall ${V}ms`,W??""].filter(Boolean).join(" \xB7 "):I.kind==="state-update"&&W&&S.detail?I.detail=`${U} updates in a row \xB7 wall ${V}ms \xB7 first ${W} \xB7 last ${S.detail}`:I.detail=[`${U} in a row \xB7 wall ${V}ms`,W??""].filter(Boolean).join(" \xB7 ")}s(Uu,"ei"),o(Uu,"collapseRepeat");let Oe=[],Bi=new Map,Rm=new Set;for(let E=0;E<y.length;E++){if(Rm.has(E))continue;let _=y[E];if(!D(_)){Oe.push(_);continue}let I=[E];for(let W=E+1;W<y.length;W++){let ue=y[W];if(ue.group==="browser"){if(!D(ue)||ue.commitId!==_.commitId)break;I.push(W)}}for(let W of I)Rm.add(W);let S=I.map(W=>y[W]),U=S.some(W=>W.kind!=="effect-run")?It(S):tt(S);for(let W of S)W.id!==U.id&&Bi.set(W.id,U.id);Oe.push(U)}if(Bi.size>0||Oe.some(E=>E.kind==="view-update"||E.kind==="commit-effects")){y=Oe;for(let E of y)for(;E.parent&&Bi.has(E.parent);)E.parent=Bi.get(E.parent)}{let E=new Map;for(let _ of y)_.kind==="view-update"&&_.commitId&&!E.has(_.commitId)&&E.set(_.commitId,_);for(let _ of y){if(_.kind!=="commit-effects"||_.parent||!_.commitId)continue;let I=E.get(_.commitId);I&&I.start<=_.start&&(_.parent=I.id)}}{let E=new Set(["state-update","fetch","fetch-start","fetch-done","fetch-error","flow-origin"]),_=y.map((L,V)=>L.group==="browser"?V:-1).filter(L=>L>=0),I=o(L=>`${L.kind}|${L.sig??L.title}`,"keyOf"),S=_.map(L=>I(y[L])),U=o((L,V,Y)=>{for(let ne=0;ne<Y;ne++)if(S[L+ne]!==S[V+ne])return!1;return!0},"sameBlock"),W=o(L=>S[L].split("|")[0],"kindAt"),ue=o(L=>{let V=0,Y=1;for(let ne=1;ne<=4&&L+ne<=S.length;ne++){let Ee=1;for(;L+(Ee+1)*ne<=S.length&&U(L,L+Ee*ne,ne);)Ee+=1;Ee>=3&&ne*Ee>V*Y&&(V=ne,Y=Ee)}return{k:V,r:Y}},"bestBlockAt"),re=new Map;for(let L=0;L<S.length;){let{k:V,r:Y}=ue(L);if(V===0){L+=1;continue}let ne=[...Array(V).keys()].find(me=>E.has(W(L+me)));if(ne!==void 0&&ne>0){let me=ue(L+ne);if(me.k===V&&me.r>=3&&me.r>=Y-1){L+=ne;continue}}let Ee=S.slice(L,L+V).map(me=>me.split("|")[0]).filter(me=>E.has(me));for(let me=0;me<V;me++){let _t=[];for(let St=0;St<Y;St++)_t.push(y[_[L+me+St*V]]);Uu(_t,Ee);for(let St of _t.slice(1))re.set(St.id,_t[0].id)}L+=V*Y}if(re.size>0){y=y.filter(L=>!re.has(L.id));for(let L of y)for(;L.parent&&re.has(L.parent);)L.parent=re.get(L.parent)}}{let E=new Map(y.map(_=>[_.id,_]));for(let _ of y){let I=new Set([_.id]),S=_;for(;S?.parent;){if(I.has(S.parent)){S.parent=void 0;break}I.add(S.parent),S=E.get(S.parent)}}}let Tm=o(E=>{let _=new Map;for(let S of y){if(!S.sig||l(S)!==E||S.kind==="server-request"||S.kind==="gateway-request"||S.group==="browser")continue;let U=`${S.parent??"root"}|${S.kind}|${S.sig}`,W=_.get(U);W?W.push(S):_.set(U,[S])}let I=new Map;for(let S of _.values()){if(S.length<3)continue;S.sort((V,Y)=>V.start-Y.start);let U=S[0],W=!1;for(let V=0;V+1<S.length;V++)if(S[V+1].start<S[V].start+(S[V].durationMs??0)){W=!0;break}let ue=U.start,re=Math.max(...S.map(V=>V.start+(V.durationMs??0))),L=S.reduce((V,Y)=>V+(Y.durationMs??0),0);U.count=S.length,U.parallel=W,U.avgMs=Math.round(L/S.length*10)/10,U.wallMs=re-ue,U.durationMs=re-ue,U.title=`\xD7${S.length} ${U.title.replace(/\s*\((?:\d+ rows?, )?\d+ms\)$/,"")}`,U.detail=`${U.sig} \xD7${S.length} ${W?"\u2016 parallel":"\u21BB sequential loop"} \xB7 avg ${U.avgMs}ms \xB7 wall ${U.wallMs}ms`,U.items=S.slice(0,12).map(V=>({start:V.start-ue,...V.durationMs!=null?{durationMs:V.durationMs}:{}})),U.memberIds=S.flatMap(V=>V.memberIds??[V.id]),S.some(V=>V.severity==="error")&&(U.severity="error");for(let V of S.slice(1))I.set(V.id,U.id)}if(I.size!==0){y=y.filter(S=>!I.has(S.id));for(let S of y)for(;S.parent&&I.has(S.parent);)S.parent=I.get(S.parent)}},"aggregatePass");Tm(!0),Tm(!1);for(let E of y){if(!l(E))continue;let _=E.durationMs??0;if(_<40)continue;let I=y.filter(re=>re.parent===E.id&&(re.durationMs??0)>0).map(re=>[re.start,re.start+(re.durationMs??0)]).sort((re,L)=>re[0]-L[0]),S=0,U=-1,W=-1;for(let[re,L]of I)re>W?(W>U&&(S+=W-U),U=re,W=L):L>W&&(W=L);W>U&&(S+=W-U);let ue=Math.max(0,_-S);(ue>=50||ue/_>=.7&&_>=40)&&(E.selfMs=ue,E.detail=`\u26A0 cpu-heavy: ${ue}ms self-time of ${_}ms${E.detail?" \xB7 "+E.detail:""}`)}return{events:y,...r?{sql:r}:{}}}s(Hn,"lo"),o(Hn,"buildFlowDetail");var Xn=["user-action","page-load","navigation","api","ai","background","test","system","other"],Yn=new Map;function $u(e,t){let r=Yn.get(e);return r||(r=new RegExp(`^${e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")}$`),Yn.size>500&&Yn.clear(),Yn.set(e,r)),r.test(t)}s($u,"po"),o($u,"globMatch");var YD=o(e=>/^[A-Z]+ /.test(e),"hasMethod");function l3(e,t){return t.some(r=>r.route?YD(e)?$u(e,`${r.method??"GET"} ${r.route}`):$u(e,r.route):!1)}s(l3,"PE"),o(l3,"routeMatches");function wd(e,t){return!([e.flowId,e.originType,e.origin,e.route,e.project].filter(r=>r!==void 0).length===0||e.flowId!==void 0&&!$u(e.flowId,t.flowId)||e.originType!==void 0&&e.originType!==t.origin.type||e.origin!==void 0&&!(t.origin.nodeId!==void 0&&$u(e.origin,t.origin.nodeId))||e.route!==void 0&&!l3(e.route,t.segments)||e.project!==void 0&&!t.segments.some(r=>r.projects.some(i=>$u(e.project,i))))}s(wd,"w$"),o(wd,"ruleMatches");var Dd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),yt=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),Qn=o(e=>Dd(e.raw)?yt(e.raw.kind)??"":"","kindOf");function d3(e){let t=[...e].sort((l,d)=>(Number(l.timestamp)||0)-(Number(d.timestamp)||0)||(l.id<d.id?-1:1)),r=t.find(l=>Qn(l)==="flow-origin"),i=r??t.find(l=>yt(l.context?.originType));if(!i)return{};let u=Dd(i.raw)?i.raw:{},n=yt(i.context?.originType)??(r?yt(i.title):void 0),a=yt(u.originNodeId)??yt(i.context?.originNodeId);return{...n?{type:n}:{},...a?{nodeId:a}:{}}}s(d3,"DE"),o(d3,"originOf");var QD=/^(verify|e2e|test|smoke|load)[-_:]/i,e$=o((e,t)=>QD.test(e)||t!==void 0&&/^(ui:)?(tools|scripts?|e2e)\//.test(t),"isTestFlow"),c3={"page-load":"page-load","user-click":"user-action","form-submit":"user-action","input-change":"user-action","double-click":"user-action","context-menu":"user-action","key-press":"user-action","route-load":"navigation","route-change":"navigation",navigation:"navigation","ai-turn":"ai",timer:"background",cron:"background",interval:"background",queue:"background",job:"background","websocket-message":"background","hmr-update":"system"},t$=new Set(["page-load","user-action","navigation"]),u$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function es(e){return e.replace(/[?#].*$/,"").split("/").map(t=>u$.test(t)||/^[0-9a-f]{16,}$/i.test(t)||/^\d{2,}$/.test(t)?":id":t).join("/")}s(es,"Im"),o(es,"templatePath");function p3(e){let t=/^ui:(?:.*\/)?([^/:]+?)(?:\.[a-z]+)?:\d+:([A-Za-z]+)$/.exec(e);return t?`${t[1]} \xB7 ${t[2]}`:e}s(p3,"BE"),o(p3,"componentOf");function m3(e){let t=e.replace(/[-_:][0-9a-f]{6,}(?:-[0-9a-f]+)*$/i,"");return t=t.replace(/[-_:](?=[a-z0-9]*\d)[a-z0-9]{6,}$/i,""),t=t.replace(/[-_:]\d+$/,""),t||e}s(m3,"ZE"),o(m3,"scriptFamily");function f3(e,t,r,i){let u=t.nodeId,n=u?/^(page|route|ambient):(.*)$/.exec(u):null;if(n)return`${n[1]}:${es(n[2])}`;if(t.type&&c3[t.type]==="user-action"&&u)return p3(u);if(e==="test")return m3(r.flowId);let a=r.segments.find(d=>d.kind==="request"&&d.route);if(a?.route)return`${a.method??"GET"} ${es(a.route)}`;let l=i.find(d=>Qn(d)==="ai-call");return l&&Dd(l.raw)?`ai \xB7 ${yt(l.raw.model)??yt(l.raw.provider)??"call"}`:u?es(u):void 0}s(f3,"qE"),o(f3,"subjectOf");var r$=10,i$=1e3,n$=3,s$=500,a$=1e3;function h3(e,t){let r=new Set,i=t.segments.filter(n=>n.kind==="request");t.segments.some(n=>n.counts.errors>0)&&r.add("has-error"),i.some(n=>n.durationMs>=i$)&&r.add("slow"),i.length>=r$&&r.add("fan-out"),new Set(t.segments.flatMap(n=>n.projects)).size>=3&&r.add("multi-service"),e.some(n=>Qn(n)==="queue-enqueued")&&r.add("queue"),e.some(n=>Qn(n)==="ai-call"||n.source==="ai")&&r.add("ai"),t.stats.bookkeeping>=s$&&t.stats.bookkeeping*2>=t.stats.events&&r.add("storm"),t.stats.events>=a$&&r.add("large");let u=new Map;for(let n of i)(!n.part||n.part.index===1)&&u.set(n.label,(u.get(n.label)??0)+1);return[...u.values()].some(n=>n>=n$)&&r.add("repeated-requests"),[...r].sort()}s(h3,"XE"),o(h3,"tagsOf");function g3(e,t,r=[]){let i=d3(e),u={flowId:t.flowId,origin:i,segments:t.segments},n=h3(e,t),a=o((p,m,f)=>{let h=f3(p,i,t,e);return{category:p,decidedBy:m,...f!==void 0?{ruleIndex:f}:{},tags:n,origin:i,...h?{subject:h}:{}}},"done"),l=r.findIndex(p=>p.category&&wd(p,u));if(l!==-1)return a(r[l].category,"rule",l);if(e$(t.flowId,i.nodeId))return a("test","test");let d=i.type?c3[i.type]:void 0;if(d)return a(d,"origin");if(n.includes("ai"))return a("ai","shape");let c=t.segments.filter(p=>p.kind==="request");return c.length>0?a(c.every(p=>p.requestId?.startsWith("job:"))?"background":"api","shape"):t.segments.length>0&&t.segments.every(p=>p.kind==="ambient")?a("system","shape"):a("other","shape")}s(g3,"$$"),o(g3,"classifyFlow");function v3(e,t,r=[]){let i=r.find(u=>u.category&&(u.route!==void 0||u.project!==void 0)&&u.flowId===void 0&&u.origin===void 0&&u.originType===void 0&&wd(u,{flowId:e.flowId,origin:t.origin,segments:[e]}));return i?i.category:e.kind==="request"?e.requestId?.startsWith("job:")?"background":"api":e.kind==="ambient"?"system":e.kind==="origin"&&t$.has(t.category)?t.category:"ui"}s(v3,"_$"),o(v3,"categoryOfSegment");function y3(e){return E3(e).map(t=>{let r=new Map;for(let u of t.items){let n=r.get(u.subject);n?n.push(u):r.set(u.subject,[u])}let i=[...r.entries()].sort((u,n)=>(u[0]===void 0?1:0)-(n[0]===void 0?1:0)||n[1].length-u[1].length||String(u[0]).localeCompare(String(n[0]))).map(([u,n])=>({subject:u,count:n.length,items:n}));return{...t,subjects:i}})}s(y3,"k$"),o(y3,"groupFlows");function E3(e){let t=new Map;for(let i of e){let u=t.get(i.category);u?u.push(i):t.set(i.category,[i])}let r=o(i=>{let u=Xn.indexOf(i);return u===-1?Xn.length:u},"rank");return[...t.entries()].sort((i,u)=>r(i[0])-r(u[0])||(i[0]<u[0]?-1:i[0]>u[0]?1:0)).map(([i,u])=>({category:i,count:u.length,items:u}))}s(E3,"HE"),o(E3,"groupByCategory");var Et={categories:[],segments:{},problems:[]},$d=200,b3=200,w3=64,o$=/^[A-Za-z0-9][A-Za-z0-9 ._:/-]*$/,l$=["category","flowId","originType","origin","route","project"],d$={phaseGapMs:[50,6e5],burstGapMs:[10,6e4],attachWindowMs:[0,6e4],maxSegmentEvents:[20,1e4],occurrenceSlackMs:[0,1e3]},Bd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj");function D3(e,t){if(!Bd(e))return{problems:[`${t}: not an object`]};let r=[];for(let l of Object.keys(e))l$.includes(l)||r.push(`${t}: unknown field "${l}" ignored`);let i=e.category;if(typeof i!="string"||i.trim()==="")return{problems:[...r,`${t}: "category" must be a non-empty string \u2014 rule dropped`]};let u=i.trim();if(u.length>w3||!o$.test(u))return{problems:[...r,`${t}: category "${u.slice(0,40)}" is not a usable name (letters, digits, space . _ : / -; up to ${w3}) \u2014 rule dropped`]};let n={category:u},a=0;for(let l of["flowId","originType","origin","route","project"]){let d=e[l];if(d!==void 0){if(typeof d!="string"||d===""||d.length>b3)return{problems:[...r,`${t}: "${l}" must be a non-empty string of up to ${b3} characters \u2014 rule dropped`]};n[l]=d,a+=1}}return a===0?{problems:[...r,`${t}: "${u}" has no match field (flowId, originType, origin, route or project) \u2014 rule dropped`]}:{rule:n,problems:r}}s(D3,"tT"),o(D3,"parseRule");function $3(e){if(e==null)return Et;if(!Bd(e))return{...Et,problems:["lensmcp.flows must be an object \u2014 ignored"]};let t=[],r=[],i=e.categories;i!==void 0&&(Array.isArray(i)?(i.length>$d&&t.push(`flows.categories has ${i.length} rules; only the first ${$d} are used`),i.slice(0,$d).forEach((a,l)=>{let d=D3(a,`flows.categories[${l}]`);t.push(...d.problems),d.rule&&r.push(d.rule)})):t.push("flows.categories must be an array \u2014 ignored"));let u={},n=e.segments;if(n!==void 0)if(!Bd(n))t.push("flows.segments must be an object \u2014 ignored");else for(let[a,l]of Object.entries(n)){let d=d$[a];if(!d){t.push(`flows.segments.${a}: unknown option ignored`);continue}if(typeof l!="number"||!Number.isFinite(l)||l<d[0]||l>d[1]){t.push(`flows.segments.${a}: ${JSON.stringify(l)} is outside ${d[0]}\u2013${d[1]}; using the default (${i4[a]})`);continue}u[a]=l}return{categories:r,segments:u,problems:t}}s($3,"R$"),o($3,"parseFlowsConfig");function ts(e,t=Et){let r=c4(e,t.segments),i=g3(e,r,t.categories),u={};for(let n of r.segments)u[n.id]=v3(n,i,t.categories);return{segmentation:r,classification:i,segmentCategories:u}}s(ts,"on"),o(ts,"analyzeFlow");function xd(e,t={}){let r=t.threshold??5,i=[];for(let u of e){let n=u.raw??null;if(n?.kind!=="loop"||!n.loop)continue;let a=n.loop.dbCallsInsideLoop??0;a>r&&i.push({kind:"db-in-loop",severity:"warning",title:`${a} DB calls inside a loop (${n.loop.iterations??"?"} iterations)`,evidence:[u.id],details:{dbCallsInsideLoop:a,iterations:n.loop.iterations,durationMs:n.loop.durationMs,threshold:r},detectedAt:u.timestamp})}return i}s(xd,"Js"),o(xd,"detectDbInLoop");function B3(e,t={}){let r=t.threshold??3,i=new Map;for(let n of e){let a=n.raw??null;if(a?.kind!=="db-query"||!a.query?.signature)continue;let l=a.query.signature,d=i.get(l);d||(d=[],i.set(l,d)),d.push(n)}let u=[];for(let[n,a]of i)a.length>=r&&u.push({kind:"n+1-query",severity:"warning",title:`Query repeated ${a.length}\xD7 \u2014 likely N+1`,evidence:a.map(l=>l.id),details:{signature:n,count:a.length,threshold:r},detectedAt:a[a.length-1].timestamp});return u}s(B3,"E$"),o(B3,"detectNPlusOne");function x3(e,t={}){let r=t.threshold??5,i=t.windowMs??250,u=new Map;for(let a of e){if(a.source!=="react")continue;let l=a.raw??null;if(l?.kind!=="render"||!l.render?.componentInstanceId)continue;let d=l.render.componentInstanceId,c=u.get(d);c||(c=[],u.set(d,c)),c.push(a)}let n=[];for(let[a,l]of u){l.sort((c,p)=>c.timestamp-p.timestamp);let d=0;for(let c=0;c<l.length;c++){for(;l[c].timestamp-l[d].timestamp>i;)d++;let p=c-d+1;if(p>r){let m=l.slice(d,c+1),f=m[0].raw.render?.componentName??a;n.push({kind:"render-storm",severity:"warning",title:`${f} rendered ${p}\xD7 in ${i}ms`,evidence:m.map(h=>h.id),details:{componentInstanceId:a,count:p,windowMs:i,threshold:r},detectedAt:m[m.length-1].timestamp});break}}}return n}s(x3,"T$"),o(x3,"detectRenderStorm");function C3(e,t,r){let i=new Map,u=new Set;function n(l){let d=i.get(l);if(d)return d;if(u.has(l))return{path:[l],totalDurationMs:r(l)};u.add(l);let c=r(l),p=t.get(l)??[],m;for(let h of p){let g=n(h);(!m||g.totalDurationMs>m.totalDurationMs)&&(m=g)}u.delete(l);let f=m?{path:[l,...m.path],totalDurationMs:c+m.totalDurationMs}:{path:[l],totalDurationMs:c};return i.set(l,f),f}s(n,"i"),o(n,"best");let a={path:[],totalDurationMs:0};for(let l of e){let d=n(l);d.totalDurationMs>a.totalDurationMs&&(a=d)}return a}s(C3,"A$"),o(C3,"findSlowPath");var k3={dbInLoop:5,nPlusOne:3,renderStorm:5,slowRouteMs:500,slowRenderMs:16,slowQueryMs:100,duplicateRequestPeak:3,slowEgressMs:1e3};function Ye(e){let t={...k3};if(e)for(let r of Object.keys(k3)){let i=e[r];typeof i=="number"&&Number.isFinite(i)&&i>=0&&(t[r]=i)}return t}s(Ye,"Ee"),o(Ye,"resolveThresholds");function A3(e){let t=e.raw??null,r=t?.kind,i=e.context,u={id:e.id,parentTraceNodeId:i.causedByNodeId??i.originNodeId,lifecycle:"completed",context:i,startTime:e.timestamp,attributes:{...t??{}}};if(e.source==="react"&&r==="render"){let n=t;return{parentAxis:"render",node:{...u,type:"render",logicalId:n.render?.componentLogicalId,instanceId:n.render?.componentInstanceId,name:`render ${n.render?.componentName??"?"}`,durationMs:n.render?.actualDurationMs}}}if(e.source==="valtio"&&r==="state-update"){let n=t;return{parentAxis:"state",node:{...u,type:"state-update",logicalId:n.update?.storeId,name:`${n.update?.storeId??"?"}.${n.update?.path??"?"}`}}}if(e.source==="nestjs"&&r==="server-request"){let n=t;return{parentAxis:"backend",node:{...u,type:"server-request",name:`${n.request?.method??"?"} ${n.request?.route??"?"}`,durationMs:n.request?.durationMs}}}if(r==="db-query"){let n=t,a=[n.op,n.table].filter(Boolean).join(" ")||(n.name??"query");return{parentAxis:"backend",node:{...u,type:"db-query",logicalId:n.table?`db:${n.op??"query"}:${n.table}`:void 0,name:n.error?`${a} (failed)`:a,durationMs:n.durationMs}}}if(r==="loop")return{parentAxis:"performance",node:{...u,type:"loop",name:"loop",durationMs:t.loop?.durationMs}};if(e.source==="client-runtime"&&r==="user-action"){let n=t;return{parentAxis:"caused",node:{...u,type:"ui-event",logicalId:n.origin?.nodeId,name:n.origin?.label??e.title}}}}s(A3,"rT"),o(A3,"eventToNode");function I3(e,t){let r=[...t].sort((l,d)=>l.timestamp-d.timestamp),i=[];for(let l of r){let d=A3(l);d&&(e.addNode(d.node),i.push(d))}let u=0,n=o((l,d,c,p)=>{let m={id:`${c}:${l}->${d}`,from:l,to:d,axis:c,type:p,timestamp:e.getNode(d)?.startTime??0};e.addEdge(m),u++},"addEdge");for(let l of i){let d=l.node.context.causedByNodeId;d&&e.getNode(d)&&n(d,l.node.id,l.parentAxis??"caused","caused-by")}let a=new Map;for(let l of i){let d=l.node.context.flowId;if(!d)continue;let c=a.get(d);c||(c=[],a.set(d,c)),c.push(l)}for(let l of a.values())for(let d=1;d<l.length;d++){let c=l[d-1].node,p=l[d].node;p.context.causedByNodeId!==c.id&&n(c.id,p.id,"caused","flow-sequence")}return{nodeCount:i.length,edgeCount:u}}s(I3,"z$"),o(I3,"buildGraphFromEvents");var _3=new WeakMap;function us(e){let t=_3.get(e);if(t!==void 0)return t;let r=Xe(e);return _3.set(e,r),r}s(us,"sn"),o(us,"estimateEventBytes");function S3(e,t={}){let r=t.rawByteLimit??32768,i=t.maxDepth??12,u=e.raw;if(u==null)return{event:e,truncated:!1,originalBytes:0,keptBytes:0};if(!vd(u,r,i)){let c=Xe(u,r,i);return{event:e,truncated:!1,originalBytes:c,keptBytes:c}}let n=Xe(u,Number.POSITIVE_INFINITY,64),a={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},l=bu(u,a,i,""),d=Xe(l,Number.POSITIVE_INFINITY,i);if(a.truncatedAnything&&l!==null&&typeof l=="object"&&!Array.isArray(l)){let c={truncated:!0,originalBytes:n,keptBytes:d,paths:a.paths};l[gd]=c}return{event:{...e,raw:l},truncated:a.truncatedAnything,originalBytes:n,keptBytes:d}}s(S3,"aT"),o(S3,"clampEventRaw");function Cd(e={}){let t=0,r=0,i=0,u=e.rawByteLimit??32768;return{clamp(n){t+=1;let a=S3(n,e);return a.truncated&&(r+=1,i+=Math.max(0,a.originalBytes-a.keptBytes)),a.event},stats(){return{inspected:t,truncated:r,bytesReclaimed:i,rawByteLimit:u}},reset(){t=0,r=0,i=0}}}s(Cd,"Ws"),o(Cd,"createEventClamp");var c$={screenshot:50,"visual-crop":50,"visual-frame":200,"build-report":20,"heap-snapshot":3,"trace-with-errors":20,verification:10},p$=64*1024*1024,m$=32*1024*1024,f$=class{static{s(this,"Ks")}static{o(this,"InMemoryRingBuffer")}constructor(e={}){this.events=[],this.eventBytes=[],this.residentEventBytes=0,this.ingested=0,this.dropped=0,this.droppedForBytes=0,this.artifactsByKind=new Map,this.artifactsById=new Map,this.artifactBytesById=new Map,this.artifactOrder=[],this.residentArtifactBytes=0,this.artifactsDropped=0,this.eventCap=e.eventCap??5e3,this.eventByteCap=e.eventByteCap??p$,this.artifactCaps={...c$,...e.artifactCapacities},this.artifactByteCap=e.artifactByteCap??m$}appendEvent(e){let t=us(e);for(this.events.push(e),this.eventBytes.push(t),this.residentEventBytes+=t,this.ingested+=1,this.events.length>this.eventCap&&this.evictOldestEvents(this.events.length-this.eventCap);this.residentEventBytes>this.eventByteCap&&this.events.length>1;)this.evictOldestEvents(1),this.droppedForBytes+=1}evictOldestEvents(e){if(e<=0)return;let t=Math.min(e,this.events.length);for(let r=0;r<t;r++)this.residentEventBytes-=this.eventBytes[r]??0;this.events.splice(0,t),this.eventBytes.splice(0,t),this.dropped+=t,this.events.length===0&&(this.residentEventBytes=0)}recentEvents(e){return e===void 0||e>=this.events.length?[...this.events]:this.events.slice(this.events.length-e)}totalEventsIngested(){return this.ingested}totalEventsDropped(){return this.dropped}putArtifact(e){let t=this.artifactCaps[e.kind]??0;if(t<=0)return;let r=this.artifactsByKind.get(e.kind);r||(r=[],this.artifactsByKind.set(e.kind,r)),this.artifactsById.has(e.id)&&this.removeArtifact(e.id);let i=Xe(e.data);for(r.push(e),this.artifactsById.set(e.id,e),this.artifactBytesById.set(e.id,i),this.artifactOrder.push(e.id),this.residentArtifactBytes+=i;r.length>t;){let u=r.shift();u&&(this.forgetArtifact(u.id),this.artifactsDropped+=1)}for(;this.residentArtifactBytes>this.artifactByteCap&&this.artifactOrder.length>1;){let u=this.artifactOrder[0];if(u===void 0)break;this.removeArtifact(u),this.artifactsDropped+=1}}removeArtifact(e){let t=this.artifactsById.get(e);if(t){let r=this.artifactsByKind.get(t.kind);if(r){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}this.forgetArtifact(e)}forgetArtifact(e){this.artifactsById.delete(e),this.residentArtifactBytes-=this.artifactBytesById.get(e)??0,this.artifactBytesById.delete(e);let t=this.artifactOrder.indexOf(e);t!==-1&&this.artifactOrder.splice(t,1),this.artifactsById.size===0&&(this.residentArtifactBytes=0)}getArtifact(e){return this.artifactsById.get(e)}listArtifacts(e){return[...this.artifactsByKind.get(e)??[]]}approximateSizeBytes(){return this.residentEventBytes+this.residentArtifactBytes}stats(){let e={};for(let[t,r]of this.artifactsByKind)r.length>0&&(e[t]=r.length);return{events:{resident:this.events.length,residentBytes:this.residentEventBytes,ingested:this.ingested,dropped:this.dropped,droppedForBytes:this.droppedForBytes,cap:this.eventCap,byteCap:this.eventByteCap},artifacts:{resident:this.artifactsById.size,residentBytes:this.residentArtifactBytes,dropped:this.artifactsDropped,byteCap:this.artifactByteCap,byKind:e}}}},h$=class{static{s(this,"Xs")}static{o(this,"Session")}constructor(e={}){this.state="idle",this.hooks=[],this.reducerRetention=new Map,this.id=e.sessionId??lt(),this.storage=e.storage??new f$,this.clamp=e.clamp===!1?void 0:Cd(e.clamp??{}),this.redactor=e.redact===!1?void 0:oa(e.redact??{});let t=[this.clamp?.clamp,this.redactor?.redact].filter(r=>r!==void 0);this.bus=new Km({capacity:e.eventBusCapacity,...t.length?{transform:o(r=>t.reduce((i,u)=>u(i),r),"transform")}:{}}),this.graph=new e4,this.resources=new Qm,this.reducers=new $5,this.bus.subscribe(r=>{this.storage.appendEvent(r),this.reducers.dispatch(r)})}get lifecycle(){return this.state}storageStats(){let e=Object.fromEntries([...this.reducerRetention].map(([t,r])=>[t,r()]));return{...this.storage.stats?{storage:this.storage.stats()}:{},...this.clamp?{clamp:this.clamp.stats()}:{},...Object.keys(e).length>0?{reducers:e}:{}}}registerReducerRetention(e,t){this.reducerRetention.set(e,t)}start(){this.state==="idle"&&(this.state="active")}onShutdown(e){this.hooks.push(e)}async stop(){if(!(this.state==="closed"||this.state==="stopping")){this.state="stopping";for(let e=this.hooks.length-1;e>=0;e--){let t=this.hooks[e];try{let r=t.stop();r&&typeof r.then=="function"&&await r}catch{}}this.state="closed"}}};import{AsyncProvider as Zr,ProviderScope as Lr}from"@frontmcp/sdk";var kd;function F3(e){kd=e}s(F3,"M$"),o(F3,"setActiveSession");function Bu(){if(!kd)throw new Error("No LensMCP session is active. Did you call bootstrapLensmcp() before the FrontMCP container started?");return kd}s(Bu,"go"),o(Bu,"requireSession");var g$=Zr({provide:Pr,name:"LensmcpSession",description:"The active LensMCP Session instance.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu(),"useFactory")}),v$=Zr({provide:Ur,name:"LensmcpEventBus",description:"The session's normalised event bus.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().bus,"useFactory")}),y$=Zr({provide:OD,name:"LensmcpGraphStore",description:"The typed multi-axis trace graph.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().graph,"useFactory")}),E$=Zr({provide:Z,name:"LensmcpResourceStore",description:"Registry of agent-readable MCP resources.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().resources,"useFactory")}),b$=Zr({provide:RD,name:"LensmcpStorage",description:"Hot-tier storage backend (in-memory ring buffer by default).",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().storage,"useFactory")}),w$=[g$,v$,y$,E$,b$];function j3(e={}){let t=new h$(e);return t.start(),F3(t),{session:t,providers:w$}}s(j3,"P$"),o(j3,"bootstrapLensmcp");var D_=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g"),$_=["ai/agents/hazard-analyst/src/hazard-analyst.agent.ts(52,12): error TS2416: Property 'outputSchema' in type 'HazardAnalystAgent' is not assignable to the same property in base type 'BaseAgent<HazardInput, HazardOutput>'.","server/apps/haccp/src/modules/plan/plan.service.ts(118,7): error TS2322: Type 'string' is not assignable to type 'PlanStatus'.","web/libs/ui/src/report/report-renderer.tsx(9,3): warning TS6133: {0} is declared but its value is never read."].join(`
|
|
66
|
-
`);import{createSocket as
|
|
67
|
-
`))!==-1;){let c=a.slice(0,d);a=a.slice(d+1),c&&e.onMessage(c)}a.length>i&&(t(new Error(`uds: frame exceeded ${i} bytes without a newline \u2014 connection dropped`)),a="",n.destroy())}),n.on("error",l=>t(l)),n.on("close",()=>r.delete(n))});return u.on("error",n=>t(n)),u.listen(e.path,()=>e.onListening?.()),u.unref(),{close:o(()=>new Promise(n=>{for(let a of r)try{a.destroy()}catch{}r.clear();try{u.close(()=>{try{
|
|
68
|
-
`))!==-1;){let D=h.slice(0,y);if(h=h.slice(y+1),g){g=!1;continue}a(D)}}finally{$$(k)}}},"drain"),e.pollMs??50);$.unref?.(),l.push(()=>clearInterval($))}if(r){let[f,h]=r.split(":"),g=Number(h);if(f&&Number.isFinite(g)){c=!0;let b;try{b=D$("udp4"),b.on("message",x=>a(x.toString("utf8"))),b.on("error",x=>u(x)),b.bind(g,f),b.unref()}catch(x){u(x),c=!1}if(b){let x=b;l.push(()=>new Promise($=>{try{x.close(()=>$())}catch{$()}}))}}}if(i)try{let f=R3({path:i,onMessage:o(h=>a(h),"onMessage"),onError:u});p=!0,l.push(()=>f.close())}catch(f){u(f)}let m=[];return d&&m.push("file"),c&&m.push("udp"),p&&m.push("uds"),{mode:m.join("+")||"none",count:o(()=>n,"count"),async stop(){for(let f of l)try{await f()}catch{}}}}s(T3,"Om"),o(T3,"startEventIngest");import{existsSync as A$,readFileSync as P3}from"node:fs";import{dirname as I$,join as _$}from"node:path";function U3(e=process.cwd()){let t=Ad("nx.json",e);if(!t)return Ye();try{let r=JSON.parse(P3(t,"utf8"));return Ye(r.lensmcp?.thresholds)}catch{return Ye()}}s(U3,"Mm"),o(U3,"loadWorkspaceThresholds");function q3(e=process.cwd()){let t=Ad("nx.json",e);if(!t)return Et;try{let r=JSON.parse(P3(t,"utf8"));return $3(r.lensmcp?.flows)}catch(r){return{...Et,problems:[`${t} could not be read as JSON (${r instanceof Error?r.message:String(r)}) \u2014 flow config ignored`]}}}s(q3,"Nm"),o(q3,"loadWorkspaceFlowsConfig");function Ad(e,t){let r=t;for(let i=0;i<8;i++){let u=_$(r,e);if(A$(u))return u;let n=I$(r);if(n===r)break;r=n}}s(Ad,"B$"),o(Ad,"findUp");function F(e,t,r,i){var u=arguments.length,n=u<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(n=(u<3?a(n):u>3?a(t,r,n):a(t,r))||n);return u>3&&n&&Object.defineProperty(t,r,n),n}s(F,"$"),o(F,"__decorate");import{App as S$}from"@frontmcp/sdk";import{Resource as F$,ResourceContext as j$}from"@frontmcp/sdk";import{existsSync as z$,readFileSync as N$}from"node:fs";import{dirname as M$,join as O$}from"node:path";var Le="perf://rules",Zt="pod/heap-budget",Lt="pod/retained-generation",Z3=512,L3=.9,R$=64,T$=16,P$=16,V3=256,J3=1024*1024,U$="LENSMCP_PERF_RULES",q$="LENSMCP_POD_HEAP_BUDGET_MB",Z$={heapBudgetEnabled:!0,retainedEnabled:!0,budgetMb:Z3,services:{}},L$=/^(0|off|false|no)$/i,Id=o(e=>{let t=typeof e=="string"&&e.trim()!==""?Number(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>=16&&t<=1e6?t:void 0},"budget");function rs(e,t){let r=t&&typeof t=="object"&&!Array.isArray(t)?t:{},i=r[Zt]&&typeof r[Zt]=="object"?r[Zt]:{},u=r[Lt]&&typeof r[Lt]=="object"?r[Lt]:{},n=L$.test((e[U$]??"").trim())||r.enabled===!1,a={};if(i.services&&typeof i.services=="object"&&!Array.isArray(i.services))for(let[l,d]of Object.entries(i.services)){let c=Id(d);c!==void 0&&(a[l]=c)}return{heapBudgetEnabled:!n&&i.enabled!==!1,retainedEnabled:!n&&u.enabled!==!1,budgetMb:Id(e[q$])??Id(i.budgetMb)??Z3,services:a}}s(rs,"Hs"),o(rs,"resolvePodRuleThresholds");function W3(e=process.cwd(),t=process.env){let r=e;for(let i=0;i<8;i++){let u=O$(r,".lensmcp","config.json");if(z$(u))try{let a=JSON.parse(N$(u,"utf8"));return rs(t,a?.perfRules)}catch{return rs(t,void 0)}let n=M$(r);if(n===r)break;r=n}return rs(t,void 0)}s(W3,"Um"),o(W3,"loadPodRuleThresholds");var Vr=o((e,t,r)=>`${e}\0${t}\0${r}`,"key"),Ve=o(e=>Math.round(e/J3),"mb"),_d=0,V$=o(()=>(_d=(_d+1)%65535,`perf-${Date.now().toString(36)}${_d.toString(36)}${Math.random().toString(36).slice(2,7)}`),"eventId"),J$=class{static{s(this,"yo")}static{o(this,"PerfRuleBook")}constructor(e={}){this.options=e,this.findings=new Map,this.pods=new Map,this.heard=!1,this.thresholds=e.thresholds??Z$,this.now=e.now??Date.now}ingest(e){return e.source==="perf"?this.ingestRule(e):e.source==="memory"?this.ingestPod(e):!1}ingestRule(e){let t=u3(e.raw);if(!t||t.rule.startsWith("pod/"))return!1;let r=!this.heard;if(this.heard=!0,t.kind==="perf-rule-scan"){let n=!1,a=new Set(t.open);for(let[l,d]of this.findings)d.rule===t.rule&&d.project===t.project&&!a.has(d.subject)&&(this.findings.delete(l),n=!0);return n||r}let i=Vr(t.rule,t.project,t.subject);if(t.kind==="perf-rule-retracted")return this.findings.delete(i)||r;let u=this.findings.get(i);return this.findings.set(i,{rule:t.rule,project:t.project,subject:t.subject,severity:t.severity,title:t.title,summary:t.summary,evidence:t.evidence,cost:t.cost,fix:t.fix,verify:t.verify,docs:t.docs,firstSeenAt:u?.firstSeenAt??e.timestamp,lastSeenAt:Math.max(e.timestamp,u?.lastSeenAt??0)}),this.bound(),!0}projectPods(e,t,r){let i=this.pods.get(e);if(!i&&(i={service:t,lastSeenAt:r,readings:new Map,retained:new Map},this.pods.set(e,i),this.pods.size>R$)){let u=[...this.pods.entries()].sort((n,a)=>n[1].lastSeenAt-a[1].lastSeenAt)[0];u&&u[0]!==e&&(this.pods.delete(u[0]),this.close(Vr(Zt,u[0],u[1].service),"evicted",r),this.close(Vr(Lt,u[0],u[1].service),"evicted",r))}return i.service=t||i.service,i.lastSeenAt=Math.max(i.lastSeenAt,r),i}ingestPod(e){let t=Gn(e.raw);if(!t)return!1;let r=e.timestamp,i=this.projectPods(t.project,t.service||t.project,r),u=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory"){if(t.previousAlive!==!0&&i.readings.set(u,this.reading(t,r)),t.trigger==="boot"){for(let d of[...i.readings.keys()])d.startsWith(`${t.pod}:`)&&d!==u&&i.readings.delete(d);for(let d of[...i.retained.keys()])d.startsWith(`${t.pod}:`)&&!d.startsWith(`${u}:`)&&i.retained.delete(d)}if(i.readings.size>T$){let d=[...i.readings.entries()].sort((c,p)=>c[1].at-p[1].at)[0];d&&i.readings.delete(d[0])}}else if(t.kind==="pod-memory-retained"){i.retained.set(`${u}:${t.gen}`,this.retainedOf(t,r));let d=[...i.retained.keys()].filter(c=>c.startsWith(`${u}:`));d.length>P$&&i.retained.delete(d[0])}else if(t.kind==="pod-memory-released")i.retained.delete(`${u}:${t.gen}`);else if(t.kind==="pod-memory-exited"){i.readings.delete(u);for(let d of[...i.retained.keys()])d.startsWith(`${u}:`)&&i.retained.delete(d)}let n=!this.heard;this.heard=!0;let a=this.evaluateHeap(t.project,i,r),l=this.evaluateRetained(t.project,i,r);return a||l||n}reading(e,t){return{pod:e.pod,pid:e.pid,service:e.service||e.project,at:e.at??t,trigger:e.trigger,gen:e.gen,swaps:e.swaps,live:e.live,reserved:e.reserved,rss:e.rss,...e.baseline!==void 0?{baseline:e.baseline}:{}}}retainedOf(e,t){return{pod:e.pod,pid:e.pid,gen:e.gen,at:t,ageMs:e.ageMs,swapsSinceClose:e.swapsSinceClose,gcs:e.gcs,alive:Array.isArray(e.alive)?e.alive.slice(0,8):[],...e.counts?{counts:e.counts}:{},live:e.live}}budgetFor(e,t){return this.thresholds.services[t]??this.thresholds.services[e]??this.thresholds.budgetMb}related(e){return[...this.findings.values()].filter(t=>t.project===e&&!t.rule.startsWith("pod/")).map(t=>`${t.rule}: ${t.title}`)}evaluateHeap(e,t,r){let i=t.service,u=Vr(Zt,e,i),n=this.findings.get(u);if(!this.thresholds.heapBudgetEnabled)return n?this.close(u,"disabled",r):!1;let a=this.budgetFor(e,t.service),l=a*J3,d=[...t.readings.values()].sort((g,b)=>b.live-g.live),c=d.filter(g=>g.live>l),p=d.some(g=>g.live>l*L3);if(c.length===0&&!(n&&p))return n?this.close(u,d.length?"cleared":"pod-exited",r):!1;if(c.length===0)return!1;let m=c[0],f=c.reduce((g,b)=>g+(b.live-l),0),h={rule:Zt,project:e,subject:i,severity:m.live>=2*l?"error":"warning",title:`${t.service}: ${Ve(m.live)} MB live heap after a full GC \u2014 over its ${a} MB budget${c.length>1?` (${c.length} pods)`:""}`,summary:`Pod #${m.pod} of ${t.service} holds ${Ve(m.live)} MB of live objects right after a full GC (${Ve(m.reserved)} MB reserved, rss ${Ve(m.rss)} MB${m.baseline!==void 0?`; ${Ve(m.baseline)} MB at boot`:""}, generation ${m.gen} after ${m.swaps} swap${m.swaps===1?"":"s"}). That is not garbage: it is what the app keeps, in every pod of the service.`,evidence:{budgetMb:a,pods:c.map(g=>({pod:g.pod,pid:g.pid,liveMb:Ve(g.live),reservedMb:Ve(g.reserved),rssMb:Ve(g.rss),...g.baseline!==void 0?{baselineMb:Ve(g.baseline)}:{},gen:g.gen,swaps:g.swaps,trigger:g.trigger,at:g.at})),related:this.related(e)},cost:{bytes:f,memoryMb:Ve(f),basis:`live heap after a full GC above the ${a} MB budget, summed over the pods over it`},fix:[`See what the heap is made of: \`memory.explain_pod({ service: '${t.service}' })\`, then \`lensmcp mem ${t.service} --snapshot --analyze\` \u2014 read "bytes by package/module" and the largest retainers.`,`If one shared library dominates (FoodGuard: ~300 MB of zod schemas per pod from a contracts barrel), import it by subpath \u2014 see any bundle/heavy-barrel-import finding for ${e} \u2014 and build large schema catalogs lazily (a function that builds on first use), not at module load.`,"If the bundle text dominates (eval strings, source maps), keep the default `eval` devtool and no `--enable-source-maps` (LENSMCP_DEV_DEVTOOL unset).",`If the heap grows with each swap or request, it is retention, not size: look for module-level caches, registries and listeners that outlive a request (\`memory.explain_leak\`). A service that genuinely needs more raises its budget: \`.lensmcp/config.json\` perfRules["pod/heap-budget"].services["${t.service}"].`],verify:`After the change rebuilds and the pod swaps, its next post-GC report (\`memory.pods\`) shows live heap under ${Math.round(a*L3)} MB and LensMCP retracts this finding (\`observe_current_status\` no longer lists pod/heap-budget for ${t.service}).`,docs:e3[Zt],firstSeenAt:n?.firstSeenAt??r,lastSeenAt:r};return this.open(u,h,n)}evaluateRetained(e,t,r){let i=t.service,u=Vr(Lt,e,i),n=this.findings.get(u),a=[...t.retained.values()].sort((p,m)=>m.ageMs-p.ageMs);if(!this.thresholds.retainedEnabled||a.length===0)return n?this.close(u,this.thresholds.retainedEnabled?"released":"disabled",r):!1;let l=a[0],d=Math.max(1,Math.round(l.ageMs/6e4)),c={rule:Lt,project:e,subject:i,severity:"warning",title:`${t.service}: ${a.length===1?`generation ${l.gen} is`:`${a.length} closed generations are`} still in memory ${d} min after the hot swap that closed ${a.length===1?"it":"them"}`,summary:`Pod #${l.pod} closed generation ${l.gen} ${d} min ago, ${l.swapsSinceClose} swap(s) and ${l.gcs} full GC(s) since, and ${l.alive.join(", ")||"its objects"} ${l.alive.length===1?"is":"are"} still alive: something still points into the old app \u2014 a whole copy of it stays resident with every swap that leaks.`,evidence:{generations:a.slice(0,8).map(p=>({pod:p.pod,pid:p.pid,gen:p.gen,ageMs:p.ageMs,swapsSinceClose:p.swapsSinceClose,gcs:p.gcs,alive:p.alive,...p.counts?{counts:p.counts}:{},liveMb:Ve(p.live)}))},cost:{basis:"one copy of the app per retained generation; its size is in the heap snapshot (`lensmcp mem --snapshot --analyze`)"},fix:[`Find what holds it: \`lensmcp mem ${t.service} --snapshot --analyze\` prints the shortest path from the GC roots to generation ${l.gen} \u2014 the first frame outside your app's own objects is the culprit.`,"Usual culprits: a timer or interval never cleared on shutdown; a BullMQ worker, queue event or Redis client never closed in onModuleDestroy / onApplicationShutdown; `process.on(\u2026)` / an EventEmitter listener added per app instance; a module-level registry, cache or singleton keyed by class or holding app instances.","Release it in the app's shutdown hooks (Nest calls them on every hot swap), or move the module-level state into a provider the container owns."],verify:'Save a file to swap again; within ~5 min the pod reports "generation N freed" (`memory.pods`), LensMCP retracts this finding, and `memory://leaks/suspected` no longer lists the generation.',docs:e3[Lt],firstSeenAt:n?.firstSeenAt??r,lastSeenAt:r};return this.open(u,c,n)}open(e,t,r){return this.findings.set(e,t),this.bound(),(!r||r.title!==t.title||r.severity!==t.severity)&&this.emit(t,"finding"),!0}close(e,t,r){let i=this.findings.get(e);return i?(this.findings.delete(e),this.emit({...i,lastSeenAt:r},"retracted",t),!0):!1}emit(e,t,r){let i=this.options.publish;if(!i)return;let u=this.options.sessionId??"pending",n=this.now(),a={id:V$(),sessionId:u,timestamp:n,source:"perf",category:"performance",severity:t==="finding"?e.severity:"info",context:{sessionId:u,projectName:e.project},fingerprint:t3(e.rule,e.project,e.subject),title:t==="finding"?`${e.rule}: ${e.title}`:`${e.rule}: cleared for ${e.project} (${e.subject})`,raw:t==="finding"?{kind:"perf-rule-finding",rule:e.rule,project:e.project,subject:e.subject,severity:e.severity,title:e.title,summary:e.summary,evidence:e.evidence,cost:e.cost,fix:e.fix,verify:e.verify,docs:e.docs,detectedAt:n}:{kind:"perf-rule-retracted",rule:e.rule,project:e.project,subject:e.subject,reason:r??"cleared",at:n}};queueMicrotask(()=>{try{i(a)}catch{}})}bound(){if(this.findings.size<=V3)return;let e=[...this.findings.entries()].sort((t,r)=>t[1].lastSeenAt-r[1].lastSeenAt).slice(0,this.findings.size-V3);for(let[t]of e)this.findings.delete(t)}openFindings(){return[...this.findings.values()].sort((e,t)=>e.severity===t.severity?t.lastSeenAt-e.lastSeenAt:e.severity==="error"?-1:1)}report(e){let t=this.openFindings(),r={};for(let i of t)r[i.rule]=(r[i.rule]??0)+1;return{schemaVersion:1,revision:e,updatedAt:new Date(this.now()).toISOString(),producer:this.heard?"connected":"none",detail:this.heard?t.length?`${t.length} open performance finding${t.length===1?"":"s"}: ${Object.entries(r).map(([i,u])=>`${u} ${i}`).join(", ")}`:"no open performance findings":"no performance rule has reported yet \u2014 rules run after a dev-cluster compilation (bundle/*) and on pod memory reports (pod/*); start the gateway",findings:t,counts:r}}};function G3(e,t=700){let r=e.fix.map((i,u)=>`${u+1}) ${i}`).join(" ");return r.length>t?`${r.slice(0,t-40).trimEnd()}\u2026 (all steps: ${Le})`:r}s(G3,"Lm"),o(G3,"compactFix");var K3=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord"),H3=o(e=>Array.isArray(e)?e.length:void 0,"arrayLen"),bt=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"asCount"),Te=o(e=>typeof e=="string"?e:void 0,"asString");function pe(e,...t){for(let r of t){let i=H3(e[r])??bt(e[r]);if(i!==void 0)return i}}s(pe,"me"),o(pe,"countOf");var fe=o((e,t,r=`${t}s`)=>`${e} ${e===1?t:r}`,"plural");function is(e,t,r,i,u){if(t>0)return{state:"failed",count:t,detail:`${fe(t,`${i} error`)} \u2014 read ${u}`};if(r>0)return{state:"warning",count:r,detail:fe(r,`${i} warning`)};let n=Te(e.status);return n==="clean"||n==="passed"?{state:"passed",count:0,detail:`${i} clean`}:{state:"unknown",detail:`${i} has not reported a result yet (status=${n??"absent"})`}}s(is,"Fm"),o(is,"fromStatusField");var ns=[{kind:"typecheck",resource:"typecheck://current",reads:o(()=>["typecheck://errors"],"reads"),blocking:!0,source:"typescript",read:o(e=>is(e,pe(e,"errorCount","errors")??0,0,"typecheck","typecheck://errors"),"read")},{kind:"lint",resource:"lint://current",reads:o(e=>e==="warning"?["lint://warnings"]:["lint://errors"],"reads"),blocking:!0,source:"eslint",read:o(e=>is(e,pe(e,"errorCount","errors")??0,pe(e,"warningCount","warnings")??0,"lint","lint://errors"),"read")},{kind:"build",resource:"build://current",reads:o(e=>e==="warning"?["build://current"]:["build://failures"],"reads"),blocking:!0,source:"vite",read:o(e=>{let t=Array.isArray(e.failures)?e.failures.filter(u=>{let n=u?.domain;return n!=="typecheck"&&n!=="lint"}).length:pe(e,"failures","failureCount")??0,r=(H3(e.failures)??t)-t,i=t===0&&r>0&&Te(e.status)==="failing"?{...e,status:"clean"}:e;return is(i,t,pe(e,"warnings","warningCount")??0,"build","build://failures")},"read")},{kind:"runtime",resource:"runtime://browser/errors",reads:o(()=>["runtime://browser/errors","runtime://browser/failed-requests"],"reads"),blocking:!0,source:"client-runtime",read:o(e=>{let t=pe(e,"count","entries")??0;return t>0?{state:"failed",count:t,detail:`${fe(t,"browser runtime error")} \u2014 read runtime://browser/errors`}:{state:"unknown",count:0,detail:"no browser runtime errors recorded (a browser may never have connected)"}},"read")},{kind:"runtime",resource:"runtime://errors",reads:o(()=>["runtime://errors"],"reads"),blocking:!0,source:"nestjs",read:o(e=>{let t=pe(e,"count","entries")??0;return t>0?{state:"failed",count:t,detail:`${fe(t,"server-side error")} \u2014 read runtime://errors (route, status, request id and stack)`}:{state:"unknown",count:0,detail:"no server-side errors recorded (no pod may have handled a request yet)"}},"read")},{kind:"cluster",resource:"process://cluster",reads:o(()=>["process://cluster"],"reads"),blocking:!0,source:"gateway",read:o(e=>{if((pe(e,"services")??0)===0)return{state:"unknown",detail:"no cluster lifecycle events seen (the gateway may not be running)"};let t=pe(e,"crashLooping")??0,r=pe(e,"wedged")??0,i=pe(e,"buildFailed")??0,u=pe(e,"typeErrors")??0,n=u>0?`${fe(u,"service")} with type errors no typecheck producer reports`:void 0,a=pe(e,"down")??0,l=bt(e.restarts)??0,d=Array.isArray(e.services)?e.services.filter(h=>{let g=h??{};return g.buildFailed===!0&&g.state==="up"}).length:0,c=Math.max(0,i-d),p=d>0?`${fe(d,"service")} failing to build while still serving the last good bundle`:void 0,m=[p,n?`${n} (still serving)`:void 0].filter(Boolean);if(t>0||r>0||c>0){let h=[t>0?`${fe(t,"service")} crash-looping`:void 0,r>0?`${fe(r,"service")} wedged`:void 0,c>0?`${fe(c,"service")} failing to build`:void 0].filter(Boolean);return{state:"failed",count:t+r+i+u,detail:`${h.join(", ")} \u2014 read process://cluster (requests to them 502)${m.length?`; ${m.join("; ")}`:""}`}}if(p)return{state:"failed",count:i+u,detail:`${p} \u2014 read process://cluster for the error lines${n?`; ${n} (still serving)`:""}`};if(n)return{state:"failed",count:u,detail:`${n} \u2014 read process://cluster for the lines (the bundle built; the services still serve)`};if(a>0)return{state:"warning",count:a,detail:`${fe(a,"service")} down (idle scale-to-zero is normal; the next request restarts it)`};let f=pe(e,"up")??0;return{state:"passed",count:0,detail:`${fe(f,"service")} up${l>0?`, ${fe(l,"restart")} this session`:""}`}},"read")},{kind:"memory",resource:"memory://leaks/suspected",reads:o(()=>["memory://leaks/suspected","memory://owners/growing"],"reads"),blocking:!1,source:"memory",read:o(e=>{let t=pe(e,"suspected","leaks")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"suspected leak")} \u2014 read memory://leaks/suspected`}:{state:"passed",count:0,detail:"no suspected leaks"}},"read")},{kind:"visual",resource:"visual://violations/current",reads:o(()=>["visual://violations/current"],"reads"),blocking:!1,source:"visual",read:o(e=>{let t=pe(e,"violations")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"visual violation")} \u2014 read visual://violations/current`}:{state:"passed",count:0,detail:"no visual violations"}},"read")},{kind:"perf",resource:"perf://slow-routes",reads:o(()=>["perf://slow-routes"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"routes")??0,r=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"route")} over${r?` ${r}ms`:" the slow-route threshold"} \u2014 read perf://slow-routes`}:{state:"passed",count:0,detail:"no slow routes"}},"read")},{kind:"duplicate-requests",resource:"perf://duplicate-requests",reads:o(()=>["perf://duplicate-requests"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"endpoints")??0,r=bt(e.peakThreshold);return t>0?{state:"warning",count:t,detail:`${fe(t,"endpoint")} called ${r?`\u2265${r}\xD7`:"several times"} concurrently by one page \u2014 read perf://duplicate-requests`}:{state:"passed",count:0,detail:"no duplicated requests"}},"read")},{kind:"db",resource:"db://slow-queries",reads:o(()=>["db://slow-queries","db://analysis"],"reads"),blocking:!1,source:"db",read:o(e=>{let t=pe(e,"queries")??0,r=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"query shape")} over${r?` ${r}ms`:" the slow-query threshold"} \u2014 read db://slow-queries`}:{state:"passed",count:0,detail:"no slow query shapes"}},"read")},{kind:"egress",resource:"net://egress/hosts",reads:o(e=>e==="warning"?["net://egress/hosts","net://egress/failures"]:["net://egress/hosts"],"reads"),blocking:!1,source:"external",read:o(e=>{let t=pe(e,"failingHosts")??0,r=pe(e,"slowHosts")??0,i=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"external host")} failing \u2014 read net://egress/failures`}:r>0?{state:"warning",count:r,detail:`${fe(r,"external host")} over${i?` ${i}ms`:" the slow-egress threshold"} \u2014 read net://egress/hosts`}:{state:"passed",count:0,detail:"no failing or slow external calls"}},"read")},{kind:"perf-rules",resource:Le,reads:o(()=>[Le],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"findings")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"performance finding")} \u2014 read ${Le} (each has a fix and a verify step)`}:{state:"passed",count:0,detail:"no open performance findings"}},"read"),items:o(e=>{let t=(Array.isArray(e.findings)?e.findings:[]).map(K3).filter(i=>!!i),r=t.slice(0,Sd).map(i=>{let u=Te(i.rule)??"perf",n=Te(i.project)??"?",a=Te(i.subject)??"?",l=Array.isArray(i.fix)?i.fix.filter(d=>typeof d=="string"):[];return{source:"perf",severity:"warning",title:`${u} \xB7 ${Te(i.title)??n}`,fingerprint:`agent-status:perf-rule:${u}:${n}:${a}`,resource:Le,rule:u,...l.length?{fix:G3({fix:l})}:{},...Te(i.verify)?{verify:Te(i.verify)}:{},...Te(i.docs)?{docs:Te(i.docs)}:{}}});return t.length>Sd&&r.push({source:"perf",severity:"warning",title:`${fe(t.length-Sd,"more performance finding")} \u2014 read ${Le}`,fingerprint:"agent-status:perf-rules:more",resource:Le}),r},"items")}],Sd=5,X3=new WeakMap,N_=ns.map(e=>e.resource);async function Y3(e,t){let r={kind:t.kind,resource:t.resource},i;try{i=K3(await e.read(t.resource))}catch{return{...r,producer:"none",state:"unknown",detail:`no producer for ${t.resource} \u2014 this signal is unmonitored, not healthy`,reads:t.reads("unknown")}}if(!i)return{...r,producer:"none",state:"unknown",detail:`${t.resource} produced no readable payload`,reads:t.reads("unknown")};let u=Te(i.producer),n=(e.revision(t.resource)??0)>0,a=u==="none"?"none":u==="connected"||n?"connected":"none",l=Te(i.detail);if(a==="none")return{...r,producer:a,state:"unknown",detail:l??(u==="none"?`${t.resource} reports no producer attached \u2014 this signal is unmonitored, not healthy`:`${t.resource} is registered but has never reported \u2014 this signal is unmonitored, not healthy`),reads:t.reads("unknown")};let d;try{d=t.read(i)}catch{d={state:"unknown",detail:`${t.resource} payload could not be interpreted`}}let c=i.stale===!0,p=c?`${d.detail} (as of ${bt(i.ageMs)!==void 0?Q3(bt(i.ageMs)):"a while ago"}; nothing has re-checked since)`:d.detail,m={...r,producer:a,state:d.state,...d.count===void 0?{}:{count:d.count},...c?{stale:!0}:{},detail:p,reads:t.reads(d.state)};if(t.items&&(d.state==="warning"||d.state==="failed"))try{let f=t.items(i);f.length&&X3.set(m,f)}catch{}return m}s(Y3,"ZT"),o(Y3,"readSignal");function Q3(e){return e<6e4?`${Math.max(1,Math.round(e/1e3))}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(Q3,"qT"),o(Q3,"describeAge");async function Fd(e){return Promise.all(ns.map(t=>Y3(e,t)))}s(Fd,"Qs"),o(Fd,"readSignals");var Jr=o(e=>ns.find(t=>t.resource===e.resource)??ns.find(t=>t.kind===e.kind),"specFor");function e6(e){return{source:Jr(e).source,severity:e.state==="failed"?"error":"warning",title:e.detail,fingerprint:`agent-status:${e.kind}:${e.state}`,resource:e.reads[0]??e.resource}}s(e6,"VT"),o(e6,"toItem");function t6(e){let t={failed:3,warning:2,unknown:1,passed:0},r=o(n=>{let a=e.filter(l=>l.kind===n);return a.length===0?"unknown":a.reduce((l,d)=>t[d.state]>t[l]?d.state:l,a[0].state)},"pick"),i=o(n=>n==="failed"?"failed":n==="passed"||n==="warning"?"passed":"unknown","tri"),u=o(n=>n,"quad");return{typecheck:i(r("typecheck")),lint:i(r("lint")),build:i(r("build")),runtime:u(r("runtime")),visual:u(r("visual")),memory:u(r("memory"))}}s(t6,"GT"),o(t6,"toChecks");function u6(e){let t=e.filter(p=>p.state==="failed"),r=e.filter(p=>p.state==="warning"),i=e.filter(p=>p.state==="passed"),u=o(p=>X3.get(p)??[e6(p)],"itemsOf"),n=t.filter(p=>Jr(p).blocking).flatMap(u),a=[...t.filter(p=>!Jr(p).blocking),...r].flatMap(u),l=n.length>0?"failing":a.length>0?"warning":i.length>0?"clean":"starting",d=[...t.filter(p=>Jr(p).blocking).flatMap(p=>p.reads),...t.filter(p=>!Jr(p).blocking).flatMap(p=>p.reads),...r.flatMap(p=>p.reads)],c=[...new Set(d)];return c.length===0&&c.push("events://recent"),{status:l,blocking:n,warnings:a,suggestedReads:c,checks:t6(e)}}s(u6,"X$"),o(u6,"deriveVerdict");function r6(e=process.env){let t=e.LENSMCP_TRANSPORT==="http"||e.LENSMCP_TRANSPORT==="socket",r=e.LENSMCP_PORT;return{mode:t?"shared":"embedded",pid:process.pid,startedAt:new Date(Date.now()-Math.round(process.uptime()*1e3)).toISOString(),...t&&r?{url:`http://127.0.0.1:${r}/mcp`}:{}}}s(r6,"JT"),o(r6,"readServerInfo");async function ss(e){let t=await Fd(e.resources),r=u6(t);return{schemaVersion:1,revision:e.revision,updatedAt:new Date().toISOString(),sessionId:e.sessionId,server:r6(),status:r.status,blocking:r.blocking,warnings:r.warnings,suggestedReads:r.suggestedReads,checks:r.checks,signals:t}}s(ss,"ar"),o(ss,"aggregateStatus");var jd="agent://current-status",zd=class extends j${static{s(this,"qm")}static{o(this,"AgentCurrentStatusResource")}async execute(){let e=this.get(Z);try{return await e.read(jd)}catch{}let t=this.get(Pr);return ss({resources:e,sessionId:t.id,revision:e.revision(jd)??0})}};zd=F([F$({name:"agent-current-status",uri:jd,mimeType:"application/json",description:'Workspace health in one read: status (clean/warning/failing/starting), what is BLOCKING (typecheck/lint/build errors, browser runtime errors, wedged or crash-looping services), warnings, and the exact resources to read next. Signals with no producer report `producer: "none"` \u2014 unmonitored, not healthy.'})],zd);var W$=zd;import{Resource as G$,ResourceContext as K$}from"@frontmcp/sdk";var Nd=class extends K${static{s(this,"Gm")}static{o(this,"ProcessClusterResource")}async execute(){return this.get(Z).read("process://cluster")}};Nd=F([G$({name:"process-cluster",uri:"process://cluster",mimeType:"application/json",description:"Dev-cluster service health: which services are up / down / wedged / crash-looping, which fail to build, restart counts, and the error lines services printed (ERROR in, EADDRINUSE, and error TS\u2026 for a project no typecheck producer reports for \u2014 otherwise type errors are in typecheck://errors). Read this when a request 502s or a dev server stopped responding."})],Nd);var H$=Nd;import{Resource as X$,ResourceContext as Y$}from"@frontmcp/sdk";var Md=class extends Y${static{s(this,"Wm")}static{o(this,"PerfRulesResource")}async execute(){return this.get(Z).read("perf://rules")}};Md=F([X$({name:"perf-rules",uri:"perf://rules",mimeType:"application/json",description:"Performance problems the lens detected by rule, each with a stable rule id, the measured evidence, the estimated cost (modules / MB / compile ms), the FIX steps and a VERIFY step: bundle/heavy-barrel-import (a service compiles most of a shared library through its root barrel while using a few symbols), pod/heap-budget (a dev pod's live heap after GC is over its budget), pod/retained-generation (a hot-swapped app copy is still in memory). A finding is retracted when the next build or memory report no longer shows it \u2014 that is how to prove a fix."})],Md);var Q$=Md;import{Tool as eB,ToolContext as tB}from"@frontmcp/sdk";var i6=["typecheck","lint","build","runtime","cluster"],uB=[...i6,"all"],rB={typecheck:[{signal:"typecheck://current",resource:"typecheck://errors",keys:["errors"],hint:"TypeScript diagnostics from the watching tsc. Already computed \u2014 no need to run `nx typecheck`."}],lint:[{signal:"lint://current",resource:"lint://errors",keys:["errors"],hint:"ESLint errors from the watching lint pass. Already computed \u2014 no need to run `nx lint`."}],build:[{signal:"build://current",resource:"build://failures",keys:["failures"],hint:"Bundler/compile failures. The dev server is serving a stale or broken bundle until these clear."}],runtime:[{signal:"runtime://browser/errors",resource:"runtime://browser/errors",keys:["entries"],hint:"Uncaught errors from the browser. Pair with flow_list_recent to see what the user did first."},{signal:"runtime://errors",resource:"runtime://errors",keys:["entries"],hint:"Errors a dev service raised while handling a request (a 500 from a curl, an e2e runner or the page) \u2014 route, status, request id and stack. No browser is involved."}],cluster:[{signal:"process://cluster",resource:"process://cluster",keys:["errors"],hint:"Error lines printed by dev services (ERROR in / EADDRINUSE; error TS only for a project no typecheck producer reports for). A wedged or crash-looping service 502s every request routed to it."}]},iB=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord");async function n6(e,t){let r;try{r=iB(await e.read(t.resource))}catch{return[]}if(!r)return[];for(let i of t.keys){let u=r[i];if(Array.isArray(u))return u}return[]}s(n6,"rA"),o(n6,"readItems");async function s6(e){let t=e.kind==="all"?i6:[e.kind],r=await Fd(e.resources),i=new Map(r.map(n=>[n.resource,n])),u=[];for(let n of t)for(let a of rB[n]){let l=i.get(a.signal),d=l?.producer??"none",c=l?.state??"unknown",p=d==="none"?[]:await n6(e.resources,a);u.push({kind:n,resource:a.resource,producer:d,state:c,count:p.length,returned:Math.min(p.length,e.limit),items:p.slice(0,e.limit),detail:l?.detail??`no producer for ${a.resource} \u2014 unmonitored, not healthy`,hint:a.hint})}return{kind:e.kind,totalErrors:u.reduce((n,a)=>n+a.count,0),unmonitored:[...new Set(u.filter(n=>n.producer==="none").map(n=>n.kind))],groups:u}}s(s6,"Ym"),o(s6,"collectErrors");var a6={name:"observe.current_status",description:'Workspace health in one call: whether anything is BLOCKING right now (typecheck errors, lint errors, build failures, browser runtime errors, wedged or crash-looping dev services), plus warnings and the exact resources to read next. Warnings include PERFORMANCE problems found by rule (a service compiling a whole shared library through its root barrel, a dev pod over its heap budget, a hot-swapped app copy still in memory), each with its rule id, a fix and how to verify it. Call this FIRST when a build, dev server, or page looks broken \u2014 and before running `nx typecheck` / `nx lint` for a project the dev cluster already watches, because those results are already computed here. Signals reporting `producer: "none"` are UNMONITORED, not healthy. Use observe.errors for the individual error items.'},Vt={name:"observe.errors",description:"The actual error items the lens already computed: TypeScript diagnostics, ESLint errors, build failures, uncaught browser errors, server-side request errors (a dev service's 500: route, status, stack), and error lines printed by dev services (ERROR in\u2026, error TS\u2026, EADDRINUSE). Filter with `kind`. Prefer this over running `nx typecheck` / `nx lint` or tailing a dev-server log for a project the dev cluster watches: the watching producers already have the answer, so this costs one call instead of a rebuild. Each group reports `producer` \u2014 `none` means nothing is feeding that check, so an empty list there is NOT proof it is clean.",kinds:uB,defaultKind:"all",defaultLimit:25,maxLimit:200},as={name:"observe.dismiss_errors",description:"Hide runtime errors that are already UNDERSTOOD and are not a problem to fix \u2014 a 401 your own signed-out test browser caused, a failure from a fixture that exists to throw \u2014 so they stop counting in observe.current_status and the Stop hook. Give the entry `ids` from observe.errors (kind `runtime`), or `all: true`, and a `reason`: it is recorded with the dismissal and shown to the person in the dashboard. This HIDES, it does not fix: each error shows again the next time it happens. It cannot dismiss a failing typecheck, lint, build or a broken service \u2014 those are current verdicts and clear only when the code is fixed. Never dismiss an error you have not explained; undo with observe.restore_errors.",maxIds:250,minReasonChars:8},Od={name:"observe.restore_errors",description:"Undo a dismissal, so the errors it hid are listed and counted again. Give the dismissal `ids` from runtime://dismissed (or the id of an entry it hid), or `all: true` for every dismissal in effect \u2014 including ones a person made in the dashboard.",maxIds:250},o6="agent://current-status",Rd=class extends tB{static{s(this,"eh")}static{o(this,"ObserveCurrentStatusTool")}async execute(){let e=this.get(Z);try{return await e.read(o6)}catch{}let t=this.get(Pr);return ss({resources:e,sessionId:t.id,revision:e.revision(o6)??0})}};Rd=F([eB({name:a6.name,description:a6.description,inputSchema:{}})],Rd);var nB=Rd;import{Tool as sB,ToolContext as aB,z as l6}from"@frontmcp/sdk";var Td=class extends aB{static{s(this,"rh")}static{o(this,"ObserveErrorsTool")}async execute(e){let t=this.get(Z);return s6({resources:t,kind:e.kind,limit:e.limit})}};Td=F([sB({name:Vt.name,description:Vt.description,inputSchema:{kind:l6.enum(Vt.kinds).default(Vt.defaultKind).describe("Which failures to return. 'runtime' = browser errors AND a service's own request errors (the 500 case); 'cluster' = dev-service/pod errors (the 502 case). Default 'all'."),limit:l6.number().int().positive().max(Vt.maxLimit).default(Vt.defaultLimit).describe(`Max items per kind (default ${Vt.defaultLimit}). \`count\` still reports the true total.`)}})],Td);var oB=Td;import{Tool as lB,ToolContext as dB,z as Wr}from"@frontmcp/sdk";import{appendFileSync as cB,closeSync as pB,mkdirSync as mB,openSync as fB,renameSync as hB,statSync as gB,unlinkSync as vB}from"node:fs";import{dirname as yB,join as EB}from"node:path";function d6(e,t){let{fs:r,maxBytes:i,maxFiles:u}=t,n=`${e}.rotate.lock`,a=t.staleLockMs??3e4,l;for(let d=0;d<2&&l===void 0;d++)try{l=r.openSync(n,"wx")}catch{try{if(Date.now()-r.statSync(n).mtimeMs<=a)return"busy";r.unlinkSync(n)}catch{}}if(l===void 0)return"busy";try{try{if(r.statSync(e).size<=i)return"not-needed"}catch{return"not-needed"}try{r.unlinkSync(`${e}.${u}`)}catch{}for(let d=u-1;d>=1;d--)try{r.renameSync(`${e}.${d}`,`${e}.${d+1}`)}catch{}try{r.renameSync(e,`${e}.1`)}catch{}return"rotated"}finally{try{r.closeSync(l)}catch{}try{r.unlinkSync(n)}catch{}}}s(d6,"Q$"),o(d6,"rotateBusFile");function c6(e=process.env,t=process.cwd()){return e.LENSMCP_EVENT_FILE??EB(t,".lensmcp","events.jsonl")}s(c6,"t_"),o(c6,"lensEventFile");var p6=o((e,t,r,i,u)=>({id:lt(),sessionId:e,timestamp:t,source:Q1,category:"runtime",severity:"info",context:{sessionId:e},fingerprint:r,title:i,raw:u}),"lensEvent");function Pd(e,t){return p6(t,e.until,`${wu}:${e.groupId}`,`error dismissed: ${e.title??e.groupId}`,{kind:wu,groupId:e.groupId,until:e.until,eventIds:e.eventIds,...e.by?{by:e.by}:{},...e.reason?{reason:e.reason}:{},...e.title?{title:e.title}:{}})}s(Pd,"ta"),o(Pd,"dismissalEvent");function Ud(e,t,r){return p6(t,r,`${Wn}:${e}`,"error restored",{kind:Wn,groupId:e})}s(Ud,"ra"),o(Ud,"restoralEvent");var m6=o((e,t,r)=>{let i=Number(process.env[e]);return Number.isFinite(i)&&r(i)?i:t},"envNumber");function os(e,t){t.length!==0&&(mB(yB(e),{recursive:!0}),d6(e,{maxBytes:m6("LENSMCP_EVENT_MAX_BYTES",50*1024*1024,r=>r>0),maxFiles:m6("LENSMCP_EVENT_MAX_FILES",5,r=>r>=1&&r<=20),fs:{statSync:gB,renameSync:hB,unlinkSync:vB,openSync:fB,closeSync:pB}}),cB(e,t.map(r=>JSON.stringify(r)+`
|
|
69
|
-
`).join("")))}s(os,"an"),o(os,"appendBusEvents");var
|
|
70
|
-
`))!==-1;){let n=r.slice(0,u);r=r.slice(u+1),t(n)}}),e.on("end",()=>{r.length&&t(r)})}s(Wd,"l_"),o(Wd,"bufferLines");var $6=class{static{s(this,"fh")}static{o(this,"AgentApp")}};$6=F([S$({id:"agent",name:"Agent",description:"Agent-facing summary, suggested reads, verification.",resources:[W$,H$,Q$],tools:[nB,oB,$B,CB],jobs:[RB]})],$6);var TB={"service-starting":"starting","service-respawn":"starting","lens-app-up":"starting","service-up":"up","cold-start":"up","service-down":"down","idle-kill":"idle","service-recycle":"wedged","pod-recycle":"wedged","service-crash-loop":"crash-looping","lens-handoff-complete":"up","gateway-up":"up","gateway-down":"down","lens-child-starting":"starting","lens-child-up":"up","lens-child-exit":"down"},PB=new Set(["service-respawn","service-recycle","pod-recycle","lens-handoff-complete"]),B6=new Set(["build","types","process"]),x6=o(e=>B6.has(e)?e:"unknown","faultOf"),UB=class{static{s(this,"$o")}static{o(this,"ClusterHealth")}constructor(){this.services=new Map,this.errors=[],this.typechecked=new Set}ingest(e){if(e.category==="typecheck")return this.noteTypecheck(e);if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw??{},r=typeof t.kind=="string"?t.kind:void 0;if(!r)return!1;let i=typeof t.project=="string"?t.project:void 0;if(!i)return!1;if(r==="service-error"){let a=x6(t.fault),l=this.touch(i,e.timestamp);if(l.faults.add(a),l.lastTitle=e.title,a==="types"&&this.typechecked.has(i))return!0;let d=typeof t.line=="string"?t.line:e.message??e.title;return this.errors.push({project:i,timestamp:e.timestamp,line:d,fingerprint:e.fingerprint,fault:a}),this.errors.length>50&&this.errors.splice(0,this.errors.length-50),!0}if(r==="service-fault-closed"){let a=this.services.get(i),l=Array.isArray(t.closed)?t.closed.filter(d=>B6.has(d)).map(x6):[];return!a||l.length===0?!1:(a.lastSeenAt=e.timestamp,a.lastTitle=e.title,this.resolve(a,l),!0)}if(r==="service-recovered"){let a=this.services.get(i);return a?(a.lastSeenAt=e.timestamp,this.resolve(a),a.lastTitle=e.title,!0):!1}if(r==="lens-handoff-start"){let a=this.touch(i,e.timestamp);return t.oldServing!==!0&&(a.state="starting"),a.lastTitle=e.title,!0}if(r==="lens-handoff-failed"){let a=this.touch(i,e.timestamp);return t.oldKept!==!0&&(a.state="down"),a.lastTitle=e.title,!0}let u=TB[r];if(!u)return!1;let n=this.touch(i,e.timestamp);return n.state=u,n.lastTitle=e.title,PB.has(r)&&(n.restarts+=1),u==="up"&&this.resolve(n),!0}resolve(e,t){if(t)for(let i of t)e.faults.delete(i);else e.faults.clear();let r=o(i=>i.project===e.project&&(!t||t.includes(i.fault)),"gone");this.errors.splice(0,this.errors.length,...this.errors.filter(i=>!r(i)))}noteTypecheck(e){let t=e.raw??{};if(t.kind!=="typecheck-run"||t.phase!=="end"||typeof t.project!="string")return!1;let r=t.project,i=t.status==="clean"||t.status==="failing";return i===this.typechecked.has(r)?!1:(i?(this.typechecked.size>=100&&this.typechecked.delete(this.typechecked.values().next().value),this.typechecked.add(r),this.errors.splice(0,this.errors.length,...this.errors.filter(u=>!(u.project===r&&u.fault==="types")))):this.typechecked.delete(r),this.services.get(r)?.faults.has("types")??!1)}snapshot(){let e=[...this.services.values()].sort((r,i)=>r.project.localeCompare(i.project)).map(({faults:r,...i})=>({...i,buildFailed:r.has("build")||r.has("process")||r.has("unknown"),typeErrors:r.has("types")&&!this.typechecked.has(i.project)})),t=o(r=>e.filter(i=>i.state===r).map(i=>i.project),"byState");return{services:e,up:t("up"),down:t("down"),wedged:t("wedged"),crashLooping:t("crash-looping"),idle:t("idle"),buildFailed:e.filter(r=>r.buildFailed).map(r=>r.project),typeErrors:e.filter(r=>r.typeErrors).map(r=>r.project),restarts:e.reduce((r,i)=>r+i.restarts,0),errors:this.errors.slice()}}touch(e,t){let r=this.services.get(e);if(!r){if(this.services.size>=100){let i;for(let u of this.services.values())(!i||u.lastSeenAt<i.lastSeenAt)&&(i=u);i&&this.services.delete(i.project)}r={project:e,state:"starting",restarts:0,faults:new Set,lastTitle:"",lastSeenAt:t},this.services.set(e,r)}return r.lastSeenAt=t,r}},ds="agent://current-status",cs="process://cluster",qB=250,ZB=new Set(["build","lint","typecheck","runtime","cluster","memory","visual","performance"]);function C6(e){let t=new UB,r=e.sessionId??"pending",i=new J$({thresholds:e.podRules??W3(),sessionId:r,publish:o(d=>e.bus.publish(d),"publish")}),u,n=o(()=>{u||(u=setTimeout(()=>{u=void 0,e.resources.markDirty(ds)},qB),u.unref?.())},"scheduleStatusRefresh"),a=o(d=>{let c=t.ingest(d);c&&e.resources.markDirty(cs);let p=i.ingest(d);p&&e.resources.markDirty(Le),(c||p||ZB.has(d.category))&&n()},"handler"),l=e.bus.subscribe(a);return e.resources.register(cs,()=>({schemaVersion:1,revision:e.resources.revision(cs)??0,updatedAt:new Date().toISOString(),...t.snapshot()})),e.resources.register(Le,()=>i.report(e.resources.revision(Le)??0)),e.resources.register(ds,()=>ss({resources:e.resources,sessionId:r,revision:e.resources.revision(ds)??0})),{unsubscribe:o(()=>{l(),u&&(clearTimeout(u),u=void 0)},"unsubscribe"),uris:[ds,cs,Le]}}s(C6,"mh"),o(C6,"installAgentReducer");import{App as LB}from"@frontmcp/sdk";import{Resource as VB,ResourceContext as JB}from"@frontmcp/sdk";var Gd=class extends JB{static{s(this,"hh")}static{o(this,"FlowRecentResource")}async execute(){return this.get(Z).read("flow://recent")}};Gd=F([VB({name:"flow-recent",uri:"flow://recent",mimeType:"application/json",description:"Last 50 flows seen this session, most recent first."})],Gd);var WB=Gd;import{Resource as GB,ResourceContext as KB}from"@frontmcp/sdk";var Kd=class extends KB{static{s(this,"vh")}static{o(this,"FlowCurrentResource")}async execute(){return this.get(Z).read("flow://current")}};Kd=F([GB({name:"flow-current",uri:"flow://current",mimeType:"application/json",description:"The most recently active flow (origin + event count + headline)."})],Kd);var HB=Kd;import{Resource as XB,ResourceContext as YB}from"@frontmcp/sdk";var Hd=class extends YB{static{s(this,"bh")}static{o(this,"FlowOriginsRecentResource")}async execute(){return this.get(Z).read("flow://origins/recent")}};Hd=F([XB({name:"flow-origins-recent",uri:"flow://origins/recent",mimeType:"application/json",description:"Last 50 flow-origin events (one per detected flow start)."})],Hd);var QB=Hd;import{Tool as e2,ToolContext as t2,z as ps}from"@frontmcp/sdk";var k6;function Xd(e){k6=e}s(Xd,"sa"),o(Xd,"setActiveFlowLookups");function Qe(){return k6}s(Qe,"ke"),o(Qe,"activeFlowLookups");var A6;function Yd(e){A6=e}s(Yd,"aa"),o(Yd,"setFlowRecoverySource");function Qd(){return A6}s(Qd,"_o"),o(Qd,"flowRecoverySource");import{existsSync as u2}from"node:fs";import{open as r2}from"node:fs/promises";import{basename as i2}from"node:path";var ms="flow://recent",fs="flow://current",hs="flow://origins/recent",xu=50,I6=50,ec=2e3,n2=4*1024*1024,tc=32*1024*1024,s2=xu+10;function uc(e){let t={flows:new Map,origins:[],recentOrder:[],retainedEvents:0,retainedBytes:0,evictedEvents:0,evictedForBytes:0,evictedFlows:0},r=e.register??!0,i=o((m,f,h,g=!0)=>{let b=Math.min(f,m.events.length);if(b<=0)return;if(g&&b>0&&(m.events[0]?.raw??{}).kind==="flow-origin"&&m.events.length>1){let $=m.eventBytes[1]??0;if(m.events.splice(1,1),m.eventBytes.splice(1,1),m.retainedBytes=Math.max(0,m.retainedBytes-$),t.retainedEvents=Math.max(0,t.retainedEvents-1),t.retainedBytes=Math.max(0,t.retainedBytes-$),t.evictedEvents+=1,h&&(t.evictedForBytes+=1),b-=1,b<=0)return}let x=0;for(let $=0;$<b;$+=1)x+=m.eventBytes[$]??0;m.events.splice(0,b),m.eventBytes.splice(0,b),m.retainedBytes=Math.max(0,m.retainedBytes-x),t.retainedEvents=Math.max(0,t.retainedEvents-b),t.retainedBytes=Math.max(0,t.retainedBytes-x),t.evictedEvents+=b,h&&(t.evictedForBytes+=b)},"evictPrefix"),u=o(m=>{let f=0,h=m.retainedBytes;for(;h>n2&&f<m.eventBytes.length;)h-=m.eventBytes[f]??0,f+=1;i(m,f,!0)},"enforceEntryByteCap"),n=o(()=>{for(let m=t.recentOrder.length-1;t.retainedBytes>tc&&m>=0;m-=1){let f=t.flows.get(t.recentOrder[m]);if(!f)continue;let h=0,g=t.retainedBytes;for(;g>tc&&h<f.eventBytes.length;)g-=f.eventBytes[h]??0,h+=1;i(f,h,!0)}},"enforceGlobalByteCap"),a=o(m=>{let f=m.context.flowId;if(!f)return;let h=(m.raw??{}).kind;if(h==="subscription-added"||h==="subscription-removed"||h==="hook-run"||h==="store-created"||h==="singleton-instance"||h==="visual-frame")return;let g=h==="flow-origin";(t.seenSince===void 0||m.timestamp<t.seenSince)&&(t.seenSince=m.timestamp);let b=t.flows.get(f);if(!b){b={summary:{flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,startedAt:m.timestamp,lastSeenAt:m.timestamp,eventCount:0,headline:m.title},events:[],eventBytes:[],retainedBytes:0,hasOrigin:!1},t.flows.set(f,b);let w={flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,at:m.timestamp,label:m.title,eventId:m.id};t.origins.push(w),t.origins.length>I6&&t.origins.splice(0,t.origins.length-I6),e.resources.markDirty(hs)}g&&!b.hasOrigin&&(b.hasOrigin=!0,b.summary.headline=m.title,m.context.originType&&(b.summary.originType=m.context.originType),m.context.originNodeId&&(b.summary.originNodeId=m.context.originNodeId)),m.timestamp<b.summary.startedAt&&(b.summary.startedAt=m.timestamp);let x=us(m);b.events.push(m),b.eventBytes.push(x),b.retainedBytes+=x,t.retainedEvents+=1,t.retainedBytes+=x,b.events.length>ec&&i(b,b.events.length-ec,!1),u(b),b.summary.eventCount+=1,b.summary.lastSeenAt=m.timestamp;let $=t.recentOrder.indexOf(f);if($>=0&&t.recentOrder.splice($,1),t.recentOrder.unshift(f),t.recentOrder.length>xu){let w=t.recentOrder.splice(xu);for(let k of w){let C=t.flows.get(k);C&&(t.evictedFlows+=1,t.evictedThrough=Math.max(t.evictedThrough??0,C.summary.lastSeenAt),i(C,C.events.length,!1,!1)),t.flows.delete(k)}}n(),t.currentFlowId!==f&&(t.currentFlowId=f,e.resources.markDirty(fs)),e.resources.markDirty(ms)},"handler"),l=e.bus.subscribe(a);e.resources.register(ms,()=>({schemaVersion:1,revision:e.resources.revision(ms)??0,updatedAt:new Date().toISOString(),flows:t.recentOrder.map(m=>t.flows.get(m)?.summary).filter(m=>!!m)})),e.resources.register(fs,()=>{let m=t.currentFlowId,f=m?t.flows.get(m):void 0;return{schemaVersion:1,revision:e.resources.revision(fs)??0,updatedAt:new Date().toISOString(),flow:f?.summary??null}}),e.resources.register(hs,()=>({schemaVersion:1,revision:e.resources.revision(hs)??0,updatedAt:new Date().toISOString(),origins:t.origins.slice().reverse()}));let d=e.flows??Et,c=new Map,p={getFlowEvents(m){return t.flows.get(m)?.events.slice().sort((f,h)=>f.timestamp-h.timestamp)},getFlowSummary(m){return t.flows.get(m)?.summary},recentFlowIds(){return t.recentOrder.slice()},findFlowsByOrigin(m){return[...t.flows.values()].filter(f=>f.summary.originNodeId===m).map(f=>f.summary)},flowsConfig:d,analyzeFlow(m){let f=t.flows.get(m);if(!f)return;let h=`${f.summary.eventCount}:${f.events.length}:${f.summary.lastSeenAt}`,g=c.get(m);if(g&&g.key===h)return c.delete(m),c.set(m,g),g.analysis;let b=ts(p.getFlowEvents(m)??[],d);for(c.delete(m),c.set(m,{key:h,analysis:b});c.size>s2;)c.delete(c.keys().next().value);return b},classifiedRecent(m=xu){let f=[];for(let h of t.recentOrder){if(f.length>=m)break;let g=t.flows.get(h)?.summary,b=p.analyzeFlow(h);!g||!b||f.push({summary:g,category:b.classification.category,decidedBy:b.classification.decidedBy,...b.classification.subject?{subject:b.classification.subject}:{},tags:b.classification.tags,segmentCount:b.segmentation.stats.segments,phaseCount:b.segmentation.stats.phases,signalCount:b.segmentation.stats.signal})}return f},window(){return{since:(t.evictedThrough!==void 0?Math.max(t.evictedThrough,t.seenSince??0):t.seenSince)??null,flows:t.flows.size,maxFlows:xu,evicted:t.evictedFlows}}};return r&&Xd(p),{unsubscribe:o(()=>{r&&Xd(void 0),l()},"unsubscribe"),uris:[ms,fs,hs],lookups:p,retentionStats:o(()=>({residentEvents:t.retainedEvents,residentBytes:t.retainedBytes,evictedEvents:t.evictedEvents,evictedForBytes:t.evictedForBytes,eventCap:xu*ec,byteCap:tc}),"retentionStats")}}s(uc,"ko"),o(uc,"installFlowReducer");var rc={maxBytes:320*1024*1024,maxMs:2e3};function _6(e=process.env){let t=Number(e.LENSMCP_FLOW_RECOVER_BYTES??""),r=Number(e.LENSMCP_FLOW_RECOVER_MS??""),i=o(u=>(e[u]??"").trim()!=="","set");return{maxBytes:i("LENSMCP_FLOW_RECOVER_BYTES")&&Number.isFinite(t)&&t>=0?t:rc.maxBytes,maxMs:i("LENSMCP_FLOW_RECOVER_MS")&&Number.isFinite(r)&&r>0?r:rc.maxMs}}s(_6,"Ih"),o(_6,"recoveryBudgetFromEnv");var S6=1024*1024,ic=10;function F6(e,t){let r=[e];for(let i=1;i<=t;i++)r.push(`${e}.${i}`);return r.filter(i=>u2(i))}s(F6,"YA"),o(F6,"busFiles");function j6(e,t){try{let r=JSON.parse(e);return!r||typeof r!="object"||!("id"in r)||!("source"in r)?void 0:r.context?.flowId===t?r:void 0}catch{return}}s(j6,"QA"),o(j6,"eventOf");function z6(e,t,r,i){let u=e.indexOf(t);for(;u!==-1;){let n=e.lastIndexOf(ic,u)+1,a=e.indexOf(ic,u),l=j6(e.toString("utf8",n,a),r);l&&i.push(l),u=e.indexOf(t,a+1)}}s(z6,"ej"),o(z6,"collect");async function N6(e,t,r,i,u){let n=[],a={file:i2(e),size:0,read:0,matched:0},l;try{l=await r2(e,"r")}catch{return{searched:a,events:n}}let d=o(c=>(a.matched=n.length,{searched:a,events:n,...c?{stoppedBy:c}:{}}),"done");try{a.size=(await l.stat()).size;let c=Buffer.allocUnsafe(S6),p=Buffer.alloc(0);for(;a.read<a.size;){if(a.read>=i)return d("bytes");if(Date.now()>=u)return d("time");let m=Math.min(S6,a.size-a.read,i-a.read),{bytesRead:f}=await l.read(c,0,m,a.read);if(f<=0)break;a.read+=f;let h=p.length>0?Buffer.concat([p,c.subarray(0,f)]):c.subarray(0,f),g=h.lastIndexOf(ic);g>=0&&z6(h.subarray(0,g+1),t,r,n),p=Buffer.from(h.subarray(g+1))}}finally{await l.close().catch(()=>{})}return d()}s(N6,"tj"),o(N6,"searchFile");async function M6(e,t,r){let i=Date.now(),u=i+r.maxMs,n=Buffer.from(JSON.stringify(t)),a=[],l=[],d=0,c;for(let p of F6(e.eventFile,e.maxGenerations??20)){let m=await N6(p,n,t,r.maxBytes-d,u);if(a.push(m.searched),d+=m.searched.read,l.push(m.events),m.stoppedBy){c=m.stoppedBy;break}let f=l.some(g=>g.length>0),h=m.events.some(g=>g.raw?.kind==="flow-origin");if(f&&(h||m.events.length===0))break}return{events:l.reverse().flat(),files:a,bytesRead:d,elapsedMs:Date.now()-i,...c?{stoppedBy:c}:{}}}s(M6,"rj"),o(M6,"findFlowOnBus");var a2=4,Gr=new Map,nc=new Map;function O6(e,t){let r=new Km,i=uc({bus:r,resources:new Qm,...t.flows?{flows:t.flows}:{},register:!1});for(let u of e)r.publish(t.prepare(u));return i.unsubscribe(),i.lookups}s(O6,"oj"),o(O6,"replay");var R6="There is no bus file to search (LENSMCP_EVENT_FILE is not set for this server).",o2="Searching the bus files is turned off (LENSMCP_FLOW_RECOVER_BYTES=0).";function sc(e,t,r,i=R6){let u=`This server holds the ${t.maxFlows} most recently active flows${t.since!==null?` (every flow active since ${new Date(t.since).toISOString()})`:""}, and on start replays only the recent tail of the bus \u2014 this id is not among them.`,n=r?`Its search of the bus files ran out of budget (${r.stoppedBy==="time"?`${r.budgetMs} ms`:`${r.budgetBytes} bytes`}) before finding the flow.`:i;return{found:!1,flowId:e,reason:"outside-window",window:t,...r?{searched:r}:{},hint:`${u} ${n} The flow may still exist further back: re-run it to capture it fresh, raise LENSMCP_FLOW_RECOVER_BYTES / LENSMCP_FLOW_RECOVER_MS, or search .lensmcp/events.jsonl* for the id.`}}s(sc,"b_"),o(sc,"outsideWindow");async function T6(e,t,r,i,u){let n=await M6(r,t,i);if(n.events.length>0){let a=O6(n.events,r);if(!a.getFlowSummary(t))return{found:!1,flowId:t};let l={lookups:a,recovered:{from:"bus",files:n.files.filter(d=>d.matched>0).map(d=>d.file),events:n.events.length,complete:n.stoppedBy===void 0}};for(Gr.set(u,l);Gr.size>a2;)Gr.delete(Gr.keys().next().value);return l}if(n.stoppedBy){let a={files:n.files,bytes:n.bytesRead,budgetBytes:i.maxBytes,budgetMs:i.maxMs,stoppedBy:n.stoppedBy};return sc(t,e.window(),a)}return{found:!1,flowId:t}}s(T6,"sj"),o(T6,"search");async function ac(e,t,r){if(e.getFlowSummary(t))return{lookups:e};let i=r?.budget??rc;if(!r||i.maxBytes<=0){let l=e.window();return l.evicted>0?sc(t,l,void 0,r?o2:R6):{found:!1,flowId:t}}let u=`${r.eventFile}\0${t}`,n=Gr.get(u);if(n)return n;let a=nc.get(u);return a||(a=T6(e,t,r,i,u).finally(()=>nc.delete(u)),nc.set(u,a)),a}s(ac,"Rh"),o(ac,"locateFlow");var l2=120;function oc(e,t,r){return{id:e.id,kind:e.kind,label:e.label,category:t,phase:e.phase,startOffsetMs:Math.max(0,e.start-r),durationMs:e.durationMs,events:e.counts.total,signal:e.counts.signal,errors:e.counts.errors,worstSeverity:e.worstSeverity,projects:e.projects,...e.route?{route:e.route}:{},...e.method?{method:e.method}:{},...e.part?{part:e.part}:{},...e.hot?{hot:e.hot}:{},...e.after?{after:e.after}:{},...e.sql?{sql:e.sql}:{}}}s(oc,"Eh"),o(oc,"segmentView");function lc(e,t={}){let{segmentation:r,classification:i,segmentCategories:u}=e,n=Math.max(1,t.maxSegments??l2),a=r.segments.reduce((c,p)=>Math.min(c,p.start),1/0),l=Number.isFinite(a)?a:0,d=r.segments;if(d.length>n){let c=o(m=>m.counts.errors*1e6+m.counts.signal,"rank"),p=new Set([...d].sort((m,f)=>c(f)-c(m)||(m.id<f.id?-1:1)).slice(0,n).map(m=>m.id));d=d.filter(m=>p.has(m.id))}return{flowId:r.flowId,category:i.category,decidedBy:i.decidedBy,...i.subject?{subject:i.subject}:{},tags:i.tags,origin:i.origin,stats:{events:r.stats.events,signal:r.stats.signal,bookkeeping:r.stats.bookkeeping,segments:r.stats.segments,phases:r.stats.phases},phases:r.phases.map(c=>({index:c.index,startOffsetMs:Math.max(0,c.start-l),endOffsetMs:Math.max(0,c.end-l),segmentIds:c.segmentIds})),segments:d.map(c=>oc(c,u[c.id]??"other",l)),segmentsTruncated:d.length<r.segments.length,...r.sql?{sql:r.sql}:{}}}s(lc,"Th"),o(lc,"overviewOf");function P6(e,t,r){let i=t.segmentation.segments.find(n=>n.id===r);if(!i)return;let u=new Set(i.eventIds);return e.filter(n=>u.has(n.id))}s(P6,"w_"),o(P6,"eventsOfSegment");function U6(e,t){return e.filter(r=>(t.category===void 0||r.category===t.category)&&(t.tag===void 0||r.tags.includes(t.tag))&&(t.subject===void 0||r.subject===t.subject))}s(U6,"x_"),o(U6,"filterClassified");function q6(e){let t=e.map(r=>({category:r.category,...r.subject?{subject:r.subject}:{},id:r.summary.flowId}));return y3(t).map(r=>({category:r.category,count:r.count,subjects:r.subjects.map(i=>({...i.subject!==void 0?{subject:i.subject}:{},count:i.count,flowIds:i.items.map(u=>u.id)}))}))}s(q6,"$_"),o(q6,"groupClassified");function Z6(e){let t={};for(let r of e)t[r.category]=(t[r.category]??0)+1;return t}s(Z6,"__"),o(Z6,"categoryCounts");async function L6(e,t,r){if(!e)return dc(e,t);let i=await ac(e,t.flowId,r);if(!("lookups"in i))return i;let u=dc(i.lookups,t);return i.recovered?{...u,recovered:i.recovered}:u}s(L6,"I_"),o(L6,"readFlowDetail");function dc(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.getFlowSummary(t.flowId),i=e.getFlowEvents(t.flowId);if(!r||!i)return{found:!1,flowId:t.flowId};let u=e.analyzeFlow(t.flowId);if(t.segmentId){let a=u?P6(i,u,t.segmentId):void 0,l=u?.segmentation.segments.find(p=>p.id===t.segmentId);if(!u||!a||!l)return{found:!1,flowId:t.flowId,segmentId:t.segmentId,reason:"unknown segment id for this flow (the flow may have changed \u2014 re-read overview.segments)",segmentIds:u?.segmentation.segments.map(p=>p.id)??[]};let d=u.segmentation.segments.reduce((p,m)=>Math.min(p,m.start),1/0),{events:c}=Hn(a,{includeRaw:t.includeRaw});return{found:!0,summary:r,segment:oc(l,u.segmentCategories[l.id]??"other",Number.isFinite(d)?d:l.start),truncated:c.length>t.limit,events:c.slice(0,t.limit)}}let{events:n}=Hn(i,{includeRaw:t.includeRaw});if(t.expand){let a=n.find(c=>c.id===t.expand);if(!a)return{found:!1,flowId:t.flowId,expand:t.expand};let l=new Set(a.memberIds??[a.id]),d=i.filter(c=>l.has(c.id));return{found:!0,flowId:t.flowId,expanded:{id:a.id,title:a.title,count:d.length},events:d.map(c=>({id:c.id,timestamp:c.timestamp,source:c.source,category:c.category,severity:c.severity,title:c.title,message:c.message,...t.includeRaw?{raw:c.raw}:{}}))}}return{found:!0,summary:r,...u?{overview:lc(u)}:{},truncated:n.length>t.limit,events:n.slice(0,t.limit)}}s(dc,"k_"),o(dc,"getFlowDetail");async function V6(e,t,r){if(e){let u=e.classifiedRecent(),n=U6(u,{...t.category?{category:t.category}:{},...t.tag?{tag:t.tag}:{}}),a=n.slice(0,t.limit);return{flows:a.map(l=>({...l.summary,category:l.category,decidedBy:l.decidedBy,...l.subject?{subject:l.subject}:{},tags:l.tags,segmentCount:l.segmentCount,phaseCount:l.phaseCount,signalCount:l.signalCount})),totalKnown:u.length,matching:n.length,categories:Z6(u),...t.groupBy==="category"?{groups:q6(a)}:{}}}let i=await r();return{flows:i.flows.slice(0,t.limit),totalKnown:i.flows.length}}s(V6,"R_"),o(V6,"listRecentFlows");async function J6(e,t,r){if(!e)return cc(e,t);let i=await ac(e,t.flowId,r);if(!("lookups"in i))return i;let u=cc(i.lookups,t);return i.recovered?{...u,recovered:i.recovered}:u}s(J6,"E_"),o(J6,"readFlowSegments");function cc(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.analyzeFlow(t.flowId);return r?{found:!0,...lc(r,{maxSegments:t.maxSegments})}:{found:!1,flowId:t.flowId}}s(cc,"S_"),o(cc,"getFlowSegments");var pc=class extends t2{static{s(this,"Ah")}static{o(this,"FlowListRecentTool")}async execute(e){return V6(Qe(),e,async()=>await this.get(Z).read("flow://recent"))}};pc=F([e2({name:"flow.list_recent",description:'Lists the last N flows with their origin + event count + headline, and what each one IS: `category` (page-load, user-action, api, ai, test, or one you defined in nx.json#lensmcp.flows), `subject` (the templated page, component or route), `tags` (fan-out, has-error, slow, storm\u2026), `segmentCount`/`phaseCount`. Filter with `category` / `tag`; pass `groupBy: "category"` to also get the flows grouped category \u2192 subject; `categories` always counts every known flow per category. Same data as flow://recent but with a tunable limit.',inputSchema:{limit:ps.number().int().positive().max(50).default(10).describe("How many flows to return (default 10, max 50)."),category:ps.string().optional().describe('Only flows in this category, e.g. "page-load" or "checkout".'),tag:ps.string().optional().describe('Only flows carrying this tag, e.g. "has-error" or "fan-out".'),groupBy:ps.enum(["none","category"]).default("none").describe('"category" adds `groups`: the returned flows grouped category \u2192 subject.')}})],pc);var d2=pc;import{Tool as c2,ToolContext as p2,z as Kr}from"@frontmcp/sdk";var mc=class extends p2{static{s(this,"zh")}static{o(this,"FlowGetTool")}async execute(e){return L6(Qe(),e,Qd())}};mc=F([c2({name:"flow.get",description:'Returns one flow as the ordered, parented mechanism tree the dashboard renders: each node has `parent`, `area`, `start`, `durationMs`, and repeated work is collapsed (`count`, `memberIds`). Pass `expand: "<node id>"` to list the individual events a collapsed node stands for, or `includeRaw: true` for the full `event.raw` payloads. The response also carries `overview`: the flow cut into segments (one backend request each, UI bursts, the origin) grouped into phases, with its category, subject and tags \u2014 for a big flow read that first, then pass `segmentId: "<segment id>"` to get just that unit as a mechanism tree. Before summing SQL counts or time, read `overview.sql`: db-query events are flood-guarded per query shape, so only `status: "complete"` means they are every statement; `gaps` names the requests that fall short and by how much. Each request\'s verdict carries `basis`: `end` (accounted when the request ended) or `settled` (a quiet-period snapshot that later SQL in the same context could still change); `overview.sql.settled` counts the verdicts resting on one. A flow this server no longer holds in memory (it keeps the 50 most recently active, and replays only the recent tail of the bus on start) is read back from the bus files on demand: the same answer, plus `recovered` (`files`, `events`, and `complete: false` when older events may be missing). `found: false` alone means no event of this id is retained anywhere the server can read; `reason: "outside-window"` means it may exist further back than the server can see (`window`, `searched`, `hint`) \u2014 re-run the flow rather than concluding it never happened.',inputSchema:{flowId:Kr.string().describe("Flow id from flow://recent."),includeRaw:Kr.boolean().default(!1),limit:Kr.number().int().positive().max(500).default(200),expand:Kr.string().optional().describe("A node id from a previous call: returns the individual events it collapsed."),segmentId:Kr.string().optional().describe("A segment id from `overview.segments` (or flow.segments): returns only that unit of the flow, shaped like the whole.")}})],mc);var m2=mc;import{Tool as f2,ToolContext as h2,z as g2}from"@frontmcp/sdk";var fc=class extends h2{static{s(this,"Mh")}static{o(this,"FlowFindByOriginTool")}async execute(e){let t=Qe();if(!t)return{found:!1,reason:"no active flow reducer"};let r=t.findFlowsByOrigin(e.originNodeId);return{found:r.length>0,count:r.length,flows:r}}};fc=F([f2({name:"flow.find_by_origin",description:"Returns all flows whose origin node id matches `originNodeId` (e.g. a data-agent-component target).",inputSchema:{originNodeId:g2.string().describe("Origin node id \u2014 usually the value of data-agent-component on the originating element.")}})],fc);var v2=fc;import{Tool as y2,ToolContext as E2,z as b2}from"@frontmcp/sdk";import*as w2 from"node:fs";import{dirname as D2,join as W6}from"node:path";var $2="ai",B2=/^ai_[0-9a-z]{8,40}$/,gs=o(e=>typeof e=="string"&&B2.test(e),"isAiCallId");function G6(e){return W6(D2(e),$2)}s(G6,"yj"),o(G6,"aiContentDir");function K6(e,t){if(!gs(t))throw new Error("invalid ai call id");return W6(G6(e),`${t}.json`)}s(K6,"bj"),o(K6,"aiContentFile");function hc(e,t){if(gs(t))try{let r=JSON.parse(w2.readFileSync(K6(e,t),"utf8"));return r&&r.schemaVersion===1&&r.id===t?r:void 0}catch{return}}s(hc,"pa"),o(hc,"readAiContent");var gc=class extends E2{static{s(this,"Ph")}static{o(this,"AiGetCallTool")}async execute(e){if(!gs(e.callId))return{found:!1,reason:"invalid call id"};let t=hc(process.env.LENSMCP_EVENT_FILE??`${process.cwd()}/.lensmcp/events.jsonl`,e.callId);return t?{found:!0,call:t}:{found:!1,callId:e.callId,reason:"no captured content for this call \u2014 it was not captured (LENSMCP_AI_CAPTURE=content), or it has been rotated away"}}};gc=F([y2({name:"ai.get_call",description:"Returns the prompt and completion of ONE AI call (OpenAI, Anthropic, \u2026) captured by the node tap: system prompt, messages, tools offered, completion, tool calls, usage. `callId` is the `ai.contentRef` of a flow node whose kind is `ai-call` (see flow.get). Only exists when the service ran with LENSMCP_AI_CAPTURE=content; the text was redacted and size-capped when it was captured, and `truncated: true` says if anything was cut.",inputSchema:{callId:b2.string().describe('The contentRef of an ai-call flow node, e.g. "ai_0abc12345xyz78".')}})],gc);var x2=gc;import{Tool as C2,ToolContext as k2,z as H6}from"@frontmcp/sdk";var vc=class extends k2{static{s(this,"Dh")}static{o(this,"FlowSegmentsTool")}async execute(e){return J6(Qe(),e,Qd())}};vc=F([C2({name:"flow.segments",description:'Returns one flow cut into segments and phases \u2014 the right first read for a flow with hundreds or thousands of events. Each segment is a backend request (its browser fetch, every service hop, db/redis/ai work and any queue worker it enqueued), a UI burst (state updates and renders, named by what churned), the origin that started the flow, or background noise; with times relative to the flow start, event/error counts, and a category. Also returns the flow\'s category, subject and tags. Open one unit with flow.get { flowId, segmentId }. A flow no longer in memory is read back from the bus as in flow.get (`recovered`); `reason: "outside-window"` means it may exist further back than the server can see.',inputSchema:{flowId:H6.string().describe("Flow id from flow://recent or flow.list_recent."),maxSegments:H6.number().int().positive().max(500).default(120).describe("Cap on segments listed (failing and heaviest are kept first when it truncates).")}})],vc);var A2=vc,X6=class{static{s(this,"Ch")}static{o(this,"FlowApp")}};X6=F([LB({id:"flow",name:"Flow",description:"Causal-chain index: every event carries a flowId; the app surfaces recent flows + origin events. story.compile turns one of these into a phase summary.",resources:[WB,HB,QB],tools:[d2,m2,A2,v2,x2]})],X6);import{App as I2}from"@frontmcp/sdk";import{Resource as _2,ResourceContext as S2}from"@frontmcp/sdk";var yc=class extends S2{static{s(this,"Uh")}static{o(this,"StoryRecentResource")}async execute(){return this.get(Z).read("story://recent")}};yc=F([_2({name:"story-recent",uri:"story://recent",mimeType:"application/json",description:"Last 50 compiled stories (one per flow), most recent first."})],yc);var F2=yc;import{Resource as j2,ResourceContext as z2}from"@frontmcp/sdk";var Ec=class extends z2{static{s(this,"Fh")}static{o(this,"StoryLastResource")}async execute(){return this.get(Z).read("story://last")}};Ec=F([j2({name:"story-last",uri:"story://last",mimeType:"application/json",description:"The most recently compiled story (full phase list)."})],Ec);var N2=Ec;import{Tool as M2,ToolContext as O2,z as R2}from"@frontmcp/sdk";var vs="story://recent",ys="story://last",Pe={byFlowId:new Map,order:[]},Y6=!1;function Q6(e){return Y6||(e.resources.register(vs,()=>({schemaVersion:1,revision:e.resources.revision(vs)??0,updatedAt:new Date().toISOString(),stories:Pe.order.map(t=>Pe.byFlowId.get(t)).filter(t=>!!t).map(t=>({flowId:t.flowId,origin:t.origin,phaseCount:t.phases.length,startedAt:t.startedAt,endedAt:t.endedAt,eventCount:t.eventCount,finalState:t.finalState}))})),e.resources.register(ys,()=>{let t=Pe.order[0],r=t?Pe.byFlowId.get(t):void 0;return{schemaVersion:1,revision:e.resources.revision(ys)??0,updatedAt:new Date().toISOString(),story:r??null}}),Y6=!0),ey(e.resources),{uris:[vs,ys]}}s(Q6,"qh"),o(Q6,"installStoryReducer");var bc;function ey(e){bc=o(t=>{e.markDirty(t)},"markDirty")}s(ey,"Aj"),o(ey,"setMarkDirty");function wc(e){Pe.byFlowId.set(e.flowId,e);let t=Pe.order.indexOf(e.flowId);if(t>=0&&Pe.order.splice(t,1),Pe.order.unshift(e.flowId),Pe.order.length>50){let r=Pe.order.splice(50);for(let i of r)Pe.byFlowId.delete(i)}bc?.(vs),bc?.(ys)}s(wc,"Ro"),o(wc,"recordCompiledStory");function ty(e){return Pe.byFlowId.get(e)}s(ty,"Vh"),o(ty,"getCompiledStory");var Dc=class extends O2{static{s(this,"Gh")}static{o(this,"StoryCompileTool")}async execute(e){let t=Qe();if(!t)return{compiled:!1,reason:"no active flow reducer"};let r=t.getFlowEvents(e.flowId);if(!r)return{compiled:!1,flowId:e.flowId};let i=la(r,{flowId:e.flowId});return i?(wc(i),{compiled:!0,story:i}):{compiled:!1,flowId:e.flowId}}};Dc=F([M2({name:"story.compile",description:"Compile a flow into a `FlowStory` (origin, phases, finalState). Caches the result; subsequent story.get(flowId) calls return it directly.",inputSchema:{flowId:R2.string().describe("Flow id (from flow://recent).")}})],Dc);var T2=Dc;import{Tool as P2,ToolContext as U2,z as q2}from"@frontmcp/sdk";var $c=class extends U2{static{s(this,"Wh")}static{o(this,"StoryGetTool")}async execute(e){let t=ty(e.flowId);return t?{found:!0,story:t}:{found:!1,flowId:e.flowId}}};$c=F([P2({name:"story.get",description:"Returns a previously compiled story. If the story has not been compiled yet, returns `found: false`; call story.compile first.",inputSchema:{flowId:q2.string().describe("Flow id.")}})],$c);var Z2=$c,uy=class{static{s(this,"Xh")}static{o(this,"StoryApp")}};uy=F([I2({id:"story",name:"Story",description:"Compiles flows into phase summaries (user-action / loading-ui / backend-request / state-update / final-render).",resources:[F2,N2],tools:[T2,Z2]})],uy);import{App as L2}from"@frontmcp/sdk";import{Resource as V2,ResourceContext as J2}from"@frontmcp/sdk";var Bc=class extends J2{static{s(this,"Hh")}static{o(this,"BuildCurrentResource")}async execute(){return this.get(Z).read("build://current")}};Bc=F([V2({name:"build-current",uri:"build://current",mimeType:"application/json",description:"Current build status (clean / warning / failing), open failures and warnings."})],Bc);var W2=Bc;import{Resource as G2,ResourceContext as K2}from"@frontmcp/sdk";var xc=class extends K2{static{s(this,"Qh")}static{o(this,"BuildFailuresResource")}async execute(){return this.get(Z).read("build://failures")}};xc=F([G2({name:"build-failures",uri:"build://failures",mimeType:"application/json",description:"Currently-open build failures (deduped by fingerprint)."})],xc);var H2=xc;import{Resource as X2,ResourceContext as Y2}from"@frontmcp/sdk";var Cc=class extends Y2{static{s(this,"tg")}static{o(this,"BuildRecentResource")}async execute(){return this.get(Z).read("build://events/recent")}};Cc=F([X2({name:"build-events-recent",uri:"build://events/recent",mimeType:"application/json",description:"Last 50 build/lint/typecheck/HMR events in chronological order."})],Cc);var Q2=Cc,ry=class{static{s(this,"ng")}static{o(this,"BuildApp")}};ry=F([L2({id:"build",name:"Build",description:"Vite / TS / lint / HMR state.",resources:[W2,H2,Q2]})],ry);var Es="build://current",bs="build://failures",ws="build://events/recent",ex=new Set(["vite","rollup","typescript","eslint"]),iy=new Set(["build","typecheck","lint"]),ny=50,tx="Install the LensMCP Vite plugin (@lensmcp/vite-plugin) in the dev server, or run under the dev cluster, so build events reach this session.";function sy(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(sy,"Jj"),o(sy,"readRaw");function ay(e,t){return e==="typecheck"?"tsc":e==="lint"?"eslint":t}s(ay,"Wj"),o(ay,"defaultTool");function oy(e){let t={status:"unknown",recent:[],failures:new Map,warnings:new Map,hmrUpdates:0,producers:new Map,sawVerdict:!1},r=o((f,h)=>{let g=t.producers.get(f);t.producers.set(f,{id:f,tool:h.tool,...h.project?{project:h.project}:{},firstReportedAt:g?.firstReportedAt??h.at,lastReportedAt:Math.max(g?.lastReportedAt??0,h.at),lastRunStatus:h.runStatus,errorCount:h.errorCount??g?.errorCount??0,...h.warningCount!==void 0?{warningCount:h.warningCount}:g?.warningCount!==void 0?{warningCount:g.warningCount}:{},...h.durationMs!==void 0?{lastRunDurationMs:h.durationMs}:g?.lastRunDurationMs!==void 0?{lastRunDurationMs:g.lastRunDurationMs}:{},...h.error?{error:h.error}:{}}),qt(t.producers,qr)},"touchProducer"),i=o(f=>{for(let[h,g]of t.failures)f(g)&&t.failures.delete(h);for(let[h,g]of t.warnings)f(g)&&t.warnings.delete(h)},"drop"),u=o((f,h)=>{i(g=>g.domain===f&&(h===void 0||g.project===h))},"clearScope"),n=o((f,h)=>{if(h.length===0)return;let g=new Set(h);i(b=>b.domain===f&&b.file!==void 0&&g.has(b.file))},"clearFiles"),a=o(()=>{if(t.failures.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let f=[...t.producers.values()].some(h=>h.lastRunStatus==="error");t.status=f||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),l=o(()=>{e.resources.markDirty(Es),e.resources.markDirty(bs),e.resources.markDirty(ws)},"markDirty"),d=o(f=>{if([...t.failures.values()].some(h=>h.project===f)||[...t.warnings.values()].some(h=>h.project===f)||[...t.producers.values()].some(h=>h.project===f)){for(let h of iy)u(h,f);for(let[h,g]of t.producers)g.project===f&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),a(),l()}},"supersedeProject"),c=o(f=>{if(f.source==="gateway"&&f.category==="cluster"){let C=f.raw??null,M=C?.kind;(M==="service-starting"||M==="service-respawn")&&C?.project&&d(C.project);return}if(!ex.has(f.source)||!iy.has(f.category))return;let h=f.category,g=sy(f),b=g.project,x=g.tool??ay(h,f.source),$=`${x}:${b??"*"}`,w=typeof g.kind=="string"&&g.kind.endsWith("-run"),k={id:f.id,timestamp:f.timestamp,severity:f.severity,title:f.title,...f.message!==void 0?{message:f.message}:{},...f.location?.file?{file:f.location.file}:g.file?{file:g.file}:{},domain:h,...b?{project:b}:{},fingerprint:f.fingerprint};if(f.severity==="info"&&(w&&g.phase==="start"||f.title.startsWith("tsc clear")||f.title.startsWith("ESLint clear"))){u(h,b),t.lastRunAt=f.timestamp,Hr(t,k),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:"running"}),w||(t.sawVerdict=!0),a(),l();return}if(w&&g.phase==="end"){let C=g.status==="error"?"error":g.status==="failing"?"failing":"clean";C==="clean"&&u(h,b),C!=="error"&&(t.sawVerdict=!0),t.lastRunAt=f.timestamp,Hr(t,k),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:C,...g.durationMs!==void 0?{durationMs:g.durationMs}:{},...g.errorCount!==void 0?{errorCount:g.errorCount}:{},...g.warningCount!==void 0?{warningCount:g.warningCount}:{},...g.error?{error:g.error}:{}}),a(),l();return}if(g.kind==="hmr"||f.title.startsWith("HMR ")){t.hmrUpdates+=1;let C=[...k.file?[k.file]:[],...f.relatedFiles??[]];n("build",C),t.lastRunAt=f.timestamp,t.sawVerdict=!0,Hr(t,k),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:"clean"}),a(),l();return}Hr(t,k),f.severity==="error"||f.severity==="fatal"?(t.failures.set(k.fingerprint,k),t.warnings.delete(k.fingerprint)):f.severity==="warning"?t.failures.has(k.fingerprint)||t.warnings.set(k.fingerprint,k):(t.failures.delete(k.fingerprint),t.warnings.delete(k.fingerprint)),t.lastRunAt=f.timestamp,t.sawVerdict=!0,r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:t.failures.size>0?"failing":"clean"}),a(),l()},"handler"),p=e.bus.subscribe(c),m=o(()=>Vn({producers:[...t.producers.values()],domain:"build",noProducerHint:tx}),"health");return e.resources.register(Es,()=>({schemaVersion:1,revision:e.resources.revision(Es)??0,updatedAt:new Date().toISOString(),status:t.status,failures:[...t.failures.values()],warnings:[...t.warnings.values()],hmrUpdates:t.hmrUpdates,lastRunAt:t.lastRunAt,...m()})),e.resources.register(bs,()=>({schemaVersion:1,revision:e.resources.revision(bs)??0,updatedAt:new Date().toISOString(),failures:[...t.failures.values()],...m()})),e.resources.register(ws,()=>({schemaVersion:1,revision:e.resources.revision(ws)??0,updatedAt:new Date().toISOString(),events:t.recent.slice()})),{unsubscribe:p,uris:[Es,bs,ws]}}s(oy,"og"),o(oy,"installBuildReducer");function Hr(e,t){e.recent.push(t),e.recent.length>ny&&e.recent.splice(0,e.recent.length-ny)}s(Hr,"ya"),o(Hr,"pushRecent");import{App as ux}from"@frontmcp/sdk";import{Resource as rx,ResourceContext as ix}from"@frontmcp/sdk";var kc=class extends ix{static{s(this,"ig")}static{o(this,"LintCurrentResource")}async execute(){return this.get(Z).read("lint://current")}};kc=F([rx({name:"lint-current",uri:"lint://current",mimeType:"application/json",description:"Current lint status (clean / warning / failing) + counts."})],kc);var nx=kc;import{Resource as sx,ResourceContext as ax}from"@frontmcp/sdk";var Ac=class extends ax{static{s(this,"ag")}static{o(this,"LintErrorsResource")}async execute(){return this.get(Z).read("lint://errors")}};Ac=F([sx({name:"lint-errors",uri:"lint://errors",mimeType:"application/json",description:"Currently-open ESLint errors (deduped by fingerprint)."})],Ac);var ox=Ac;import{Resource as lx,ResourceContext as dx}from"@frontmcp/sdk";var Ic=class extends dx{static{s(this,"ug")}static{o(this,"LintWarningsResource")}async execute(){return this.get(Z).read("lint://warnings")}};Ic=F([lx({name:"lint-warnings",uri:"lint://warnings",mimeType:"application/json",description:"Currently-open ESLint warnings."})],Ic);var cx=Ic,ly=class{static{s(this,"dg")}static{o(this,"LintApp")}};ly=F([ux({id:"lint",name:"Lint",description:"ESLint state.",resources:[nx,ox,cx]})],ly);var Ds="lint://current",$s="lint://errors",Bs="lint://warnings",px="Nothing runs ESLint in the dev loop, so this is expected. Run `lensmcp lint [paths\u2026]` to publish a run; until then treat lint as UNCHECKED, not passing.";function dy(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(dy,"nz"),o(dy,"readRaw");function cy(e){let t={status:"unknown",errors:new Map,warnings:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p);t.producers.set(p,{id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.warningCount!==void 0?{warningCount:m.warningCount}:f?.warningCount!==void 0?{warningCount:f.warningCount}:{},...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.error?{error:m.error}:{}}),qt(t.producers,qr)},"touchProducer"),i=o((p,m)=>{let f=o((h,g)=>{for(let[b,x]of h)g(x)&&h.delete(b)},"drop");if(p){f(t.errors,h=>h.project===p),f(t.warnings,h=>h.project===p);return}if(m){f(t.errors,h=>h.file===m),f(t.warnings,h=>h.file===m);return}t.errors.clear(),t.warnings.clear()},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),n=o(()=>{e.resources.markDirty(Ds),e.resources.markDirty($s),e.resources.markDirty(Bs)},"markDirty"),a=o(p=>{if([...t.errors.values()].some(m=>m.project===p)||[...t.warnings.values()].some(m=>m.project===p)||[...t.producers.values()].some(m=>m.project===p)){i(p,void 0);for(let[m,f]of t.producers)f.project===p&&t.producers.delete(m);t.sawVerdict=[...t.producers.values()].some(m=>m.lastRunStatus!=="error"),u(),n()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,k=w?.kind;(k==="service-starting"||k==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="eslint"||p.category!=="lint")return;let m=dy(p),f=m.project,h=m.tool??"eslint",g=`${h}:${f??"*"}`,b=m.kind==="lint-run";if(p.severity==="info"&&(b&&m.phase==="start"||p.title.startsWith("ESLint clear"))){i(f,p.location?.file),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),b||(t.sawVerdict=!0),u(),n();return}if(b&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),n();return}let x=p.title.match(/^\[([^\]]+)\]/),$={id:p.id,timestamp:p.timestamp,severity:p.severity,...m.rule?{rule:m.rule}:x?.[1]?{rule:x[1]}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};if(p.severity==="error"||p.severity==="fatal")t.errors.set($.fingerprint,$),t.warnings.delete($.fingerprint);else if(p.severity==="warning")t.errors.has($.fingerprint)||t.warnings.set($.fingerprint,$);else return;t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:t.errors.size>0?"failing":"clean"}),u(),n()},"handler"),d=e.bus.subscribe(l),c=o(()=>Vn({producers:[...t.producers.values()],domain:"lint",noProducerHint:px}),"health");return e.resources.register(Ds,()=>({schemaVersion:1,revision:e.resources.revision(Ds)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,warningCount:t.warnings.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register($s,()=>({schemaVersion:1,revision:e.resources.revision($s)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),e.resources.register(Bs,()=>({schemaVersion:1,revision:e.resources.revision(Bs)??0,updatedAt:new Date().toISOString(),warnings:[...t.warnings.values()],...c()})),{unsubscribe:d,uris:[Ds,$s,Bs]}}s(cy,"pg"),o(cy,"installLintReducer");import{App as mx}from"@frontmcp/sdk";import{Resource as fx,ResourceContext as hx}from"@frontmcp/sdk";var _c=class extends hx{static{s(this,"fg")}static{o(this,"TypecheckCurrentResource")}async execute(){return this.get(Z).read("typecheck://current")}};_c=F([fx({name:"typecheck-current",uri:"typecheck://current",mimeType:"application/json",description:"Current TypeScript typecheck status + error count."})],_c);var gx=_c;import{Resource as vx,ResourceContext as yx}from"@frontmcp/sdk";var Sc=class extends yx{static{s(this,"hg")}static{o(this,"TypecheckErrorsResource")}async execute(){return this.get(Z).read("typecheck://errors")}};Sc=F([vx({name:"typecheck-errors",uri:"typecheck://errors",mimeType:"application/json",description:"Current TypeScript errors (deduped by fingerprint)."})],Sc);var Ex=Sc,py=class{static{s(this,"vg")}static{o(this,"TypecheckApp")}};py=F([mx({id:"typecheck",name:"Typecheck",description:"TypeScript diagnostics from `tsc --watch`.",resources:[gx,Ex]})],py);var xs="typecheck://current",Cs="typecheck://errors",bx="Wire one: the dev cluster publishes from `TsgoCheckPlugin` when `LENSMCP_TYPECHECK=tsgo` (@lensmcp/cluster), or call `startTscCollector()` from @lensmcp/session for a `tsc --watch` workspace.";function my(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(my,"lz"),o(my,"readRaw");function fy(e){let t={status:"unknown",errors:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p),h={id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}};t.producers.set(p,h),qt(t.producers,qr)},"touchProducer"),i=o(p=>{if(!p){t.errors.clear();return}for(let[m,f]of t.errors)f.project===p&&t.errors.delete(m)},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),n=o(()=>{e.resources.markDirty(xs),e.resources.markDirty(Cs)},"markDirty"),a=o(p=>{let m=[...t.errors.values()].some(h=>h.project===p),f=[...t.producers.values()].some(h=>h.project===p);if(!(!m&&!f)){i(p);for(let[h,g]of t.producers)g.project===p&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),u(),n()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,k=w?.kind;(k==="service-starting"||k==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="typescript"||p.category!=="typecheck")return;let m=my(p),f=m.project,h=m.tool??"tsc",g=`${h}:${f??"*"}`,b=m.kind==="typecheck-run";if(p.severity==="info"&&(b&&m.phase==="start"||p.title.startsWith("tsc clear"))){i(f),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),b||(t.sawVerdict=!0),u(),n();return}if(b&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),n();return}if(p.severity!=="error"&&p.severity!=="fatal")return;let x=p.title.match(/\bTS(\d+):/),$={id:p.id,timestamp:p.timestamp,...m.code?{code:m.code}:x?{code:`TS${x[1]}`}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};t.errors.set($.fingerprint,$),t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"failing"}),u(),n()},"handler"),d=e.bus.subscribe(l),c=o(()=>Vn({producers:[...t.producers.values()],domain:"typecheck",noProducerHint:bx}),"health");return e.resources.register(xs,()=>({schemaVersion:1,revision:e.resources.revision(xs)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register(Cs,()=>({schemaVersion:1,revision:e.resources.revision(Cs)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),{unsubscribe:d,uris:[xs,Cs]}}s(fy,"yg"),o(fy,"installTypecheckReducer");import{App as wx}from"@frontmcp/sdk";import{Resource as Dx,ResourceContext as $x}from"@frontmcp/sdk";var Fc=class extends $x{static{s(this,"bg")}static{o(this,"BundleCurrentResource")}async execute(){return this.get(Z).read("bundle://current")}};Fc=F([Dx({name:"bundle-current",uri:"bundle://current",mimeType:"application/json",description:"Most recent Vite/Rollup bundle report (chunks + sizes)."})],Fc);var Bx=Fc;import{Resource as xx,ResourceContext as Cx}from"@frontmcp/sdk";var jc=class extends Cx{static{s(this,"xg")}static{o(this,"BundleChunksResource")}async execute(){return this.get(Z).read("bundle://chunks")}};jc=F([xx({name:"bundle-chunks",uri:"bundle://chunks",mimeType:"application/json",description:"Per-chunk bundle sizes (most recent build)."})],jc);var kx=jc;import{Resource as Ax,ResourceContext as Ix}from"@frontmcp/sdk";var zc=class extends Ix{static{s(this,"_g")}static{o(this,"BundleModulesResource")}async execute(){return this.get(Z).read("bundle://modules")}};zc=F([Ax({name:"bundle-modules",uri:"bundle://modules",mimeType:"application/json",description:"Flattened per-module bundle sizes (most recent build)."})],zc);var _x=zc;import{Resource as Sx,ResourceContext as Fx}from"@frontmcp/sdk";var Nc=class extends Fx{static{s(this,"Sg")}static{o(this,"BundleRegressionsResource")}async execute(){return this.get(Z).read("bundle://regressions")}};Nc=F([Sx({name:"bundle-regressions",uri:"bundle://regressions",mimeType:"application/json",description:"Chunks/modules that grew, were added, or were removed vs the baseline."})],Nc);var jx=Nc;import{Resource as zx,ResourceContext as Nx}from"@frontmcp/sdk";var Mc=class extends Nx{static{s(this,"Rg")}static{o(this,"BundleCompareResource")}async execute(){return this.get(Z).read("bundle://compare/latest")}};Mc=F([zx({name:"bundle-compare-latest",uri:"bundle://compare/latest",mimeType:"application/json",description:"Most recent build vs baseline: totals + delta."})],Mc);var Mx=Mc,hy=class{static{s(this,"Tg")}static{o(this,"BundleApp")}};hy=F([wx({id:"bundle",name:"Bundle",description:"Vite/Rollup bundle reports + regressions against baseline.",resources:[Bx,kx,_x,jx,Mx]})],hy);function Oc(e,t){let r=[],i=new Map(e.chunks.map(n=>[n.name,n])),u=new Map(t.chunks.map(n=>[n.name,n]));for(let[n,a]of u){let l=i.get(n);if(!l){r.push({kind:"chunk-added",name:n,afterBytes:a.sizeBytes,deltaBytes:a.sizeBytes});continue}let d=a.sizeBytes-l.sizeBytes;d>256&&r.push({kind:"chunk-grew",name:n,beforeBytes:l.sizeBytes,afterBytes:a.sizeBytes,deltaBytes:d}),r.push(...gy(l,a))}for(let[n,a]of i)u.has(n)||r.push({kind:"chunk-removed",name:n,beforeBytes:a.sizeBytes,deltaBytes:-a.sizeBytes});return r.sort((n,a)=>Math.abs(a.deltaBytes)-Math.abs(n.deltaBytes))}s(Oc,"ka"),o(Oc,"compareReports");function gy(e,t){let r=[],i=new Map(e.modules.map(u=>[u.id,u.sizeBytes]));for(let u of t.modules){let n=i.get(u.id);if(n===void 0)u.sizeBytes>256&&r.push({kind:"module-added",name:`${t.name}::${u.id}`,afterBytes:u.sizeBytes,deltaBytes:u.sizeBytes});else{let a=u.sizeBytes-n;a>256&&r.push({kind:"module-grew",name:`${t.name}::${u.id}`,beforeBytes:n,afterBytes:u.sizeBytes,deltaBytes:a})}}return r}s(gy,"$z"),o(gy,"compareModules");var ks="bundle://current",As="bundle://chunks",Is="bundle://modules",Xr="bundle://regressions",Yr="bundle://compare/latest";function vy(e){let t={baseline:e.initialBaseline,regressions:[]},r=o(u=>{if(u.source!=="rollup"&&u.source!=="vite"||u.category!=="build")return;let n=u.raw;if(!n||typeof n!="object"||!("kind"in n)||n.kind!=="bundle-report")return;let a=n.report;!a||!Array.isArray(a.chunks)||(t.current=a,t.regressions=t.baseline?Oc(t.baseline,a):[],e.resources.markDirty(ks),e.resources.markDirty(As),e.resources.markDirty(Is),e.resources.markDirty(Xr),e.resources.markDirty(Yr))},"handler"),i=e.bus.subscribe(r);return e.resources.register(ks,()=>({schemaVersion:1,revision:e.resources.revision(ks)??0,updatedAt:new Date().toISOString(),report:t.current??null})),e.resources.register(As,()=>({schemaVersion:1,revision:e.resources.revision(As)??0,updatedAt:new Date().toISOString(),chunks:t.current?.chunks??[]})),e.resources.register(Is,()=>{let u=t.current?.chunks.flatMap(n=>n.modules.map(a=>({...a,chunk:n.name})))??[];return{schemaVersion:1,revision:e.resources.revision(Is)??0,updatedAt:new Date().toISOString(),modules:u}}),e.resources.register(Xr,()=>({schemaVersion:1,revision:e.resources.revision(Xr)??0,updatedAt:new Date().toISOString(),regressions:t.regressions.slice()})),e.resources.register(Yr,()=>({schemaVersion:1,revision:e.resources.revision(Yr)??0,updatedAt:new Date().toISOString(),baseline:t.baseline??null,current:t.current??null,deltaBytes:t.baseline&&t.current?t.current.totalBytes-t.baseline.totalBytes:0})),{unsubscribe:i,uris:[ks,As,Is,Xr,Yr],setBaseline:o(u=>{t.baseline=u,t.current&&(t.regressions=Oc(t.baseline,t.current)),e.resources.markDirty(Xr),e.resources.markDirty(Yr)},"setBaseline")}}s(vy,"Ag"),o(vy,"installBundleReducer");import{App as Ox}from"@frontmcp/sdk";import{Resource as Rx,ResourceContext as Tx}from"@frontmcp/sdk";var Rc=class extends Tx{static{s(this,"jg")}static{o(this,"RuntimeBrowserConsoleResource")}async execute(){return this.get(Z).read("runtime://browser/console")}};Rc=F([Rx({name:"runtime-browser-console",uri:"runtime://browser/console",mimeType:"application/json",description:"Most recent 200 console.* messages from any tab."})],Rc);var Px=Rc;import{Resource as Ux,ResourceContext as qx}from"@frontmcp/sdk";var Tc=class extends qx{static{s(this,"Og")}static{o(this,"RuntimeBrowserErrorsResource")}async execute(){return this.get(Z).read("runtime://browser/errors")}};Tc=F([Ux({name:"runtime-browser-errors",uri:"runtime://browser/errors",mimeType:"application/json",description:"Uncaught browser errors + promise rejections, per tab, since that tab's current page load (a reload retracts the previous document's errors)."})],Tc);var Zx=Tc;import{Resource as Lx,ResourceContext as Vx}from"@frontmcp/sdk";var Pc=class extends Vx{static{s(this,"Ng")}static{o(this,"RuntimeServerErrorsResource")}async execute(){return this.get(Z).read("runtime://errors")}};Pc=F([Lx({name:"runtime-errors",uri:"runtime://errors",mimeType:"application/json",description:"Errors raised INSIDE a backend pod, with no browser involved \u2014 the 500s a curl, an e2e runner or a queue job produces. Each entry carries the route, the status, the request id the gateway stamped, and the stack. Use this when a server-side call failed and no browser flow exists to explain it; `runtime://browser/errors` is the browser-side counterpart."})],Pc);var Jx=Pc;import{Resource as Wx,ResourceContext as Gx}from"@frontmcp/sdk";var Uc=class extends Gx{static{s(this,"Dg")}static{o(this,"RuntimeBrowserNetworkResource")}async execute(){return this.get(Z).read("runtime://browser/network")}};Uc=F([Wx({name:"runtime-browser-network",uri:"runtime://browser/network",mimeType:"application/json",description:"Recent fetch / XHR / browser network activity."})],Uc);var Kx=Uc;import{Resource as Hx,ResourceContext as Xx}from"@frontmcp/sdk";var qc=class extends Xx{static{s(this,"Ug")}static{o(this,"RuntimeBrowserFailedRequestsResource")}async execute(){return this.get(Z).read("runtime://browser/failed-requests")}};qc=F([Hx({name:"runtime-browser-failed-requests",uri:"runtime://browser/failed-requests",mimeType:"application/json",description:"Recent failed network requests (status >= 400 or transport errors)."})],qc);var Yx=qc;import{Resource as Qx,ResourceContext as eC}from"@frontmcp/sdk";var Zc=class extends eC{static{s(this,"Fg")}static{o(this,"RuntimeDismissedResource")}async execute(){return this.get(Z).read("runtime://dismissed")}};Zc=F([Qx({name:"runtime-dismissed",uri:"runtime://dismissed",mimeType:"application/json",description:"Errors someone DISMISSED by hand \u2014 in the dashboard, at the CLI, or an agent through observe.dismiss_errors \u2014 with who did it and the reason they gave. A dismissed error is hidden from runtime://errors and the browser error lists, not fixed: it shows again the next time it happens. Read this when an error list is shorter than you expected."})],Zc);var tC=Zc,yy=class{static{s(this,"Zg")}static{o(this,"RuntimeApp")}};yy=F([Ox({id:"runtime",name:"Runtime",description:"Live browser/node runtime state (console, errors, network).",resources:[Px,Zx,Jx,Kx,Yx,tC]})],yy);var Cu="runtime://browser/console",wt="runtime://browser/errors",ku="runtime://browser/network",Dt="runtime://browser/failed-requests",$t="runtime://errors",Qr="runtime://dismissed",uC=200,Ey=100,rC=200,iC=50,nC=500,sC="default",aC=1e3,Lc=o(e=>e??sC,"tabOf");function by(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(by,"Bz"),o(by,"isDocumentBoundary");function wy(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(wy,"Zz"),o(wy,"isTabGone");function Dy(e){let t=(e.now??(()=>Date.now()))(),r={console:[],errors:[],network:[],failed:[],serverErrors:[],readyByTab:new Map,dismissed:new Map,changedAt:new Map},i=o((c,p)=>{r.changedAt.set(c,p),e.resources.markDirty(c)},"touch"),u=o((c,p,m)=>{let f=c.filter(h=>!(Lc(h.tabId)===p&&h.timestamp<m));f.length!==c.length&&(c.length=0,c.push(...f))},"retract"),n=o(c=>{let p=yd(c);if(p){let f=r.dismissed.get(p.groupId);r.dismissed.delete(p.groupId),p.kind===wu&&(r.dismissed.set(p.groupId,{eventIds:new Set(p.eventIds),at:c.timestamp,...p.by?{by:p.by}:{},...p.reason?{reason:p.reason}:{},...p.title?{title:p.title}:{}}),r.dismissed.size>nC&&r.dismissed.delete(r.dismissed.keys().next().value));let h=new Set([...f?.eventIds??[],...r.dismissed.get(p.groupId)?.eventIds??[]]);for(let[g,b]of[[$t,r.serverErrors],[wt,r.errors],[Dt,r.failed]])b.some(x=>h.has(x.id))&&i(g,c.timestamp);i(Qr,c.timestamp);return}if($y(c)){let f=c.raw?.project;if(f){let h=r.serverErrors.length;r.serverErrors=r.serverErrors.filter(g=>g.project!==f),r.serverErrors.length!==h&&i($t,c.timestamp)}return}if(By(c)){r.lastServerEventAt=Math.max(r.lastServerEventAt??0,c.timestamp),Au(r.serverErrors,xy(c),Ey),i($t,c.timestamp);return}if(!(c.source==="client-runtime"||c.source==="chrome")&&!(c.source==="react"&&c.category==="network"))return;if(r.lastEventAt=Math.max(r.lastEventAt??0,c.timestamp),wy(c)){let f=Lc(c.context.tabId);u(r.errors,f,Number.POSITIVE_INFINITY),u(r.failed,f,Number.POSITIVE_INFINITY),r.readyByTab.delete(f);for(let h of[wt,Dt,Cu,ku])i(h,c.timestamp);return}if(by(c)){let f=Lc(c.context.tabId);r.readyByTab.set(f,Math.max(r.readyByTab.get(f)??0,c.timestamp)),r.lastReadyAt=Math.max(r.lastReadyAt??0,c.timestamp);let h=c.timestamp-aC;u(r.errors,f,h),u(r.failed,f,h);for(let g of[wt,Dt,Cu,ku])i(g,c.timestamp);return}let m={id:c.id,timestamp:c.timestamp,severity:c.severity,title:c.title,message:c.message,source:c.source,fingerprint:c.fingerprint,tabId:c.context.tabId,url:c.context.url,raw:c.raw};if(c.category==="network"){Au(r.network,m,rC),i(ku,c.timestamp),c.severity==="error"&&(Au(r.failed,m,iC),i(Dt,c.timestamp));return}(c.severity==="error"||c.severity==="fatal")&&(Au(r.errors,m,Ey),i(wt,c.timestamp)),c.title?.startsWith("console.")&&(Au(r.console,m,uC),i(Cu,c.timestamp))},"handler"),a=e.bus.subscribe(n),l=new Set([$t,wt,Dt]),d=o((c,p)=>{if(!l.has(c)||r.dismissed.size===0)return Jc(e.resources,c,p,r,t,0);let m=new Set([...r.dismissed.values()].flatMap(h=>[...h.eventIds])),f=p.filter(h=>!m.has(h.id));return Jc(e.resources,c,f,r,t,p.length-f.length)},"snap");return e.resources.register($t,()=>d($t,r.serverErrors)),e.resources.register(Cu,()=>d(Cu,r.console)),e.resources.register(wt,()=>d(wt,r.errors)),e.resources.register(ku,()=>d(ku,r.network)),e.resources.register(Dt,()=>d(Dt,r.failed)),e.resources.register(Qr,()=>{let c=new Set([...r.serverErrors,...r.errors,...r.failed].map(m=>m.id)),p=[...r.dismissed].map(([m,f])=>({id:m,at:f.at,...f.by?{by:f.by}:{},...f.reason?{reason:f.reason}:{},...f.title?{title:f.title}:{},eventIds:[...f.eventIds],hiding:[...f.eventIds].filter(h=>c.has(h)).length}));return{schemaVersion:1,revision:e.resources.revision(Qr)??0,updatedAt:new Date(r.changedAt.get(Qr)??t).toISOString(),count:p.length,dismissals:p,detail:p.length?`${p.length} dismissal${p.length===1?"":"s"} in effect \u2014 hidden, not fixed. Each error shows again the next time it happens; undo one with observe.restore_errors.`:"Nothing has been dismissed."}}),{unsubscribe:a,uris:[Cu,wt,ku,Dt,$t,Qr]}}s(Dy,"Gg"),o(Dy,"installRuntimeReducer");function Vc(e){let t=e.raw??null,r=e.context;return t?.project??r.projectName}s(Vc,"C_"),o(Vc,"projectOf");function $y(e){if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw?.kind;return t==="service-starting"||t==="service-respawn"}s($y,"qz"),o($y,"isGenerationBoundary");function By(e){if(e.source!=="nestjs"||e.severity!=="error"&&e.severity!=="fatal")return!1;let t=e.raw??{};return t.kind==="server-request"||t.kind==="uncaught"?!0:t.kind!=="log"?!1:t.request?.error?!0:/\b[A-Za-z0-9_$]*(?:Error|Exception)\b|\b(?:ERROR|FATAL)\b/.test(e.title??"")}s(By,"Vz"),o(By,"isServerError");function xy(e){let t=(e.raw??{}).request??{},r=t.error;return{id:e.id,timestamp:e.timestamp,severity:e.severity,title:e.title,message:e.message??r?.message,source:e.source,fingerprint:e.fingerprint,...e.context.requestId?{requestId:e.context.requestId}:{},...Vc(e)?{project:Vc(e)}:{},...typeof t.route=="string"?{route:t.route}:{},...typeof t.status=="number"?{status:t.status}:{},...r?.stack?{stack:r.stack}:{},raw:e.raw}}s(xy,"Gz"),o(xy,"serverEntry");function Jc(e,t,r,i,u,n){let a=t===$t,l=a?i.lastServerEventAt:i.lastEventAt,d=l!==void 0;return{schemaVersion:1,revision:e.revision(t)??0,updatedAt:new Date(i.changedAt.get(t)??u).toISOString(),count:r.length,entries:r.slice(),...n>0?{dismissedCount:n}:{},producer:d?"connected":"none",lastEventAt:l,lastReadyAt:i.lastReadyAt,detail:a?d?r.length===0?"No server-side errors held. Pods HAVE reported, but a new pod generation retracts the errors of the one it replaced \u2014 so this is NOT evidence the routes are healthy: nobody may have re-made the failing request since."+_s(n):`${r.length} server-side error${r.length===1?"":"s"} from ${new Set(r.map(c=>c.project??"unknown")).size} project${new Set(r.map(c=>c.project??"unknown")).size===1?"":"s"}`+_s(n):"No pod has ever reported into this session \u2014 this is NOT evidence the backend is healthy, nothing is watching. Run the backend under the dev cluster so pod errors reach this session.":d?`browser attached; ${r.length} entr${r.length===1?"y":"ies"} from ${i.readyByTab.size} open tab${i.readyByTab.size===1?"":"s"}`+(i.lastReadyAt===void 0?" (no page load observed yet)":"")+_s(n):"No browser has ever reported into this session \u2014 this is NOT evidence the app is healthy, nothing is watching. Open the app under the dev cluster (or the Vite dev server with @lensmcp/vite-plugin installed) so browser events reach this session."}}s(Jc,"U_"),o(Jc,"snapshot");function _s(e){return e>0?` \u2014 ${e} more dismissed by hand in the dashboard (hidden, not fixed)`:""}s(_s,"Vg"),o(_s,"dismissedNote");function Au(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(Au,"jo"),o(Au,"pushBounded");import{App as oC}from"@frontmcp/sdk";import{Resource as lC,ResourceContext as dC}from"@frontmcp/sdk";var Wc=class extends dC{static{s(this,"Jg")}static{o(this,"BrowserTabsResource")}async execute(){return this.get(Z).read("browser://tabs")}};Wc=F([lC({name:"browser-tabs",uri:"browser://tabs",mimeType:"application/json",description:"Open browser tabs with per-tab status, url, and event counts. `status` reflects the tab's CURRENT page load \u2014 a reload resets it."})],Wc);var cC=Wc;import{Resource as pC,ResourceContext as mC}from"@frontmcp/sdk";var Gc=class extends mC{static{s(this,"Kg")}static{o(this,"BrowserActiveTabResource")}async execute(){return this.get(Z).read("browser://active-tab")}};Gc=F([pC({name:"browser-active-tab",uri:"browser://active-tab",mimeType:"application/json",description:"The currently-focused browser tab."})],Gc);var fC=Gc,Cy=class{static{s(this,"Hg")}static{o(this,"BrowserApp")}};Cy=F([oC({id:"browser",name:"Browser",description:"Per-tab browser state (multi-tab refinement comes in Phase 6).",resources:[cC,fC]})],Cy);var Bt="browser://tabs",xt="browser://active-tab";function ky(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(ky,"Yz"),o(ky,"isDocumentBoundary");function Ay(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(Ay,"Qz"),o(Ay,"isTabGone");function Iy(e){let t=(e.now??(()=>Date.now()))(),r={tabs:new Map,changedAt:new Map},i=o(a=>{if(a.source!=="chrome"&&a.source!=="client-runtime")return;let l=a.context.tabId??"default";if(Ay(a)){if(r.tabs.delete(l),r.activePageId===l){let c=[...r.tabs.keys()];r.activePageId=c[c.length-1]}r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt);return}let d=r.tabs.get(l);if(d||(d={pageId:l,url:a.context.url??"",status:"unknown",unreadEvents:0,totalEvents:0,loads:0}),r.tabs.delete(l),r.tabs.set(l,d),r.tabs.size>100){let c=r.tabs.keys().next().value;c!==void 0&&c!==l&&r.tabs.delete(c)}a.context.url&&(d.url=a.context.url),d.totalEvents+=1,d.lastEventAt=a.timestamp,r.activePageId=l,r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),ky(a)?(d.status="clean",d.unreadEvents=0,d.loads+=1,d.lastReadyAt=a.timestamp):(d.unreadEvents+=1,a.severity==="error"||a.severity==="fatal"?d.status="failing":d.status!=="failing"&&a.severity==="warning"?d.status="warning":d.status==="unknown"&&(d.status="clean")),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt)},"handler"),u=e.bus.subscribe(i),n=o(a=>new Date(r.changedAt.get(a)??t).toISOString(),"stamp");return e.resources.register(Bt,()=>({schemaVersion:1,revision:e.resources.revision(Bt)??0,updatedAt:n(Bt),activePageId:r.activePageId,tabs:[...r.tabs.values()],lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"})),e.resources.register(xt,()=>{let a=r.activePageId;return{schemaVersion:1,revision:e.resources.revision(xt)??0,updatedAt:n(xt),tab:a?r.tabs.get(a)??null:null,lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"}}),{unsubscribe:u,uris:[Bt,xt]}}s(Iy,"Yg"),o(Iy,"installBrowserReducer");import{App as hC}from"@frontmcp/sdk";import{Resource as gC,ResourceContext as vC}from"@frontmcp/sdk";var Kc=class extends vC{static{s(this,"Qg")}static{o(this,"NestProvidersResource")}async execute(){return this.get(Z).read("nest://providers")}};Kc=F([gC({name:"nest-providers",uri:"nest://providers",mimeType:"application/json",description:"All known NestJS singleton-instance generations (with lifecycle)."})],Kc);var yC=Kc;import{Resource as EC,ResourceContext as bC}from"@frontmcp/sdk";var Hc=class extends bC{static{s(this,"tv")}static{o(this,"NestRequestsResource")}async execute(){return this.get(Z).read("nest://requests/recent")}};Hc=F([EC({name:"nest-requests-recent",uri:"nest://requests/recent",mimeType:"application/json",description:"Last 50 NestJS server requests with status + duration."})],Hc);var wC=Hc,_y=class{static{s(this,"nv")}static{o(this,"NestApp")}};_y=F([hC({id:"nest",name:"Nest",description:"NestJS providers, request lifecycle, singleton generations.",resources:[yC,wC]})],_y);var Ss="nest://providers",Fs="nest://requests/recent";function Sy(e){let t={providers:new Map,recentRequests:[]},r=o(u=>{if(u.source!=="nestjs")return;let n=u.raw??null;if(n?.kind==="singleton-instance"&&n.provider){let a=n.provider;if(t.providers.delete(a.instanceId),t.providers.set(a.instanceId,{...a}),t.providers.size>500){for(let l of t.providers.keys())if(t.providers.delete(l),t.providers.size<=500)break}e.resources.markDirty(Ss);return}if(n?.kind==="server-request"&&n.request){let a={...n.request,fingerprint:u.fingerprint,id:u.id};t.recentRequests.push(a),t.recentRequests.length>50&&t.recentRequests.splice(0,t.recentRequests.length-50),e.resources.markDirty(Fs);return}},"handler"),i=e.bus.subscribe(r);return e.resources.register(Ss,()=>({schemaVersion:1,revision:e.resources.revision(Ss)??0,updatedAt:new Date().toISOString(),providers:[...t.providers.values()]})),e.resources.register(Fs,()=>({schemaVersion:1,revision:e.resources.revision(Fs)??0,updatedAt:new Date().toISOString(),requests:t.recentRequests.slice()})),{unsubscribe:i,uris:[Ss,Fs]}}s(Sy,"ov"),o(Sy,"installNestReducer");import{App as DC}from"@frontmcp/sdk";import{Resource as $C,ResourceContext as BC}from"@frontmcp/sdk";var Xc=class extends BC{static{s(this,"iv")}static{o(this,"TraceRecentResource")}async execute(){return this.get(Z).read("trace://recent")}};Xc=F([$C({name:"trace-recent",uri:"trace://recent",mimeType:"application/json",description:"Last 100 trace spans (flattened)."})],Xc);var xC=Xc;import{Resource as CC,ResourceContext as kC}from"@frontmcp/sdk";var Yc=class extends kC{static{s(this,"av")}static{o(this,"TraceFailedResource")}async execute(){return this.get(Z).read("trace://failed")}};Yc=F([CC({name:"trace-failed",uri:"trace://failed",mimeType:"application/json",description:"Trace spans that ended with status=error."})],Yc);var AC=Yc,Fy=class{static{s(this,"uv")}static{o(this,"TraceApp")}};Fy=F([DC({id:"trace",name:"Trace",description:"Cross-process span timeline (Phase 3 \u2014 flat; Phase 7 promotes to multi-axis graph).",resources:[xC,AC]})],Fy);var js="trace://recent",zs="trace://failed";function jy(e){let t={recent:[],failed:[]},r=o(u=>{let n=u.raw??null;if(!n||n.kind!=="span"||!n.span?.name)return;let a={id:u.id,traceId:n.span.traceId,parentSpanId:n.span.parentSpanId,flowId:n.span.flowId??u.context.flowId,requestId:n.span.requestId??u.context.requestId,name:n.span.name,source:u.source,startTime:n.span.startTime??u.timestamp,endTime:n.span.endTime,durationMs:n.span.durationMs,status:n.span.status??(u.severity==="error"?"error":"ok")};Qc(t.recent,a,100),a.status==="error"&&Qc(t.failed,a,50),e.resources.markDirty(js),a.status==="error"&&e.resources.markDirty(zs)},"handler"),i=e.bus.subscribe(r);return e.resources.register(js,()=>({schemaVersion:1,revision:e.resources.revision(js)??0,updatedAt:new Date().toISOString(),spans:t.recent.slice()})),e.resources.register(zs,()=>({schemaVersion:1,revision:e.resources.revision(zs)??0,updatedAt:new Date().toISOString(),spans:t.failed.slice()})),{unsubscribe:i,uris:[js,zs]}}s(jy,"lv"),o(jy,"installTraceReducer");function Qc(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(Qc,"L_"),o(Qc,"pushBounded");import{App as IC}from"@frontmcp/sdk";import{Resource as _C,ResourceContext as SC}from"@frontmcp/sdk";var ep=class extends SC{static{s(this,"dv")}static{o(this,"PerfSlowRoutesResource")}async execute(){return this.get(Z).read("perf://slow-routes")}};ep=F([_C({name:"perf-slow-routes",uri:"perf://slow-routes",mimeType:"application/json",description:"Routes that are slow NOW (\u2265 threshold on their latest call, or repeatedly lately). A one-off spike is retracted once later calls prove the route recovered; worstEver keeps the history."})],ep);var FC=ep;import{Resource as jC,ResourceContext as zC}from"@frontmcp/sdk";var tp=class extends zC{static{s(this,"fv")}static{o(this,"PerfDuplicateRequestsResource")}async execute(){return this.get(Z).read("perf://duplicate-requests")}};tp=F([jC({name:"perf-duplicate-requests",uri:"perf://duplicate-requests",mimeType:"application/json",description:"Endpoints one page called SEVERAL TIMES CONCURRENTLY \u2014 the missing-dedupe signal (a hook fetching outside the shared resource cache, multiplied by however many components mount it). Concurrency, not count: sequential repeats are a caching question and are not reported. The threshold sits above 2 so React StrictMode\u2019s double-invoke never fires it. Two consecutive clean loads retract a finding, so a fix clears it without a restart."})],tp);var NC=tp,zy=class{static{s(this,"hv")}static{o(this,"PerfApp")}};zy=F([IC({id:"perf",name:"Perf",description:"Performance signals: slow server routes, and endpoints one page calls concurrently (the missing-dedupe signal).",resources:[FC,NC]})],zy);var Ns="perf://slow-routes",Ms=20,Ny=2,MC=200;function My(e){let t=Ye(e.thresholds).slowRouteMs,r=(e.now??(()=>Date.now()))(),i={routes:new Map},u=o(d=>{let c=d.raw??null;if(c?.kind!=="server-request"||!c.request)return;let{method:p,route:m}=c.request,f=c.request.durationMs??0,h=`${p} ${m}`,g=i.routes.get(h);if(g||(g={method:p,route:m,recent:[],samples:0,slowSamples:0,lastDurationMs:f,lastSeenAt:d.timestamp,worstEverMs:0,worstEverAt:d.timestamp}),i.routes.delete(h),i.routes.set(h,g),g.recent.push(f),g.recent.length>Ms&&g.recent.splice(0,g.recent.length-Ms),g.samples+=1,f>=t&&(g.slowSamples+=1),g.lastDurationMs=f,g.lastSeenAt=d.timestamp,f>g.worstEverMs&&(g.worstEverMs=f,g.worstEverAt=d.timestamp),i.routes.size>MC){let b=i.routes.keys().next().value;b!==void 0&&i.routes.delete(b)}i.lastSampleAt=Math.max(i.lastSampleAt??0,d.timestamp),i.changedAt=d.timestamp,e.resources.markDirty(Ns)},"handler"),n=e.bus.subscribe(u),a=o(d=>d.recent.reduce((c,p)=>p>=t?c+1:c,0),"recentSlowCount"),l=o(d=>d.lastDurationMs>=t||a(d)>=Ny,"currentlySlow");return e.resources.register(Ns,()=>{let d=[...i.routes.values()].filter(l);return{schemaVersion:1,revision:e.resources.revision(Ns)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,routes:d.map(c=>({method:c.method,route:c.route,worstRecentMs:Math.max(...c.recent),lastDurationMs:c.lastDurationMs,lastSeenAt:c.lastSeenAt,samples:c.samples,slowSamples:c.slowSamples,recentSlowSamples:a(c),worstEverMs:c.worstEverMs,worstEverAt:c.worstEverAt})).sort((c,p)=>p.worstRecentMs-c.worstRecentMs),routesTracked:i.routes.size,recentSampleWindow:Ms,minRecentSlowToKeep:Ny,lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No server request has ever been observed \u2014 this is NOT evidence the backend is fast, nothing is watching. Run the backend under the dev cluster (or with @lensmcp/nest-instrumentation) so request timings reach this session.":`${i.routes.size} route${i.routes.size===1?"":"s"} observed; ${d.length} slow in the last ${Ms} calls each (\u2265${t}ms).`}}),{unsubscribe:n,uris:[Ns]}}s(My,"gv"),o(My,"installPerfReducer");var Os="perf://duplicate-requests",up=10,Oy=2,OC=200,Ry=300,RC=new Set(["t","_","cacheBust","ts"]),TC=8,Ty=2,PC="react";function Py(e,t){return t.start<=e.end+Ty&&t.end>=e.start-Ty}s(Py,"wO"),o(Py,"sameRequest");function Uy(e){try{let t=new URL(e,"http://lensmcp.invalid");for(let u of[...t.searchParams.keys()])RC.has(u)&&t.searchParams.delete(u);let r=t.searchParams.toString(),i=`${t.pathname}${r?`?${r}`:""}`;return t.host==="lensmcp.invalid"?i:`${t.origin}${i}`}catch{return e}}s(Uy,"V_"),o(Uy,"normalizeRequestUrl");function qy(e){if(e.length===0)return 0;let t=[];for(let{start:u,end:n}of e)t.push({at:u,delta:1}),t.push({at:n+1,delta:-1});t.sort((u,n)=>u.at-n.at||u.delta-n.delta);let r=0,i=0;for(let{delta:u}of t)r+=u,r>i&&(i=r);return i}s(qy,"G_"),o(qy,"peakConcurrency");function Zy(e){let t=Ye(e.thresholds).duplicateRequestPeak,r=(e.now??(()=>Date.now()))(),i={endpoints:new Map},u=o((p,m,f)=>{p.open.delete(m),f.windows.length!==0&&(p.recentPeaks.push(f.peak),p.recentPeaks.length>up&&p.recentPeaks.splice(0,p.recentPeaks.length-up))},"closeFlow"),n=o(p=>{if(p.source!==PC||p.category!=="network")return;let m=p.raw??null;if(m?.kind!=="fetch-done"&&m?.kind!=="fetch-error"||!m.url||!m.method)return;let f=Uy(m.url),h=m.method.toUpperCase();if(typeof m.startedAt!="number")return;let g=m.startedAt,b=g+(typeof m.durationMs=="number"?m.durationMs:0),x=p.context?.originNodeId??null,$=p.context?.flowId??null,w=p.context?.tabId??"-",k=m.requestId??p.context?.requestId,C=k?`${w}|${k}`:void 0,M=`${h} ${f} @ ${x??"-"}`,y=i.endpoints.get(M);y||(y={method:h,url:f,originNodeId:x,open:new Map,recentPeaks:[],totalRequests:0,repeatedReceipts:0,lastSeenAt:p.timestamp,worstEverPeak:0,worstEverAt:p.timestamp}),i.endpoints.delete(M),i.endpoints.set(M,y);let D=y.open.get(w);if(D&&D.flowId!==$&&(u(y,w,D),D=void 0),D||(D={flowId:$,windows:[],byIdentity:new Map,peak:0}),y.open.delete(w),y.open.set(w,D),y.open.size>TC){let[N,K]=y.open.entries().next().value;u(y,N,K)}let A={start:g,end:b},j=C?D.byIdentity.get(C):void 0;if(j&&Py(j,A))j.start=Math.min(j.start,g),j.end=Math.max(j.end,b),y.repeatedReceipts+=1;else{let N=C?{...A,identity:C}:A;if(D.windows.push(N),C&&D.byIdentity.set(C,N),D.windows.length>Ry)for(let K of D.windows.splice(0,D.windows.length-Ry))K.identity&&D.byIdentity.get(K.identity)===K&&D.byIdentity.delete(K.identity);y.totalRequests+=1}if(D.peak=qy(D.windows),y.lastSeenAt=p.timestamp,D.peak>y.worstEverPeak&&(y.worstEverPeak=D.peak,y.worstEverAt=p.timestamp),i.endpoints.size>OC){let N=i.endpoints.keys().next().value;N!==void 0&&i.endpoints.delete(N)}i.lastSampleAt=Math.max(i.lastSampleAt??0,p.timestamp),i.changedAt=p.timestamp,e.resources.markDirty(Os)},"handler"),a=e.bus.subscribe(n),l=o(p=>[...p.open.values()].filter(m=>m.windows.length>0).map(m=>m.peak),"openPeaks"),d=o(p=>{let m=[...p.recentPeaks,...l(p)],f=0;for(let h=m.length-1;h>=0&&!((m[h]??0)>=t);h-=1)f+=1;return f},"consecutiveCleanFlows"),c=o(p=>p.worstEverPeak>=t&&d(p)<Oy,"currentlyDuplicated");return e.resources.register(Os,()=>{let p=[...i.endpoints.values()].filter(c);return{schemaVersion:1,revision:e.resources.revision(Os)??0,updatedAt:new Date(i.changedAt??r).toISOString(),peakThreshold:t,endpoints:p.map(m=>({method:m.method,url:m.url,originNodeId:m.originNodeId,peakConcurrent:l(m).at(-1)??0,cleanFlowsSince:d(m),flowsObserved:m.recentPeaks.length+l(m).length,totalRequests:m.totalRequests,repeatedReceipts:m.repeatedReceipts,worstEverPeak:m.worstEverPeak,worstEverAt:m.worstEverAt,lastSeenAt:m.lastSeenAt})).sort((m,f)=>f.peakConcurrent-m.peakConcurrent),endpointsTracked:i.endpoints.size,recentFlowWindow:up,minCleanFlowsToRetract:Oy,lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No browser fetch has ever been observed \u2014 this is NOT evidence the app fetches cleanly, nothing is watching. Load a page under the dev cluster so flow-fetch events reach this session.":p.length===0?`${i.endpoints.size} endpoint${i.endpoints.size===1?"":"s"} observed; none exceeded ${t} concurrent identical calls.`:`${p.length} endpoint${p.length===1?"":"s"} called \u2265${t}\xD7 concurrently \u2014 usually a hook fetching outside the shared resource cache, multiplied by however many components mount it.`}}),{unsubscribe:a,uris:[Os]}}s(Zy,"yv"),o(Zy,"installDuplicateRequestsReducer");import{App as UC}from"@frontmcp/sdk";import{Resource as qC,ResourceContext as ZC}from"@frontmcp/sdk";var rp=class extends ZC{static{s(this,"bv")}static{o(this,"DbSlowQueriesResource")}async execute(){return this.get(Z).read("db://slow-queries")}};rp=F([qC({name:"db-slow-queries",uri:"db://slow-queries",mimeType:"application/json",description:"Query shapes (project\xB7op\xB7table) whose worst observed duration crosses the slowQueryMs threshold, aggregated live from the pg instrumentation. counts are an undercount for hot shapes (the emitter flood-guards per shape); suppressedEvents carries the drop count."})],rp);var LC=rp;import{Resource as VC,ResourceContext as JC}from"@frontmcp/sdk";var ip=class extends JC{static{s(this,"xv")}static{o(this,"DbAnalysisResource")}async execute(){return this.get(Z).read("db://analysis")}};ip=F([VC({name:"db-analysis",uri:"db://analysis",mimeType:"application/json",description:"The latest DB analyzer run per project (missing indexes, seq-scan hot spots, unused indexes, migration-parity drift, slow statements) \u2014 ingested from the workspace analyzer's `db-analyze-run` events on the lens bus file."})],ip);var WC=ip,Ly=class{static{s(this,"_v")}static{o(this,"DbApp")}};Ly=F([UC({id:"db",name:"Db",description:"Database signals: slow query shapes observed live from the pg instrumentation, and the latest externally-ingested analyzer run (missing indexes, migration parity, unused indexes).",resources:[LC,WC]})],Ly);var ei="db://slow-queries",Rs="db://analysis",Vy=50,GC=20,KC=200,HC=1e3,XC=["statements","failed","workMs","recorded","suppressed","unwritten"];function Jy(e){let t=e[gd];if(!t)return;let r=Array.isArray(t.paths)?t.paths:[];for(let i of r){let u=typeof i=="string"?/^findings\[\] \(\+(\d+) items dropped\)$/.exec(i):null;if(u)return Number(u[1])}return r.some(i=>typeof i=="string"&&i.startsWith("findings"))?0:void 0}s(Jy,"AO"),o(Jy,"findingsDroppedByClamp");function Wy(e){let t=Ye(e.thresholds).slowQueryMs,r=(e.now??(()=>Date.now()))(),i={shapes:new Map,analyzeRuns:new Map,accounts:new Map,accountsSeen:0,census:{statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0}},u=o(l=>{let d=l.raw??null;if(d){if(d.kind==="db-query"){let c=d.project??"unknown",p=d.op??"query",m=d.table??"query",f=d.durationMs??0,h=`${c}|${p}|${m}`,g=i.shapes.get(h);if(g||(g={project:c,op:p,table:m,count:0,errorCount:0,totalMs:0,maxMs:0,maxAt:l.timestamp,recent:[],rowsTotal:0,lastSql:"",lastDurationMs:0,lastSeenAt:l.timestamp,suppressed:0}),i.shapes.delete(h),i.shapes.set(h,g),g.count+=1,d.error!==void 0&&(g.errorCount+=1),g.totalMs+=f,f>g.maxMs&&(g.maxMs=f,g.maxAt=l.timestamp),g.recent.push(f),g.recent.length>Vy&&g.recent.splice(0,g.recent.length-Vy),g.rowsTotal+=d.rows??0,d.query&&(g.lastSql=d.query),g.lastDurationMs=f,g.lastSeenAt=l.timestamp,g.suppressed+=d.floodSuppressed??0,i.shapes.size>KC){let b=i.shapes.keys().next().value;b!==void 0&&i.shapes.delete(b)}i.lastQueryAt=Math.max(i.lastQueryAt??0,l.timestamp),i.changedAt=l.timestamp,e.resources.markDirty(ei);return}if(d.kind==="db-request-account"){let c=d,p=typeof c.accountId=="string"?c.accountId:l.id,m=typeof c.seq=="number"?c.seq:0,f=i.accounts.get(p);if(f&&f.seq>=m)return;let h={seq:m,statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0};for(let g of XC){let b=c[g];h[g]=typeof b=="number"&&Number.isFinite(b)?b:0,i.census[g]+=h[g]-(f?.[g]??0)}if(f||(i.accountsSeen+=1),i.accounts.delete(p),i.accounts.set(p,h),i.accounts.size>HC){let g=i.accounts.keys().next().value;g!==void 0&&i.accounts.delete(g)}i.changedAt=l.timestamp,e.resources.markDirty(ei);return}if(d.kind==="db-analyze-run"){let c=d.project??"unknown",p=Jy(d);i.analyzeRuns.set(c,{project:c,runAt:d.runAt??l.timestamp,tool:d.tool??"unknown",findings:Array.isArray(d.findings)?d.findings:[],...p!==void 0?{droppedFindings:p}:{}}),qt(i.analyzeRuns,qr),i.lastAnalyzeAt=Math.max(i.lastAnalyzeAt??0,l.timestamp),i.changedAt=l.timestamp,e.resources.markDirty(Rs)}}},"handler"),n=e.bus.subscribe(u),a=o(l=>{if(l.length===0)return 0;let d=[...l].sort((c,p)=>c-p);return d[Math.min(d.length-1,Math.floor(d.length*.95))]??0},"p95");return e.resources.register(ei,()=>{let l=[...i.shapes.values()].filter(d=>d.maxMs>=t);return{schemaVersion:1,revision:e.resources.revision(ei)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,queries:l.map(d=>({project:d.project,op:d.op,table:d.table,count:d.count,errorCount:d.errorCount,maxMs:d.maxMs,maxAt:d.maxAt,avgMs:Math.round(d.totalMs/Math.max(d.count,1)*10)/10,p95Ms:a(d.recent),rowsTotal:d.rowsTotal,lastDurationMs:d.lastDurationMs,lastSeenAt:d.lastSeenAt,lastSql:d.lastSql,suppressedEvents:d.suppressed})).sort((d,c)=>c.maxMs-d.maxMs).slice(0,GC),shapesTracked:i.shapes.size,...i.accountsSeen>0?{requestAccounting:{requests:i.accountsSeen,...i.census}}:{},note:"count/avg are an UNDERCOUNT for hot shapes: the emitter flood-guards each query-shape fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events, reported by the next admitted event of the shape \u2014 drops with none after them are missing from it. requestAccounting, when present, is the requests' own census (statements run vs recorded on the bus), exact including those; per flow, read flow.get's overview.sql.",lastSampleAt:i.lastQueryAt,producer:i.lastQueryAt===void 0?"none":"connected",detail:i.lastQueryAt===void 0?"No db-query event has ever been observed \u2014 this is NOT evidence queries are fast, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps pg) so query timings reach this session.":`${i.shapes.size} query shape${i.shapes.size===1?"":"s"} observed; ${l.length} with a worst duration \u2265${t}ms.`}}),e.resources.register(Rs,()=>{let l=[...i.analyzeRuns.values()].sort((x,$)=>$.runAt-x.runAt),d=l.flatMap(x=>x.findings),c=d.length,p=d.filter(x=>x.severity==="error").length,m=d.filter(x=>x.severity==="warning").length,f=c-p-m,h=l.filter(x=>x.droppedFindings!==void 0),g=h.reduce((x,$)=>x+($.droppedFindings??0),0),b=h.length>0;return{schemaVersion:1,revision:e.resources.revision(Rs)??0,updatedAt:new Date(i.changedAt??r).toISOString(),runs:l,findingCount:c,errorCount:p,warningCount:m,infoCount:f,...b?{incomplete:!0,droppedFindings:g}:{},lastSampleAt:i.lastAnalyzeAt,producer:i.lastAnalyzeAt===void 0?"none":"connected",detail:i.lastAnalyzeAt===void 0?"No db-analyze run has ever been ingested \u2014 this is NOT evidence the schema is healthy, nothing has analyzed it. Run the workspace's DB analyzer (it appends a `db-analyze-run` event to the lens bus file) to populate this.":`${l.length} analyze run${l.length===1?"":"s"} held (latest per project); ${c} finding${c===1?"":"s"} (${p} error, ${m} warning, ${f} info).`+(b?` INCOMPLETE: ${g>0?`${g} more findings were`:"part of a run was"} cut by the bus payload bound before reaching the lens (an event over 32 KiB keeps only the first 64 items of a list), and the cut takes whatever came last. The analyzer must keep one run under that bound, most severe first.`:"")}}),{unsubscribe:n,uris:[ei,Rs]}}s(Wy,"kv"),o(Wy,"installDbReducer");import{App as YC}from"@frontmcp/sdk";import{Resource as QC,ResourceContext as ek}from"@frontmcp/sdk";var np=class extends ek{static{s(this,"Sv")}static{o(this,"NetEgressHostsResource")}async execute(){return this.get(Z).read("net://egress/hosts")}};np=F([QC({name:"net-egress-hosts",uri:"net://egress/hosts",mimeType:"application/json",description:"External hosts this backend called (pod \u2192 third party), rolled up per project\xB7host with count, error/4xx/5xx counters, p95 and worst duration, plus the top endpoints under each. `slow` and `failing` are retracted by later healthy responses, so a one-off blip does not warn all day."})],np);var tk=np;import{Resource as uk,ResourceContext as rk}from"@frontmcp/sdk";var sp=class extends rk{static{s(this,"Rv")}static{o(this,"NetEgressRecentResource")}async execute(){return this.get(Z).read("net://egress/recent")}};sp=F([uk({name:"net-egress-recent",uri:"net://egress/recent",mimeType:"application/json",description:"The last 200 outbound calls with their RAW path and the flowId that caused them \u2014 the evidence behind net://egress/hosts. Query strings are never captured; treat this as the sensitive view, since a path segment can itself be a secret."})],sp);var ik=sp;import{Resource as nk,ResourceContext as sk}from"@frontmcp/sdk";var ap=class extends sk{static{s(this,"Tv")}static{o(this,"NetEgressFailuresResource")}async execute(){return this.get(Z).read("net://egress/failures")}};ap=F([nk({name:"net-egress-failures",uri:"net://egress/failures",mimeType:"application/json",description:"Outbound calls that failed \u2014 transport errors and any status \u2265 400 \u2014 kept in their own ring so a high-volume host cannot evict the one failure you need. Empty is NOT proof nothing failed: check `producer`."})],ap);var ak=ap,Gy=class{static{s(this,"jv")}static{o(this,"NetApp")}};Gy=F([YC({id:"net",name:"Net",description:"Outbound (egress) HTTP the backend makes to THIRD PARTIES \u2014 which external services, how often, how slow, and whether they failed. The server-side twin of runtime://browser/network. Internal service-to-service traffic is deliberately absent: the gateway already attributes it.",resources:[tk,ik,ak]})],Gy);var Ts="net://egress/hosts",Ps="net://egress/recent",Us="net://egress/failures",Iu=20,ok=25,lk=200,dk=20,ck=5,Ky=200,Hy=50,Xy=2;function Yy(e){return e.length===0?!1:!!(/^\d{2,}$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[A-Z][A-Z0-9]*-\d+$/.test(e)||e.length>=16&&/^[A-Za-z0-9_-]+$/.test(e)&&/\d/.test(e))}s(Yy,"BO"),o(Yy,"isIdSegment");function Qy(e){let[t="/"]=e.split("?"),r=t.split("/"),i=[];for(let n of r){if(i.length>12){i.push("\u2026");break}i.push(Yy(n)?":id":n)}let u=i.join("/");return u.length===0?"/":u}s(Qy,"H_"),o(Qy,"templatisePath");function eE(e){let t=Ye(e.thresholds).slowEgressMs,r=(e.now??(()=>Date.now()))(),i={hosts:new Map,recent:[],failures:[]},u=o(p=>{let m=p.raw??null;if(!m||m.kind!=="egress")return;let f=m.project??"unknown",h=m.host??"unknown",g=(m.method??"GET").toUpperCase(),b=m.durationMs??0,x=typeof m.status=="number"?m.status:void 0,$=m.error===void 0?void 0:String(m.error),w=$!==void 0||x!==void 0&&x>=400,k=m.path??"(path not captured \u2014 upgrade @lensmcp/node-instrumentation)",C=`${f}|${h}`,M=i.hosts.get(C);M||(M={project:f,host:h,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,maxAt:p.timestamp,recent:[],outcomes:[],firstSeenAt:p.timestamp,lastSeenAt:p.timestamp,lastDurationMs:0,lastBad:!1,suppressed:0,endpoints:new Map}),i.hosts.delete(C),i.hosts.set(C,M),M.count+=1,$!==void 0&&(M.errorCount+=1),x!==void 0&&x>=400&&x<500&&(M.status4xx+=1),x!==void 0&&x>=500&&(M.status5xx+=1),M.totalMs+=b,b>M.maxMs&&(M.maxMs=b,M.maxAt=p.timestamp),M.recent.push(b),M.recent.length>Iu&&M.recent.splice(0,M.recent.length-Iu),M.outcomes.push(w),M.outcomes.length>Iu&&M.outcomes.splice(0,M.outcomes.length-Iu),M.lastDurationMs=b,M.lastBad=w,M.lastSeenAt=p.timestamp,M.suppressed+=m.floodSuppressed??0;let y=Qy(k),D=`${g} ${y}`,A=M.endpoints.get(D);if(A||(A={method:g,path:y,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,recent:[],lastDurationMs:0,lastSeenAt:p.timestamp}),M.endpoints.delete(D),M.endpoints.set(D,A),A.count+=1,$!==void 0&&(A.errorCount+=1,A.lastError=$),x!==void 0&&x>=400&&x<500&&(A.status4xx+=1),x!==void 0&&x>=500&&(A.status5xx+=1),A.totalMs+=b,b>A.maxMs&&(A.maxMs=b),A.recent.push(b),A.recent.length>Iu&&A.recent.splice(0,A.recent.length-Iu),A.lastStatus=x,A.lastDurationMs=b,A.lastSeenAt=p.timestamp,M.endpoints.size>dk){let K=M.endpoints.keys().next().value;K!==void 0&&M.endpoints.delete(K)}if(i.hosts.size>lk){let K=i.hosts.keys().next().value;K!==void 0&&i.hosts.delete(K)}let j=p.context??{},N={id:p.id,timestamp:p.timestamp,project:f,method:g,host:h,path:k,...x!==void 0?{status:x}:{},...$!==void 0?{error:$}:{},durationMs:b,...j.flowId?{flowId:j.flowId}:{},...j.requestId?{requestId:j.requestId}:{}};i.recent.push(N),i.recent.length>Ky&&i.recent.splice(0,i.recent.length-Ky),w&&(i.failures.push(N),i.failures.length>Hy&&i.failures.splice(0,i.failures.length-Hy),e.resources.markDirty(Us)),i.lastSampleAt=Math.max(i.lastSampleAt??0,p.timestamp),i.changedAt=p.timestamp,e.resources.markDirty(Ts),e.resources.markDirty(Ps)},"handler"),n=e.bus.subscribe(u),a=o(p=>{if(p.length===0)return 0;let m=[...p].sort((f,h)=>f-h);return m[Math.min(m.length-1,Math.floor(m.length*.95))]??0},"p95"),l=o(p=>p.lastDurationMs>=t||p.recent.filter(m=>m>=t).length>=Xy,"isSlow"),d=o(p=>p.lastBad||p.outcomes.filter(Boolean).length>=Xy,"isFailing"),c=o(p=>{let m=p.outcomes.filter(Boolean).length;return d(p)?`${m} of the last ${p.outcomes.length} call${p.outcomes.length===1?"":"s"} failed`:l(p)?`${p.recent.filter(f=>f>=t).length} of the last ${p.recent.length} call${p.recent.length===1?"":"s"} took \u2265${t}ms`:"healthy"},"describe");return e.resources.register(Ts,()=>{let p=[...i.hosts.values()],m=p.filter(d),f=p.filter(h=>!d(h)&&l(h));return{schemaVersion:1,revision:e.resources.revision(Ts)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,hosts:p.map(h=>({project:h.project,host:h.host,count:h.count,errorCount:h.errorCount,status4xx:h.status4xx,status5xx:h.status5xx,avgMs:Math.round(h.totalMs/Math.max(h.count,1)*10)/10,p95Ms:a(h.recent),maxMs:h.maxMs,maxAt:h.maxAt,lastDurationMs:h.lastDurationMs,firstSeenAt:h.firstSeenAt,lastSeenAt:h.lastSeenAt,slow:l(h),failing:d(h),detail:c(h),suppressedEvents:h.suppressed,endpoints:[...h.endpoints.values()].map(g=>({method:g.method,path:g.path,count:g.count,errorCount:g.errorCount,status4xx:g.status4xx,status5xx:g.status5xx,avgMs:Math.round(g.totalMs/Math.max(g.count,1)*10)/10,p95Ms:a(g.recent),maxMs:g.maxMs,...g.lastStatus!==void 0?{lastStatus:g.lastStatus}:{},...g.lastError!==void 0?{lastError:g.lastError}:{},lastSeenAt:g.lastSeenAt})).sort((g,b)=>b.maxMs-g.maxMs).slice(0,ck)})).sort((h,g)=>h.failing!==g.failing?h.failing?-1:1:g.maxMs-h.maxMs).slice(0,ok),hostsTracked:i.hosts.size,failingHosts:m.length,slowHosts:f.length,note:"count/avg are an UNDERCOUNT for hot hosts: the emitter flood-guards each host fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events. Query strings are not captured; endpoint paths are templatised (\u2026/:id).",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps fetch and http/https) so outbound calls reach this session. Internal destinations (*.local, loopback, RFC1918) are skipped by design \u2014 the gateway already attributes service-to-service traffic.":`${i.hosts.size} external host${i.hosts.size===1?"":"s"} observed; ${m.length} failing, ${f.length} slower than ${t}ms.`}}),e.resources.register(Ps,()=>({schemaVersion:1,revision:e.resources.revision(Ps)??0,updatedAt:new Date(i.changedAt??r).toISOString(),entries:[...i.recent],count:i.recent.length,note:"Raw paths, as requested. flowId joins an outbound call back to the click that caused it. Treat this as the sensitive view: a path segment can itself be a secret (a presigned key, a reset token), which the templatised rollup collapses but this does not.",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching.":`${i.recent.length} recent outbound call${i.recent.length===1?"":"s"}.`})),e.resources.register(Us,()=>({schemaVersion:1,revision:e.resources.revision(Us)??0,updatedAt:new Date(i.changedAt??r).toISOString(),entries:[...i.failures],count:i.failures.length,note:"A separate ring from net://egress/recent on purpose: a host called 200\xD7/min would otherwise evict the one 503 you need.",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 an empty list here is NOT evidence that nothing failed, nothing is watching.":`${i.failures.length} failed outbound call${i.failures.length===1?"":"s"} held.`})),{unsubscribe:n,uris:[Ts,Ps,Us]}}s(eE,"zv"),o(eE,"installNetReducer");import{App as pk}from"@frontmcp/sdk";import{Resource as mk,ResourceContext as fk}from"@frontmcp/sdk";var op=class extends fk{static{s(this,"Ov")}static{o(this,"VisualCurrentResource")}async execute(){return this.get(Z).read("visual://current")}};op=F([mk({name:"visual-current",uri:"visual://current",mimeType:"application/json",description:"Most recent visual-frame (causedBy, changedNodes, stable)."})],op);var hk=op;import{Resource as gk,ResourceContext as vk}from"@frontmcp/sdk";var lp=class extends vk{static{s(this,"Nv")}static{o(this,"VisualViolationsCurrentResource")}async execute(){return this.get(Z).read("visual://violations/current")}};lp=F([gk({name:"visual-violations-current",uri:"visual://violations/current",mimeType:"application/json",description:"Violations of the CURRENT frame, regardless of timing mode. Every rule re-runs per frame, so a fixed violation simply stops being reported."})],lp);var yk=lp;import{Resource as Ek,ResourceContext as bk}from"@frontmcp/sdk";var dp=class extends bk{static{s(this,"Dv")}static{o(this,"VisualViolationsStableResource")}async execute(){return this.get(Z).read("visual://violations/stable")}};dp=F([Ek({name:"visual-violations-stable",uri:"visual://violations/stable",mimeType:"application/json",description:'Violations from rules with timing "after-animation" | "stable-only" | "always".'})],dp);var wk=dp;import{Resource as Dk,ResourceContext as $k}from"@frontmcp/sdk";var cp=class extends $k{static{s(this,"Uv")}static{o(this,"VisualViolationsDuringAnimationResource")}async execute(){return this.get(Z).read("visual://violations/during-animation")}};cp=F([Dk({name:"visual-violations-during-animation",uri:"visual://violations/during-animation",mimeType:"application/json",description:"Violations seen on midpoint (during-animation) samples only."})],cp);var Bk=cp;import{Resource as xk,ResourceContext as Ck}from"@frontmcp/sdk";var pp=class extends Ck{static{s(this,"Fv")}static{o(this,"VisualRulesResource")}async execute(){return this.get(Z).read("visual://rules")}};pp=F([xk({name:"visual-rules",uri:"visual://rules",mimeType:"application/json",description:"All registered visual rules (builtins + lensmcp.rules.json + visual.register_rule)."})],pp);var kk=pp;import{Resource as Ak,ResourceContext as Ik}from"@frontmcp/sdk";var mp=class extends Ik{static{s(this,"Zv")}static{o(this,"VisualTokensResource")}async execute(){return this.get(Z).read("visual://tokens")}};mp=F([Ak({name:"visual-tokens",uri:"visual://tokens",mimeType:"application/json",description:"Resolved design tokens from lensmcp.tokens.json."})],mp);var _k=mp;import{Tool as Sk,ToolContext as Fk,z as tE}from"@frontmcp/sdk";import{existsSync as jk,mkdirSync as zk,readFileSync as Nk,writeFileSync as Mk}from"node:fs";import{dirname as Ok,join as fp}from"node:path";function hp(e=process.env,t=process.cwd()){let r=e.LENSMCP_EVENT_FILE;return r?Ok(r):fp(t,".lensmcp")}s(hp,"Ua"),o(hp,"captureDir");function uE(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(uE,"sM"),o(uE,"pidAlive");function gp(e,t=uE){let r=fp(e,PD);try{if(!jk(r))return;let i=JSON.parse(Nk(r,"utf8"));return typeof i?.pid!="number"||!Number.isFinite(i.pid)?void 0:t(i.pid)?i:void 0}catch{return}}s(gp,"La"),o(gp,"liveRunner");function rE(e,t){try{return zk(e,{recursive:!0}),Mk(fp(e,TD),JSON.stringify(t)),!0}catch{return!1}}s(rE,"Y_"),o(rE,"publishCaptureRequest");var vp;async function iE(e,t){let r=vp;if(r)return{fresh:await r.promise,coalesced:!0,requestId:r.requestId};let i=t().finally(()=>{vp=void 0});return vp={promise:i,requestId:e},{fresh:await i,coalesced:!1,requestId:e}}s(iE,"Q_"),o(iE,"captureSingleFlight");async function nE(e){let t=e.now??(()=>Date.now()),r=e.sleep??(a=>new Promise(l=>setTimeout(l,a))),i=e.budgetMs??8e3,u=e.pollMs??100,n=t()+i;for(;t()<n;){await r(u);let a=await e.readFrameId();if(a!==void 0&&a!==e.before)return!0}return!1}s(nE,"ek"),o(nE,"waitForFreshFrame");var yp=class extends Fk{static{s(this,"Jv")}static{o(this,"VisualCaptureFrameTool")}async execute(e){let t=this.get(Ur),r=this.get(Z),i=o(async()=>(await r.read("visual://current"))?.frame?.id,"readFrameId"),u=await i(),n=lt(),a=Date.now();t.publish({id:lt(),sessionId:"visual.capture_frame",timestamp:a,source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.capture_frame"},fingerprint:`visual-capture-request:${e.cause}`,title:`visual.capture_frame(${e.cause})`,raw:{kind:"visual-capture-request",cause:e.cause,stable:e.stable,requestId:n}});let l=hp(),d=gp(l),c=!1,p=await iE(n,async()=>(c=rE(l,{requestedAt:a,cause:e.cause,stable:e.stable,requestId:n}),c&&d?await nE({readFrameId:i,before:u}):!1));return{requested:p.coalesced?!0:c,cause:e.cause,stable:e.stable,fresh:p.fresh,coalesced:p.coalesced,requestId:p.requestId,waitedMs:Date.now()-a,runner:d?{pid:d.pid,url:d.url}:void 0,latest:await r.read("visual://current")}}};yp=F([Sk({name:"visual.capture_frame",description:"Capture a fresh visual frame. Signals the host capture runner (which launches a headless browser on demand), waits for the new frame, and returns it. Frames are captured per request \u2014 no browser is held open between calls.",inputSchema:{cause:tE.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]).default("user-action").describe("Hint why this frame is being requested."),stable:tE.boolean().default(!0).describe("Whether to treat the captured frame as the stable final state.")}})],yp);var Rk=yp;import{Tool as Tk,ToolContext as Pk,z as Uk}from"@frontmcp/sdk";var Ep=class extends Pk{static{s(this,"Kv")}static{o(this,"VisualInspectNodeTool")}async execute(e){let t=await this.get(Z).read("visual://current");if(!t.frame)return{found:!1,uid:e.uid};let r=t.frame.changedNodes.filter(i=>i.uid===e.uid);return{found:r.length>0,uid:e.uid,frameId:t.frame.id,changes:r}}};Ep=F([Tk({name:"visual.inspect_node",description:"Returns the changedNodes entry for `uid` from visual://current \u2014 the per-property before/after used to compute the latest frame.",inputSchema:{uid:Uk.string().describe('Node uid as it appeared in visual://current.changedNodes (e.g. "hero-card" or "bid:42").')}})],Ep);var qk=Ep;import{Tool as Zk,ToolContext as Lk,z as Vk}from"@frontmcp/sdk";var bp=class extends Lk{static{s(this,"Hv")}static{o(this,"VisualCompareFramesTool")}async execute(e){let t=await this.get(Z).read("visual://current");return t.frame?e.frameId&&e.frameId!==t.frame.id?{found:!1,reason:"Only the latest frame is retained in Phase 4."}:{found:!0,frameId:t.frame.id,causedBy:t.frame.causedBy,changedCount:t.frame.changedNodes.length,appeared:t.frame.appearedNodes.length,disappeared:t.frame.disappearedNodes.length,changedNodes:t.frame.changedNodes.slice(0,50)}:{found:!1}}};bp=F([Zk({name:"visual.compare_frames",description:"Summarises the last visual-frame. Phase 4 ships a single-frame view (Phase 6 adds story-relative deltas).",inputSchema:{frameId:Vk.string().optional().describe("Optional frame id; defaults to the latest.")}})],bp);var Jk=bp;import{Tool as Wk,ToolContext as Gk,z as Kk}from"@frontmcp/sdk";var wp=class extends Gk{static{s(this,"Qv")}static{o(this,"VisualExplainViolationTool")}async execute(e){let t=(await this.get(Z).read("visual://violations/current")).violations.find(r=>r.id===e.violationId);return t?{found:!0,violation:t,explanation:sE(t)}:{found:!1,violationId:e.violationId}}};wp=F([Wk({name:"visual.explain_violation",description:"Returns the full violation record (rule id + expected/actual + evidence.cssCause / trace / screenshot crop URIs) for a given violationId.",inputSchema:{violationId:Kk.string().describe("Id of the violation as seen in visual://violations/current.")}})],wp);var Hk=wp;function sE(e){let t=[`Rule ${e.ruleId} (${e.ruleType}) at ${e.element.component??e.element.uid}.`,`Expected: ${JSON.stringify(e.expected)}`,`Actual: ${JSON.stringify(e.actual)}`];return e.evidence.cssCause&&t.push(`CSS cause: ${e.evidence.cssCause.selector} { ${e.evidence.cssCause.declaration??"?"} }`+(e.evidence.cssCause.file?` @ ${e.evidence.cssCause.file}:${e.evidence.cssCause.line??"?"}`:"")),e.evidence.trace&&t.push(`Trace: ${e.evidence.trace}`),e.evidence.screenshotCrop&&t.push(`Crop: ${e.evidence.screenshotCrop}`),t.join(`
|
|
71
|
-
`)}s(sE,"yM"),o(sE,"buildExplanation");import{Tool as Xk,ToolContext as Yk,z as Me}from"@frontmcp/sdk";import{mkdirSync as Qk,readFileSync as e7,renameSync as t7,writeFileSync as u7}from"node:fs";import{join as r7}from"node:path";var i7=500;function aE(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(aE,"SM"),o(aE,"pidAlive");function oE(e){try{let t=JSON.parse(e7(e,"utf8"));return Array.isArray(t?.rules)?t.rules:[]}catch{return[]}}s(oE,"IM"),o(oE,"readEntries");function lE(e,t,r={}){let i=r.pid??process.pid,u=r.isAlive??aE,n=r7(e,UD),a=[...oE(n).filter(d=>typeof d?.registeredBy=="number"&&typeof d?.rule?.id=="string"&&d.rule.id!==t.id&&(d.registeredBy===i||u(d.registeredBy))),{rule:t,registeredBy:i,registeredAt:(r.now??Date.now)()}].slice(-i7);Qk(e,{recursive:!0});let l=`${n}.${i}.tmp`;return u7(l,JSON.stringify({schemaVersion:1,rules:a})),t7(l,n),a}s(lE,"rk"),o(lE,"registerSessionRule");var Dp=class extends Yk{static{s(this,"ty")}static{o(this,"VisualRegisterRuleTool")}async execute(e){let t=this.get(Ur),r=this.get(Z),i={id:e.id,type:e.type,target:e.target,severity:e.severity,timing:e.timing,expected:e.expected,breakpoints:e.breakpoints};t.publish({id:lt(),sessionId:"visual.register_rule",timestamp:Date.now(),source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.register_rule"},fingerprint:`visual-rule-registered:${e.id}`,title:`visual.register_rule(${e.id})`,raw:{kind:"visual-rule-registered",rule:i}});let u=hp(),n=!1,a;try{lE(u,i),n=gp(u)!==void 0,a=n?"The capture runner evaluates this rule on the next captured frame (visual.capture_frame).":"No capture runner is listening, so nothing will evaluate this rule until one starts (the dev cluster gateway or agent-dev). It is listed, not enforced."}catch(l){a=`Could not hand the rule to the capture runner (${l.message}). It is listed, but will NOT be evaluated.`}return{registered:!0,evaluated:n,note:a,rule:{id:e.id,type:e.type,target:e.target},rules:await r.read("visual://rules")}}};Dp=F([Xk({name:"visual.register_rule",description:"Register (or replace) a visual rule. It is handed to the capture runner, which evaluates it on every frame captured from now on, for as long as this lens server runs. The result says whether a runner is listening; if `evaluated` is false the rule is only listed, and no violation can come of it.",inputSchema:{id:Me.string().describe("Stable rule id; replaces a prior rule with the same id."),type:Me.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]).describe("Built-in rule type to evaluate."),target:Me.string().optional().describe('CSS-like selector / role:label / [data-agent-component="\u2026"]; default = every node.'),severity:Me.enum(["info","warning","error"]).default("warning"),timing:Me.enum(["always","after-animation","stable-only","during-animation"]).default("always"),expected:Me.record(Me.string(),Me.unknown()).default({}).describe('Rule-type-specific expectations (e.g. { gap: "spacing.6" }).'),breakpoints:Me.record(Me.string(),Me.record(Me.string(),Me.unknown())).optional().describe("Per-breakpoint expectation overrides for the responsive rule type.")}})],Dp);var n7=Dp,dE=class{static{s(this,"ny")}static{o(this,"VisualApp")}};dE=F([pk({id:"visual",name:"Visual",description:"Visual rule engine: DOMSnapshot/LayerTree diffs, grid/alignment/overflow/contrast/z-index rules, design tokens.",resources:[hk,yk,wk,Bk,kk,_k],tools:[Rk,qk,Jk,Hk,n7]})],dE);var ti="visual://current",ui="visual://violations/current",ri="visual://violations/stable",ii="visual://violations/during-animation",ni="visual://rules",si="visual://tokens";function cE(e){let t=(e.now??(()=>Date.now()))(),r={violations:[],rules:[],framesSeen:0,changedAt:new Map},i=o((f,h)=>{r.changedAt.set(f,h),e.resources.markDirty(f)},"touch"),u=o(f=>{i(ui,f),i(ri,f),i(ii,f)},"touchViolationViews"),n=o(f=>{let h=f.raw??null;if(h?.kind)switch(h.kind){case"visual-frame":{let g=h.frame;if(!g)return;r.currentFrame=g,r.lastFrameAt=f.timestamp,r.framesSeen+=1,r.rulesEvaluated=typeof h.rulesEvaluated=="number"?h.rulesEvaluated:void 0,i(ti,f.timestamp);let b=r.violations.length;r.violations=r.violations.filter(x=>x.frameId===g.id),b!==r.violations.length&&u(f.timestamp);return}case"visual-violation":if(!h.violation)return;r.violations.push(h.violation),r.violations.length>50&&r.violations.splice(0,r.violations.length-50),u(f.timestamp);return;case"visual-rule-registered":{let g=h.rule;if(!g)return;let b=r.rules.findIndex(x=>x.id===g.id);b>=0&&r.rules.splice(b,1),r.rules.push(g),r.rules.length>500&&r.rules.splice(0,r.rules.length-500),i(ni,f.timestamp);return}case"visual-tokens-loaded":if(!h.tokens)return;r.tokens=h.tokens,i(si,f.timestamp);return;default:return}},"handler"),a=e.bus.subscribe(n),l=o(f=>new Date(r.changedAt.get(f)??t).toISOString(),"stamp"),d="No visual frame has ever been captured \u2014 an empty violation list is NOT evidence the UI is correct, nothing is looking. Drive a capture (visual_capture_frame) or run the browser-capture loop so frames reach this session.",c=o(()=>`${r.framesSeen} frame${r.framesSeen===1?"":"s"} captured`,"frameCount"),p=o(()=>({framesSeen:r.framesSeen,lastFrameAt:r.lastFrameAt,currentFrameId:r.currentFrame?.id,...r.rulesEvaluated!==void 0?{rulesEvaluated:r.rulesEvaluated}:{},producer:r.framesSeen===0?"none":"connected",detail:r.framesSeen===0?d:r.rulesEvaluated===void 0?`${c()}; ${r.rules.length} rule${r.rules.length===1?"":"s"} registered.`:`${c()}; ${r.rulesEvaluated} rule${r.rulesEvaluated===1?"":"s"} evaluated on the current one.`}),"frameHealth"),m=o(()=>{let f=p();return r.framesSeen===0||r.rulesEvaluated===void 0?r.framesSeen===0?f:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}:r.rulesEvaluated===0?{...f,producer:"none",detail:`${c()}, but NO rule was evaluated on the current one \u2014 an empty violation list is NOT evidence the UI is correct, nothing is being checked. Add rules to \`lensmcp.rules.json\` at the workspace root, or register one with visual.register_rule.`}:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}},"violationHealth");return e.resources.register(ti,()=>({schemaVersion:1,revision:e.resources.revision(ti)??0,updatedAt:l(ti),frame:r.currentFrame??null,...p()})),e.resources.register(ui,()=>({schemaVersion:1,revision:e.resources.revision(ui)??0,updatedAt:l(ui),violations:r.violations.slice(),...m()})),e.resources.register(ri,()=>({schemaVersion:1,revision:e.resources.revision(ri)??0,updatedAt:l(ri),violations:r.violations.filter(f=>f.timing==="after-animation"||f.timing==="stable-only"||f.timing==="always"),...m()})),e.resources.register(ii,()=>({schemaVersion:1,revision:e.resources.revision(ii)??0,updatedAt:l(ii),violations:r.violations.filter(f=>f.timing==="during-animation"),...m()})),e.resources.register(ni,()=>({schemaVersion:1,revision:e.resources.revision(ni)??0,updatedAt:l(ni),rules:r.rules.slice()})),e.resources.register(si,()=>({schemaVersion:1,revision:e.resources.revision(si)??0,updatedAt:l(si),tokens:r.tokens??null})),{unsubscribe:a,uris:[ti,ui,ri,ii,ni,si]}}s(cE,"oy"),o(cE,"installVisualReducer");import{App as s7}from"@frontmcp/sdk";import{Resource as a7,ResourceContext as o7}from"@frontmcp/sdk";var $p=class extends o7{static{s(this,"iy")}static{o(this,"ReactPagesCurrentResource")}async execute(){return this.get(Z).read("react://pages/current")}};$p=F([a7({name:"react-pages-current",uri:"react://pages/current",mimeType:"application/json",description:"The most recently active React page (from <LensmcpRoot>)."})],$p);var l7=$p;import{Resource as d7,ResourceContext as c7}from"@frontmcp/sdk";var Bp=class extends c7{static{s(this,"ay")}static{o(this,"ReactComponentsHotResource")}async execute(){return this.get(Z).read("react://components/hot")}};Bp=F([d7({name:"react-components-hot",uri:"react://components/hot",mimeType:"application/json",description:"Components ranked by render count this session."})],Bp);var p7=Bp;import{Resource as m7,ResourceContext as f7}from"@frontmcp/sdk";var xp=class extends f7{static{s(this,"uy")}static{o(this,"ReactRendersSlowResource")}async execute(){return this.get(Z).read("react://renders/slow")}};xp=F([m7({name:"react-renders-slow",uri:"react://renders/slow",mimeType:"application/json",description:"Renders with actualDurationMs >= threshold (default 16ms)."})],xp);var h7=xp;import{Resource as g7,ResourceContext as v7}from"@frontmcp/sdk";var Cp=class extends v7{static{s(this,"dy")}static{o(this,"ReactRendersRecentResource")}async execute(){return this.get(Z).read("react://renders/recent")}};Cp=F([g7({name:"react-renders-recent",uri:"react://renders/recent",mimeType:"application/json",description:"Last 100 render commits with attribution (why)."})],Cp);var y7=Cp;import{Resource as E7,ResourceContext as b7}from"@frontmcp/sdk";var kp=class extends b7{static{s(this,"fy")}static{o(this,"ReactEffectsRecentResource")}async execute(){return this.get(Z).read("react://effects/recent")}};kp=F([E7({name:"react-effects-recent",uri:"react://effects/recent",mimeType:"application/json",description:"Last 100 useEffect runs/cleanups from tracedUseEffect."})],kp);var w7=kp;import{Resource as D7,ResourceContext as $7}from"@frontmcp/sdk";var Ap=class extends $7{static{s(this,"hy")}static{o(this,"ReactMemosRecomputedResource")}async execute(){return this.get(Z).read("react://memos/recomputed")}};Ap=F([D7({name:"react-memos-recomputed",uri:"react://memos/recomputed",mimeType:"application/json",description:"Recent useMemo recomputations (depsHash changed)."})],Ap);var B7=Ap;import{Resource as x7,ResourceContext as C7}from"@frontmcp/sdk";var Ip=class extends C7{static{s(this,"vy")}static{o(this,"ReactHooksRecentResource")}async execute(){return this.get(Z).read("react://hooks/recent")}};Ip=F([x7({name:"react-hooks-recent",uri:"react://hooks/recent",mimeType:"application/json",description:"Recent hook-run events (useMemo / useCallback)."})],Ip);var k7=Ip;import{Tool as A7,ToolContext as I7,z as _p}from"@frontmcp/sdk";var Sp=class extends I7{static{s(this,"wy")}static{o(this,"GraphExplainRerenderTool")}async execute(e){let t=await this.get(Z).read("react://renders/recent"),r;if(e.renderNodeId)r=t.renders.find(u=>u.id===e.renderNodeId);else if(e.componentInstanceId)for(let u=t.renders.length-1;u>=0;u--){let n=t.renders[u];if(n&&n.componentInstanceId===e.componentInstanceId){r=n;break}}else if(e.componentLogicalId)for(let u=t.renders.length-1;u>=0;u--){let n=t.renders[u];if(n&&n.componentLogicalId===e.componentLogicalId){r=n;break}}if(!r)return{found:!1,searched:e};let i=(r.why??[]).map(u=>({...u,summary:pE(u)}));return{found:!0,renderNodeId:r.id,componentInstanceId:r.componentInstanceId,componentLogicalId:r.componentLogicalId,componentName:r.componentName,page:r.page,route:r.route,phase:r.phase,actualDurationMs:r.actualDurationMs,why:i,parentRenderId:r.parentRenderId}}};Sp=F([A7({name:"graph.explain_rerender",description:"Returns the most recent render record for a component (by `renderNodeId`, `componentInstanceId`, or `componentLogicalId`), with its `why` causal list (valtio-path / parent-render / hook-dep-changed / props / context / react-state / force).",inputSchema:{renderNodeId:_p.string().optional().describe("Exact render commit id from react://renders/recent."),componentInstanceId:_p.string().optional().describe("Component instance id; resolves to that instance\u2019s last render."),componentLogicalId:_p.string().optional().describe("Component logical id (e.g. react:component:src/App.tsx:CardGrid); resolves to its most recent render across HMR generations.")}})],Sp);var _7=Sp;function pE(e){switch(e.type){case"valtio-path":return`valtio path ${String(e.path)} changed (${e.changedKeys?.join(",")??""})`;case"react-state":return`useState hook #${String(e.hookIndex)} changed`;case"context":return`context ${String(e.contextName)} changed`;case"props":return`prop(s) changed: ${e.changedKeys?.join(",")??""}`;case"parent-render":return`parent render ${String(e.parentRenderId)} triggered this`;case"hook-dep-changed":return`hook ${String(e.hookInstanceId)} deps changed`;case"force":return`forced render: ${String(e.reason)}`;default:return`unknown cause: ${JSON.stringify(e)}`}}s(pE,"GM"),o(pE,"summariseWhy");var mE=class{static{s(this,"$y")}static{o(this,"ReactApp")}};mE=F([s7({id:"react",name:"React",description:"React render attribution: pages, hot components, slow renders, hook + effect + memo events. Hosts graph.explain_rerender.",resources:[l7,p7,h7,y7,w7,B7,k7],tools:[_7]})],mE);var ai="react://pages/current",qs="react://components/hot",Zs="react://renders/slow",Ls="react://renders/recent",Vs="react://effects/recent",Js="react://memos/recomputed",Ws="react://hooks/recent",Gs=100,Fp=50,fE=500;function hE(e){let t=Ye(e.thresholds).slowRenderMs,r={rendersRecent:[],rendersSlow:[],effectsRecent:[],hooksRecent:[],memosRecomputed:[],rendersByInstance:new Map,hotByLogical:new Map},i=o(n=>{if(n.source!=="react")return;let a=n.raw??null;if(a?.kind)switch(a.kind){case"render":{let l=a.render;if(!l)return;if(_u(r.rendersRecent,l,Gs),r.rendersByInstance.delete(l.componentInstanceId),r.rendersByInstance.set(l.componentInstanceId,l),r.rendersByInstance.size>fE){for(let c of r.rendersByInstance.keys())if(r.rendersByInstance.delete(c),r.rendersByInstance.size<=fE)break}l.actualDurationMs>=t&&(_u(r.rendersSlow,l,Fp),r.rendersSlow.sort((c,p)=>p.actualDurationMs-c.actualDurationMs),r.rendersSlow.length>Fp&&(r.rendersSlow.length=Fp));let d=r.hotByLogical.get(l.componentLogicalId);d?(d.renderCount+=1,d.totalActualMs+=l.actualDurationMs,d.lastRenderId=l.id):r.hotByLogical.set(l.componentLogicalId,{componentLogicalId:l.componentLogicalId,componentName:l.componentName,renderCount:1,totalActualMs:l.actualDurationMs,lastRenderId:l.id}),(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:n.timestamp},e.resources.markDirty(ai)),e.resources.markDirty(Ls),e.resources.markDirty(qs),l.actualDurationMs>=t&&e.resources.markDirty(Zs);return}case"effect-run":{let l=a.effect;if(!l)return;_u(r.effectsRecent,l,Gs),e.resources.markDirty(Vs);return}case"hook-run":{let l=a.hook;if(!l)return;_u(r.hooksRecent,l,Gs),e.resources.markDirty(Ws),l.recomputed&&l.hookType==="useMemo"&&(_u(r.memosRecomputed,l,Gs),e.resources.markDirty(Js));return}case"component-mount":case"component-unmount":{let l=a.component;if(!l)return;(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:n.timestamp},e.resources.markDirty(ai));return}default:return}},"handler"),u=e.bus.subscribe(i);return e.resources.register(ai,()=>({schemaVersion:1,revision:e.resources.revision(ai)??0,updatedAt:new Date().toISOString(),page:r.currentPage??null})),e.resources.register(qs,()=>({schemaVersion:1,revision:e.resources.revision(qs)??0,updatedAt:new Date().toISOString(),components:[...r.hotByLogical.values()].sort((n,a)=>a.renderCount-n.renderCount)})),e.resources.register(Zs,()=>({schemaVersion:1,revision:e.resources.revision(Zs)??0,updatedAt:new Date().toISOString(),thresholdMs:t,renders:r.rendersSlow.slice()})),e.resources.register(Ls,()=>({schemaVersion:1,revision:e.resources.revision(Ls)??0,updatedAt:new Date().toISOString(),renders:r.rendersRecent.slice()})),e.resources.register(Vs,()=>({schemaVersion:1,revision:e.resources.revision(Vs)??0,updatedAt:new Date().toISOString(),effects:r.effectsRecent.slice()})),e.resources.register(Js,()=>({schemaVersion:1,revision:e.resources.revision(Js)??0,updatedAt:new Date().toISOString(),memos:r.memosRecomputed.slice()})),e.resources.register(Ws,()=>({schemaVersion:1,revision:e.resources.revision(Ws)??0,updatedAt:new Date().toISOString(),hooks:r.hooksRecent.slice()})),{unsubscribe:u,uris:[ai,qs,Zs,Ls,Vs,Js,Ws],lookups:{latestRenderFor(n){return r.rendersByInstance.get(n)},latestRenderForLogical(n){if(r.hotByLogical.get(n))for(let a=r.rendersRecent.length-1;a>=0;a--){let l=r.rendersRecent[a];if(l&&l.componentLogicalId===n)return l}}}}}s(hE,"ky"),o(hE,"installReactReducer");function _u(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(_u,"Lo"),o(_u,"pushBounded");import{App as S7}from"@frontmcp/sdk";import{Resource as F7,ResourceContext as j7}from"@frontmcp/sdk";var jp=class extends j7{static{s(this,"Sy")}static{o(this,"ValtioUpdatesRecentResource")}async execute(){return this.get(Z).read("valtio://updates/recent")}};jp=F([F7({name:"valtio-updates-recent",uri:"valtio://updates/recent",mimeType:"application/json",description:"Last 100 Valtio state-update events with path + changedKeys + subscribers."})],jp);var z7=jp;import{Resource as N7,ResourceContext as M7}from"@frontmcp/sdk";var zp=class extends M7{static{s(this,"Ry")}static{o(this,"ValtioStoresResource")}async execute(){return this.get(Z).read("valtio://stores")}};zp=F([N7({name:"valtio-stores",uri:"valtio://stores",mimeType:"application/json",description:"Registered Valtio stores (created via lensmcp-wrapped proxy())."})],zp);var O7=zp;import{Resource as R7,ResourceContext as T7}from"@frontmcp/sdk";var Np=class extends T7{static{s(this,"Ty")}static{o(this,"ValtioSubscribersResource")}async execute(){return this.get(Z).read("valtio://subscribers")}};Np=F([R7({name:"valtio-subscribers",uri:"valtio://subscribers",mimeType:"application/json",description:"Per-(storeId, path) list of component instance ids currently subscribed via tracked useSnapshot."})],Np);var P7=Np,gE=class{static{s(this,"jy")}static{o(this,"ValtioApp")}};gE=F([S7({id:"valtio",name:"Valtio",description:"Valtio store + subscription tracking. Phase 5 ships updates/stores/subscribers; per-path subscriber walks land via graph.explain_rerender.",resources:[z7,O7,P7]})],gE);var Ks="valtio://updates/recent",Hs="valtio://stores",oi="valtio://subscribers",vE=100,yE=1e3,U7=1e3,q7=256,Z7=256;function EE(e,t){if(e.size<=t)return;let r=e.values();for(;e.size>t;){let i=r.next();if(i.done)break;e.delete(i.value)}}s(EE,"oN"),o(EE,"capSet");function Mp(e){let t=Array.isArray(e.paths)?e.paths.filter(r=>typeof r=="string"):void 0;return t&&t.length>0?t.slice(0,q7):typeof e.path=="string"?[e.path]:[]}s(Mp,"sk"),o(Mp,"subscriptionPaths");function Op(e){return e.componentLogicalId??e.componentInstanceId??"react:component:anonymous"}s(Op,"ak"),o(Op,"subscriberId");function bE(e){let t={updates:[],stores:new Map,subscribers:new Map,latestUpdateByPath:new Map},r=o(u=>{if(u.source!=="valtio")return;let n=u.raw??null;if(n?.kind)switch(n.kind){case"state-update":{let a=n.update;if(!a)return;let l={...a,emittedAt:u.timestamp};t.updates.push(l),t.updates.length>vE&&t.updates.splice(0,t.updates.length-vE);let d=`${a.storeId}::${a.path}`;if(t.latestUpdateByPath.delete(d),t.latestUpdateByPath.set(d,l),t.latestUpdateByPath.size>yE){for(let c of t.latestUpdateByPath.keys())if(t.latestUpdateByPath.delete(c),t.latestUpdateByPath.size<=yE)break}e.resources.markDirty(Ks);return}case"store-created":{let a=n.store;if(!a)return;t.stores.set(a.storeId,{...a,createdAt:u.timestamp}),e.resources.markDirty(Hs);return}case"subscription-added":{let a=n.subscription;if(!a||!a.componentInstanceId)return;let l=Op(a);for(let d of Mp(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);p||(p=new Map,t.subscribers.set(c,p));let m=p.get(l);m||(m=new Set,p.set(l,m)),m.add(a.componentInstanceId),qt(p,qr),EE(m,Z7)}qt(t.subscribers,U7),e.resources.markDirty(oi);return}case"subscription-removed":{let a=n.subscription;if(!a||!a.componentInstanceId)return;let l=Op(a);for(let d of Mp(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);if(!p)continue;let m=p.get(l);m&&(m.delete(a.componentInstanceId),m.size===0&&p.delete(l)),p.size===0&&t.subscribers.delete(c)}e.resources.markDirty(oi);return}default:return}},"handler"),i=e.bus.subscribe(r);return e.resources.register(Ks,()=>({schemaVersion:1,revision:e.resources.revision(Ks)??0,updatedAt:new Date().toISOString(),updates:t.updates.slice()})),e.resources.register(Hs,()=>({schemaVersion:1,revision:e.resources.revision(Hs)??0,updatedAt:new Date().toISOString(),stores:[...t.stores.values()]})),e.resources.register(oi,()=>({schemaVersion:1,revision:e.resources.revision(oi)??0,updatedAt:new Date().toISOString(),subscriptions:[...t.subscribers.entries()].map(([u,n])=>{let[a,l]=u.split("::");return{storeId:a,path:l,componentInstanceIds:[...n.keys()]}})})),{unsubscribe:i,uris:[Ks,Hs,oi],lookups:{latestUpdateForPath(u,n){return t.latestUpdateByPath.get(`${u}::${n}`)},subscribersFor(u,n){return[...t.subscribers.get(`${u}::${n}`)?.keys()??[]]}}}}s(bE,"zy"),o(bE,"installValtioReducer");import{App as L7}from"@frontmcp/sdk";import{Resource as V7,ResourceContext as J7}from"@frontmcp/sdk";var Rp=class extends J7{static{s(this,"Oy")}static{o(this,"GraphPatternsResource")}async execute(){return this.get(Z).read("graph://patterns")}};Rp=F([V7({name:"graph-patterns",uri:"graph://patterns",mimeType:"application/json",description:"Recent detected anti-patterns (db-in-loop, n+1-query, render-storm)."})],Rp);var W7=Rp;import{Resource as G7,ResourceContext as K7}from"@frontmcp/sdk";var Tp=class extends K7{static{s(this,"Ny")}static{o(this,"GraphEventLoopLagResource")}async execute(){return this.get(Z).read("graph://performance/event-loop-lag")}};Tp=F([G7({name:"graph-event-loop-lag",uri:"graph://performance/event-loop-lag",mimeType:"application/json",description:"Recent event-loop-lag samples + the max lag seen."})],Tp);var H7=Tp;import{Tool as X7,ToolContext as Y7,z as Q7}from"@frontmcp/sdk";var wE;function Pp(e){wE=e}s(Pp,"Xa"),o(Pp,"setActiveGraphBuffer");function li(){return wE?.events??[]}s(li,"Gt"),o(li,"currentEvents");function Wt(){let e=new e4;return I3(e,li()),e}s(Wt,"Ve"),o(Wt,"buildGraph");var Up=class extends Y7{static{s(this,"Dy")}static{o(this,"GraphGetNodeTool")}async execute(e){let t=Wt().getNode(e.nodeId);return t?{found:!0,node:t}:{found:!1,nodeId:e.nodeId}}};Up=F([X7({name:"graph.get_node",description:"Returns a single graph node by id (built from the current event window).",inputSchema:{nodeId:Q7.string().describe("Node id (usually the originating event id).")}})],Up);var eA=Up;import{Tool as tA,ToolContext as uA,z as Su}from"@frontmcp/sdk";var rA=["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"],qp=class extends uA{static{s(this,"Uy")}static{o(this,"GraphTraverseTool")}async execute(e){let t=Wt().traverse({from:e.from,lens:e.lens,depth:e.depth,direction:e.direction,maxNodes:e.maxNodes});return{nodeCount:t.nodes.length,edgeCount:t.edges.length,nodes:t.nodes.map(r=>({id:r.id,type:r.type,name:r.name,durationMs:r.durationMs,flowId:r.context.flowId})),edges:t.edges.map(r=>({from:r.from,to:r.to,axis:r.axis,type:r.type}))}}};qp=F([tA({name:"graph.traverse",description:'Walk the multi-axis trace graph from a node along one or more edge axes (the "lens"). Bounded by depth + node count.',inputSchema:{from:Su.string().describe("Start node id."),lens:Su.array(Su.enum(rA)).min(1).describe('Edge axes to follow (e.g. ["caused","backend"]).'),depth:Su.number().int().positive().max(12).default(4),direction:Su.enum(["out","in","both"]).default("both"),maxNodes:Su.number().int().positive().max(1e3).default(200)}})],qp);var iA=qp;import{Tool as nA,ToolContext as sA,z as aA}from"@frontmcp/sdk";var Zp=class extends sA{static{s(this,"Fy")}static{o(this,"GraphFindDbInLoopTool")}async execute(e){let t=xd(li(),{threshold:e.threshold});return{count:t.length,matches:t}}};Zp=F([nA({name:"graph.find_db_in_loop",description:"Scan the current event window for loops that issued more than `threshold` DB calls (N+1-ish backend anti-pattern).",inputSchema:{threshold:aA.number().int().positive().default(5)}})],Zp);var oA=Zp;import{Tool as lA,ToolContext as dA,z as cA}from"@frontmcp/sdk";var Lp=class extends dA{static{s(this,"Zy")}static{o(this,"GraphFindSlowPathTool")}async execute(e){let t=Wt(),r=new Map,i=li(),u=e.from?[e.from]:i.filter(l=>l.context.originNodeId===void 0&&l.context.flowId).map(l=>l.id);for(let l of i){let d=t.traverse({from:l.id,lens:["caused","async","backend"],depth:1,direction:"out",maxNodes:50});r.set(l.id,d.edges.filter(c=>c.from===l.id).map(c=>c.to))}let n=o(l=>t.getNode(l)?.durationMs??0,"durationOf"),a=C3(u.length?u:i.map(l=>l.id),r,n);return{totalDurationMs:a.totalDurationMs,path:a.path.map(l=>{let d=t.getNode(l);return{id:l,name:d?.name,type:d?.type,durationMs:d?.durationMs}})}}};Lp=F([lA({name:"graph.find_slow_path",description:"Find the slowest cumulative chain on the caused/async/backend axes starting from a node (or every flow origin if `from` is omitted).",inputSchema:{from:cA.string().optional().describe("Start node id; defaults to all flow origins.")}})],Lp);var pA=Lp;import{Tool as mA,ToolContext as fA,z as DE}from"@frontmcp/sdk";var Vp=class extends fA{static{s(this,"Vy")}static{o(this,"GraphTraceFromOriginTool")}async execute(e){let t=Wt(),r=e.originNodeId;if(!t.getNode(r)){let n=li().find(a=>a.context.originNodeId===e.originNodeId||a.raw?.origin?.nodeId===e.originNodeId);n&&(r=n.id)}let i=t.getNode(r);if(!i)return{found:!1,originNodeId:e.originNodeId};let u=t.traverse({from:r,lens:["caused","render","state","backend","async"],depth:e.depth,direction:"out",maxNodes:500});return{found:!0,origin:{id:r,name:i.name,type:i.type},nodeCount:u.nodes.length,nodes:u.nodes.map(n=>({id:n.id,type:n.type,name:n.name,durationMs:n.durationMs}))}}};Vp=F([mA({name:"graph.trace_from_origin",description:'Given an origin node id (e.g. a data-agent-component value or an event id), returns every node reachable on the caused/render/state/backend axes \u2014 "what did this cause?".',inputSchema:{originNodeId:DE.string().describe("Origin node id, logicalId, or originating event id."),depth:DE.number().int().positive().max(12).default(6)}})],Vp);var hA=Vp;import{Tool as gA,ToolContext as vA,z as $E}from"@frontmcp/sdk";var Jp=class extends vA{static{s(this,"Jy")}static{o(this,"GraphFindStateUpdatesCausedByTool")}async execute(e){let t=Wt();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","state"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(i=>i.type==="state-update");return{found:!0,count:r.length,stateUpdates:r.map(i=>({id:i.id,name:i.name,logicalId:i.logicalId}))}}};Jp=F([gA({name:"graph.find_state_updates_caused_by",description:'From an origin node, returns the state-update nodes reachable on the caused/state axes \u2014 "what state changed because of this?".',inputSchema:{from:$E.string().describe("Origin node id."),depth:$E.number().int().positive().max(12).default(6)}})],Jp);var yA=Jp;import{Tool as EA,ToolContext as bA,z as BE}from"@frontmcp/sdk";var Wp=class extends bA{static{s(this,"Ky")}static{o(this,"GraphFindBackendWorkCausedByClickTool")}async execute(e){let t=Wt();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","backend","async"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(i=>i.type==="server-request");return{found:!0,count:r.length,requests:r.map(i=>({id:i.id,name:i.name,durationMs:i.durationMs}))}}};Wp=F([EA({name:"graph.find_backend_work_caused_by_click",description:'From a UI origin node, returns the server-request nodes reachable on the caused/backend/async axes \u2014 "what backend work did this click trigger?".',inputSchema:{from:BE.string().describe("UI origin node id (e.g. the user-action event id)."),depth:BE.number().int().positive().max(12).default(8)}})],Wp);var wA=Wp,xE=class{static{s(this,"Hy")}static{o(this,"GraphApp")}};xE=F([L7({id:"graph",name:"Graph",description:"Multi-axis causal graph: traverse by lens, trace from origin, find slow paths + db-in-loop / n+1 / render-storm patterns.",resources:[W7,H7],tools:[eA,iA,oA,pA,hA,yA,wA]})],xE);var Fu="graph://patterns",ju="graph://performance/event-loop-lag",Gp=2e3,CE=8*1024*1024,DA=100,kE=100;function AE(e){let t=Ye(e.thresholds),r=(e.now??(()=>Date.now()))(),i={events:[]},u=[],n=0,a=0,l=0,d=new Set,c=[],p=new Map,m,f=new Map,h=o(C=>{switch(C.kind){case"n+1-query":return`n+1:${String(C.details.signature??"")}`;case"render-storm":return`storm:${String(C.details.componentInstanceId??"")}`;case"db-in-loop":return`dbloop:${C.evidence[0]??""}`;default:return`${C.kind}:${C.evidence.join(",")}`}},"patternKey"),g=o(C=>{p.set(Fu,C),e.resources.markDirty(Fu)},"markPatterns"),b=o((C,M)=>{let y=h(C);if(f.delete(y),f.set(y,C),f.size>DA){let D=f.keys().next().value;D!==void 0&&f.delete(D)}g(M)},"pushPattern"),x=o(C=>{let M=!1;for(let[y,D]of f){if(D.evidence.length===0)continue;let A=D.evidence.filter(j=>d.has(j));if(A.length===0){f.delete(y),M=!0;continue}A.length!==D.evidence.length&&(D.evidence=A,M=!0)}M&&g(C)},"dropUnevidencedPatterns"),$=o(C=>{m=C.timestamp;let M=us(C);i.events.push(C),u.push(M),n+=M,d.add(C.id);let y=Math.max(0,i.events.length-Gp),D=n;for(let N=0;N<y;N+=1)D-=u[N]??0;let A=0;for(;D>CE&&y<u.length;)D-=u[y]??0,y+=1,A+=1;if(y>0){let N=i.events.splice(0,y);u.splice(0,y),n=Math.max(0,D),a+=N.length,l+=A;for(let K of N)d.delete(K.id);x(C.timestamp)}let j=C.raw??null;if(j?.kind==="loop")for(let N of xd(i.events,{threshold:t.dbInLoop}))b(N,C.timestamp);if(j?.kind==="db-query")for(let N of B3(i.events,{threshold:t.nPlusOne}))b(N,C.timestamp);if(C.source==="react"&&j?.kind==="render")for(let N of x3(i.events,{threshold:t.renderStorm}))b(N,C.timestamp);C.source==="perf"&&j?.kind==="event-loop-lag"&&typeof j.lagMs=="number"&&(c.push({at:C.timestamp,lagMs:j.lagMs,source:C.source}),c.length>kE&&c.splice(0,c.length-kE),p.set(ju,C.timestamp),e.resources.markDirty(ju))},"handler"),w=e.bus.subscribe($);Pp(i);let k=o(C=>new Date(p.get(C)??r).toISOString(),"stamp");return e.resources.register(Fu,()=>({schemaVersion:1,revision:e.resources.revision(Fu)??0,updatedAt:k(Fu),patterns:[...f.values()],eventsBuffered:i.events.length,eventBufferCapacity:Gp,lastEventAt:m,producer:m===void 0?"none":"connected"})),e.resources.register(ju,()=>({schemaVersion:1,revision:e.resources.revision(ju)??0,updatedAt:k(ju),samples:c.slice(),maxLagMs:c.reduce((C,M)=>Math.max(C,M.lagMs),0),lastEventAt:m})),{unsubscribe:o(()=>{Pp(void 0),w()},"unsubscribe"),uris:[Fu,ju],retentionStats:o(()=>({residentEvents:i.events.length,residentBytes:n,evictedEvents:a,evictedForBytes:l,eventCap:Gp,byteCap:CE}),"retentionStats")}}s(AE,"Qy"),o(AE,"installGraphReducer");import{App as $A}from"@frontmcp/sdk";import{Resource as BA,ResourceContext as xA}from"@frontmcp/sdk";var Kp=class extends xA{static{s(this,"eb")}static{o(this,"MemoryCurrentResource")}async execute(){return this.get(Z).read("memory://current")}};Kp=F([BA({name:"memory-current",uri:"memory://current",mimeType:"application/json",description:"Last process-memory sample (heapUsed / rss)."})],Kp);var CA=Kp;import{Resource as kA,ResourceContext as AA}from"@frontmcp/sdk";var Hp=class extends AA{static{s(this,"rb")}static{o(this,"MemoryOwnersResource")}async execute(){return this.get(Z).read("memory://owners")}};Hp=F([kA({name:"memory-owners",uri:"memory://owners",mimeType:"application/json",description:"All tracked container owners with current item count + byte estimate."})],Hp);var IA=Hp;import{Resource as _A,ResourceContext as SA}from"@frontmcp/sdk";var Xp=class extends SA{static{s(this,"ob")}static{o(this,"MemoryOwnersGrowingResource")}async execute(){return this.get(Z).read("memory://owners/growing")}};Xp=F([_A({name:"memory-owners-growing",uri:"memory://owners/growing",mimeType:"application/json",description:"Top 20 container owners by growth-since-start."})],Xp);var FA=Xp;import{Resource as jA,ResourceContext as zA}from"@frontmcp/sdk";var Yp=class extends zA{static{s(this,"sb")}static{o(this,"MemoryLeaksSuspectedResource")}async execute(){return this.get(Z).read("memory://leaks/suspected")}};Yp=F([jA({name:"memory-leaks-suspected",uri:"memory://leaks/suspected",mimeType:"application/json",description:"Suspected leaks: per-flow retentions + stale-generation singletons."})],Yp);var NA=Yp;import{Resource as MA,ResourceContext as OA}from"@frontmcp/sdk";var Qp=class extends OA{static{s(this,"cb")}static{o(this,"MemoryPodsResource")}async execute(){return this.get(Z).read("memory://pods")}};Qp=F([MA({name:"memory-pods",uri:"memory://pods",mimeType:"application/json",description:"Each dev-cluster pod's heap after a full GC (boot, after every hot swap, after bursts), a short per-service history, and closed generations proven still in memory."})],Qp);var RA=Qp;import{Tool as TA,ToolContext as PA,z as UA}from"@frontmcp/sdk";var IE;function em(e){IE=e}s(em,"Ha"),o(em,"setActiveMemoryLookups");function zu(){return IE}s(zu,"nt"),o(zu,"activeMemoryLookups");var tm=class extends PA{static{s(this,"lb")}static{o(this,"MemoryFindGrowthByFlowTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.growthByFlow(e.flowId);return{found:!0,flowId:e.flowId,owners:r}}};tm=F([TA({name:"memory.find_growth_by_flow",description:'Returns the container owners mutated during a flow and how much each grew \u2014 "what did this flow allocate?".',inputSchema:{flowId:UA.string().describe("Flow id.")}})],tm);var qA=tm;import{Tool as ZA,ToolContext as LA,z as VA}from"@frontmcp/sdk";var um=class extends LA{static{s(this,"pb")}static{o(this,"MemoryFindFlowsThatMutatedOwnerTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.flowsThatMutatedOwner(e.ownerId);return{found:!0,ownerId:e.ownerId,flowIds:r}}};um=F([ZA({name:"memory.find_flows_that_mutated_owner",description:"Returns the flow ids that mutated a given container owner.",inputSchema:{ownerId:VA.string().describe("Owner id (<ownerInstanceId>::<fieldName>).")}})],um);var JA=um;import{Tool as WA,ToolContext as GA,z as KA}from"@frontmcp/sdk";var rm=class extends GA{static{s(this,"mb")}static{o(this,"MemoryExplainLeakTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.getLeak(e.leakIndex);if(!r)return{found:!1,leakIndex:e.leakIndex};let i,u;if(r.kind==="retention"){let n=r.detail;i=`Owner ${n.ownerId} grew by ${n.growth} items during flow ${n.flowId} and did not shrink after the flow settled.`,u="Add a TTL / max-size eviction policy to this container, or clear it when the owning scope is disposed. If it is a request-scoped cache, move it off the singleton."}else{let n=r.detail;i=`${r.service??r.project} pod #${r.pod} (pid ${r.pid}): hot-swap generation ${n.gen} is still in memory ${Math.round(n.ageMs/1e3)}s after its app was closed, through ${n.gcs} full GCs and ${n.swapsSinceClose} swap(s) \u2014 still alive: ${(n.alive??[]).join(", ")}. Not garbage: something still points into it.`,u=`Run \`lensmcp mem ${r.service??r.project} --snapshot --analyze\` for the shortest path from the GC roots to it. Usual retainers: a listener on a process-global emitter, a module-level cache or registry, a timer the old app's onModuleDestroy does not clear. memory.explain_pod reads the pod's whole picture.`}return{found:!0,leak:r,narrative:i,recommendation:u}}};rm=F([WA({name:"memory.explain_leak",description:"Returns a narrative explanation of a suspected leak (by index in memory://leaks/suspected): which owner and flow grew, or which pod generation outlived its close \u2014 and a remediation hint.",inputSchema:{leakIndex:KA.number().int().nonnegative().describe("Index into memory://leaks/suspected.")}})],rm);var HA=rm;import{Tool as XA,ToolContext as YA,z as _E}from"@frontmcp/sdk";var SE=6,im=class extends YA{static{s(this,"gb")}static{o(this,"MemoryPodsTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};if(e.service){let i=t.podsOf(e.service);return i?{found:!0,...i,history:i.history.slice(-(e.history??SE))}:{found:!1,service:e.service,known:t.pods().map(u=>u.service).slice(0,32),reason:"no pod of that service has reported \u2014 pods report at boot and after every hot swap"}}let r=t.pods().slice(0,32).map(i=>({project:i.project,service:i.service,lastSeenAt:i.lastSeenAt,pods:i.pods}));return{found:r.length>0,services:r}}};im=F([XA({name:"memory.pods",description:"What each dev-cluster pod weighs: heap after a full GC, reserved heap, rss, boot baseline, swaps, and any closed hot-swap generation proven still in memory. Give `service` for that service's recent per-swap history.",inputSchema:{service:_E.string().optional().describe("Nx project or cluster service name. Omit for every service (latest reading per pod, no history)."),history:_E.number().int().min(0).max(12).optional().describe(`Recent readings to include for one service (default ${SE}).`)}})],im);var QA=im;import{Tool as eI,ToolContext as tI,z as FE}from"@frontmcp/sdk";var Xs=o(e=>e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:`${Math.round(e/1048576)} MB`,"mb"),jE=o(e=>e<9e4?`${Math.round(e/1e3)}s`:`${Math.round(e/6e4)} min`,"age");function zE(e,t,r=Date.now()){let i=t.latest,u=[];if(!i)return{service:e.service,pod:t.pod,pid:t.pid,narrative:`${e.service} pod #${t.pod} (pid ${t.pid}) has not reported a reading yet.`,findings:u,recommendation:"It reports at boot and after every swap \u2014 check `lensmcp mem` once it has booted."};let n=i.baseline??(i.trigger==="boot"?i.live:void 0),a=n?i.live/n:void 0,l=`${e.service} pod #${t.pod} (pid ${t.pid}): ${Xs(i.live)} live after a full GC (${i.trigger}, ${jE(r-i.at)} ago), generation ${i.gen} after ${i.swaps} swap${i.swaps===1?"":"s"}`;n&&a!==void 0&&(l+=` \u2014 ${a.toFixed(1)}\xD7 the ${Xs(n)} it booted with`),l+=".",a!==void 0&&a>=2.5?u.push(`At ${a.toFixed(1)}\xD7 its boot heap it is near the recycle bound (3\xD7 by default): the pod will be replaced by a fresh process if it grows further.`):a!==void 0&&a>=1.4&&u.push(`More than one generation's worth of live heap (${a.toFixed(1)}\xD7): a generation still draining or pinned, or state the app accumulated since boot.`),i.used-i.live>=64*1048576&&u.push(`That collection gave back ${Xs(i.used-i.live)} of garbage \u2014 what an idle pod kept before it collected on its own.`),i.reserved-i.live>=128*1048576&&u.push(`V8 holds ${Xs(i.reserved-i.live)} reserved beyond the live heap; that is the allocator's slack, which a later GC shrinks \u2014 not a leak.`),i.previousAlive===!0?u.push(`Generation ${i.previousGen} \u2014 the one the last swap replaced \u2014 was still in memory at this reading.`):i.previousAlive===!1&&u.push(`Generation ${i.previousGen} \u2014 the one the last swap replaced \u2014 has been collected.`),i.containers!==void 0&&i.containers>1&&u.push(`${i.containers} Nest DI containers are alive: more than one app's worth.`);for(let c of t.retained){let p=c.counts&&Object.keys(c.counts).length?` Live then: ${Object.entries(c.counts).map(([m,f])=>`${m} ${f}`).join(", ")}.`:"";u.push(`RETAINED: generation ${c.gen} is still in memory ${jE(r-c.closedAt)} after its app was closed, through ${c.gcs} full GCs and ${c.swapsSinceClose} swap${c.swapsSinceClose===1?"":"s"} (still alive: ${c.alive.join(", ")}).${p}`)}i.sourceMaps&&u.push("The pod runs with source maps enabled: with an eval devtool the bundle is held as text several times (`lensmcp doctor` checks it).");let d=t.retained.length?`Something still points into the retained generation. \`lensmcp mem ${e.service} --snapshot --analyze\` prints the shortest path from the GC roots to it \u2014 usually a listener on a process-global emitter, a module-level cache or registry, or a timer an onModuleDestroy does not clear. Until it is fixed the pod is replaced once the generation has been retained for LENSMCP_SWAP_RECYCLE_RETAINED_MS (10 min by default).`:a!==void 0&&a>=2?`No closed generation is retained, so this is growth inside the serving app. Compare readings across swaps with \`lensmcp mem ${e.service}\`; \`lensmcp mem ${e.service} --snapshot --analyze\` lists the largest retainers by class and by package.`:"Nothing to act on: one generation in memory, and the previous one collected.";return{service:e.service,pod:t.pod,pid:t.pid,narrative:l,findings:u,recommendation:d}}s(zE,"yb"),o(zE,"explainPod");var nm=class extends tI{static{s(this,"bb")}static{o(this,"MemoryExplainPodTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.podsOf(e.service);if(!r)return{found:!1,service:e.service,reason:"no pod of that service has reported"};let i=r.pods.filter(u=>e.pod===void 0||u.pod===e.pod).slice(0,8);return i.length===0?{found:!1,service:e.service,pods:r.pods.map(u=>u.pod),reason:`no pod #${e.pod}`}:{found:!0,explanations:i.map(u=>zE(r,u))}}};nm=F([eI({name:"memory.explain_pod",description:"Explains one dev-cluster pod's memory in a few sentences: how many app generations its live heap is, whether the last hot swap's copy was collected, reserved-heap slack, and any closed generation proven still in memory \u2014 with the next step (e.g. a heap snapshot).",inputSchema:{service:FE.string().describe("Nx project or cluster service name."),pod:FE.number().int().positive().optional().describe("Pod id (the N of Child#N). Omit for every pod of the service (at most 8).")}})],nm);var uI=nm,NE=class{static{s(this,"xb")}static{o(this,"MemoryApp")}};NE=F([$A({id:"memory",name:"Memory",description:"Container-owner growth tracking, suspect-leak detection, and dev-cluster pod heaps (post-GC readings, retained hot-swap generations). Hosts memory.explain_leak, memory.pods, memory.explain_pod.",resources:[CA,IA,FA,NA,RA],tools:[qA,JA,HA,QA,uI]})],NE);var rI=64,iI=16,ME=12,nI=16,OE=24*36e5;function Gt(e,t,r,i){return`pod-retained:${e}:${t}:${r}:${i}`}s(Gt,"gn"),o(Gt,"retainedLeakKey");var sI=o((e,t)=>`${e}:${t}`,"podKey");function sm(e,t){let r={};for(let[i,u]of Object.entries(e))t.includes(i)||(r[i]=u);return r}s(sm,"xk"),o(sm,"stripIdentity");var aI=class{static{s(this,"Qa")}static{o(this,"PodMemoryState")}constructor(){this.services=new Map}apply(e){if(e.source!=="memory")return;let t=Gn(e.raw);if(!t)return;let r=e.timestamp;this.lastEventAt=Math.max(this.lastEventAt??0,r);let i={pods:!0,retainedAdded:[],retainedRemoved:[]},u=this.service(t.project,t.service||t.project,r),n=sI(t.pod,t.pid);if(t.kind==="pod-memory-exited"){let l=u.pods.get(n);if(l)for(let d of l.retained.keys())i.retainedRemoved.push(Gt(t.project,t.pod,t.pid,d));return u.pods.delete(n),i}let a=u.pods.get(n);if(!a){if(t.kind==="pod-memory"&&t.trigger==="boot"){for(let[l,d]of u.pods)if(d.pod===t.pod){for(let c of d.retained.keys())i.retainedRemoved.push(Gt(t.project,d.pod,d.pid,c));u.pods.delete(l)}}if(a={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,lastSeenAt:r,retained:new Map},u.pods.set(n,a),u.pods.size>iI){let l=[...u.pods.entries()].sort((d,c)=>d[1].lastSeenAt-c[1].lastSeenAt)[0];if(l){for(let d of l[1].retained.keys())i.retainedRemoved.push(Gt(t.project,l[1].pod,l[1].pid,d));u.pods.delete(l[0])}}}if(a.lastSeenAt=r,t.kind==="pod-memory")a.latest=sm(t,["project","service","pod","pid","podGeneration","floodSuppressed"]),u.history.push({at:t.at??r,pod:t.pod,pid:t.pid,trigger:t.trigger,gen:t.gen,swaps:t.swaps,live:t.live,used:t.used,reserved:t.reserved,rss:t.rss,...t.previousGen!==void 0?{previousGen:t.previousGen}:{},previousAlive:t.previousAlive??null,retained:t.retained??0}),u.history.length>ME&&u.history.splice(0,u.history.length-ME);else if(t.kind==="pod-memory-retained"){let l={...sm(t,["project","service","floodSuppressed"]),at:r};a.retained.delete(t.gen),a.retained.set(t.gen,l),a.retained.size>nI&&a.retained.delete(a.retained.keys().next().value),i.retainedAdded.push({key:Gt(t.project,t.pod,t.pid,t.gen),project:t.project,service:u.service,pod:t.pod,pid:t.pid,generation:l})}else t.kind==="pod-memory-released"&&(a.retained.delete(t.gen),i.retainedRemoved.push(Gt(t.project,t.pod,t.pid,t.gen)));return this.sweep(r,i,t.project),i}views(){return[...this.services.values()].sort((e,t)=>e.project.localeCompare(t.project)).map(e=>this.view(e))}find(e){let t=this.services.get(e)??[...this.services.values()].find(r=>r.service===e);return t?this.view(t):void 0}view(e){return{project:e.project,service:e.service,lastSeenAt:e.lastSeenAt,pods:[...e.pods.values()].sort((t,r)=>t.pod-r.pod).map(t=>({pod:t.pod,pid:t.pid,podGeneration:t.podGeneration,lastSeenAt:t.lastSeenAt,...t.latest?{latest:t.latest}:{},retained:[...t.retained.values()]})),history:[...e.history]}}service(e,t,r){let i=this.services.get(e);if(!i&&(i={project:e,service:t,lastSeenAt:r,pods:new Map,history:[]},this.services.set(e,i),this.services.size>rI)){let u=[...this.services.values()].sort((n,a)=>n.lastSeenAt-a.lastSeenAt)[0];u&&u!==i&&this.services.delete(u.project)}return i.lastSeenAt=Math.max(i.lastSeenAt,r),i.service=t,i}sweep(e,t,r){for(let i of this.services.values()){for(let[u,n]of i.pods)if(!(e-n.lastSeenAt<=OE)){for(let a of n.retained.keys())t.retainedRemoved.push(Gt(i.project,n.pod,n.pid,a));i.pods.delete(u)}i.pods.size===0&&i.project!==r&&e-i.lastSeenAt>OE&&this.services.delete(i.project)}}},di="memory://current",ci="memory://owners",pi="memory://owners/growing",Kt="memory://leaks/suspected",mi="memory://pods",oI=200,RE=50,lI=500;function TE(e){let t=(e.now??(()=>Date.now()))(),r={owners:new Map,leaks:new Map,changedAt:new Map},i=new aI,u=o(($,w)=>{r.changedAt.set($,w),e.resources.markDirty($)},"touch"),n=o(($,w)=>{if(r.leaks.delete($),r.leaks.set($,w),r.leaks.size>oI){let k=r.leaks.keys().next().value;k!==void 0&&r.leaks.delete(k)}},"pushLeak"),a=new Map,l=o(($,w)=>{$!==w&&(a.delete($),a.set($,w),a.size>5e3&&a.delete(a.keys().next().value))},"noteRequestFlow"),d=o(($,w)=>{if($.flowIds.add(w),$.flowIds.size>RE){for(let k of $.flowIds)if($.flowIds.delete(k),$.flowIds.size<=RE)break}},"noteFlow"),c=o(($,w,k)=>{let C=r.owners.get($);if(C||(C={ownerId:$,itemCount:w,estimatedBytes:0,startCount:w,mutations:0,flowIds:new Set,lastMutatedAt:k}),r.owners.delete($),r.owners.set($,C),r.owners.size>lI){let M=r.owners.keys().next().value;M!==void 0&&M!==$&&r.owners.delete(M)}return C},"ensure"),p=o(($,w)=>{let k=!1;for(let[C,M]of r.leaks){if(M.kind!=="retention"||M.ownerId!==$)continue;let y=M.detail.startCount;typeof y=="number"&&w<=y&&(r.leaks.delete(C),k=!0)}return k},"retractReleasedRetentions"),m=o($=>{let w=i.apply($);if(!w)return!1;r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),u(mi,$.timestamp);let k=!1;for(let C of w.retainedRemoved)k=r.leaks.delete(C)||k;for(let C of w.retainedAdded)n(C.key,{kind:"retained-generation",project:C.project,service:C.service,pod:C.pod,pid:C.pid,generation:C.generation.gen,detail:{...C.generation},at:$.timestamp}),k=!0;return k&&u(Kt,$.timestamp),!0},"applyPodMemory"),f=o($=>{if($.source!=="memory"&&$.source!=="perf"||m($))return;let w=$.raw??null;if(w?.kind)switch(r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),w.kind){case"memory-mutation":{if(!w.mutation)return;let k=w.mutation,C=c(k.ownerNodeId,k.beforeCount??k.afterCount,$.timestamp);C.itemCount=k.afterCount,C.estimatedBytes=k.afterCount*64,C.mutations+=1,C.lastMutatedAt=$.timestamp,$.context.flowId&&d(C,$.context.flowId),$.context.requestId&&$.context.flowId&&l($.context.requestId,$.context.flowId),u(ci,$.timestamp),u(pi,$.timestamp),p(k.ownerNodeId,k.afterCount)&&u(Kt,$.timestamp);return}case"memory-retention":{if(!w.retention)return;let k=w.retention,C=k.requestId?k.flowId:a.get(k.flowId)??k.flowId;n(`retention:${k.ownerId}:${C}`,{kind:"retention",ownerId:k.ownerId,flowId:C,detail:{...k,flowId:C},at:$.timestamp}),u(Kt,$.timestamp);return}case"process-memory":{if(!w.memory)return;r.current={...w.role?{role:w.role}:{},heapUsed:w.memory.heapUsed,heapTotal:w.memory.heapTotal,rss:w.memory.rss,external:w.memory.external,arrayBuffers:w.memory.arrayBuffers,at:$.timestamp},u(di,$.timestamp);return}default:return}},"handler"),h=e.bus.subscribe(f),g=o($=>new Date(r.changedAt.get($)??t).toISOString(),"stamp"),b=o(()=>({lastEventAt:r.lastEventAt,ownersTracked:r.owners.size,producer:r.lastEventAt===void 0?"none":"connected",detail:r.lastEventAt===void 0?"No memory event has ever been observed \u2014 an empty leak list is NOT evidence there is no leak, nothing is watching. Run under the dev cluster with @lensmcp/memory-tracker wired.":`${r.owners.size} owner${r.owners.size===1?"":"s"} tracked; ${r.leaks.size} suspected leak${r.leaks.size===1?"":"s"}.`}),"health");e.resources.register(di,()=>({schemaVersion:1,revision:e.resources.revision(di)??0,updatedAt:g(di),current:r.current??null})),e.resources.register(ci,()=>({schemaVersion:1,revision:e.resources.revision(ci)??0,updatedAt:g(ci),owners:[...r.owners.values()].map(am),...b()})),e.resources.register(pi,()=>({schemaVersion:1,revision:e.resources.revision(pi)??0,updatedAt:g(pi),owners:[...r.owners.values()].map(am).filter($=>$.growthSinceStart>0).sort(($,w)=>w.growthSinceStart-$.growthSinceStart).slice(0,20),...b()})),e.resources.register(Kt,()=>({schemaVersion:1,revision:e.resources.revision(Kt)??0,updatedAt:g(Kt),suspected:[...r.leaks.values()],...b()})),e.resources.register(mi,()=>({schemaVersion:1,revision:e.resources.revision(mi)??0,updatedAt:g(mi),services:i.views(),lastEventAt:i.lastEventAt,producer:i.lastEventAt===void 0?"none":"connected",detail:i.lastEventAt===void 0?"No pod has reported its heap \u2014 these readings come from the dev cluster (`@lensmcp/cluster` devserver pods, which report at boot and after every hot swap). An empty list is not evidence the pods are small.":"Bytes. `live` is the heap after a full GC; `used` the heap just before it; `reserved` what V8 keeps. A `retained` generation was closed and is PROVEN still in memory \u2014 see memory.explain_pod."}));let x={ownersMutatedByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($))},growthByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($)).map(w=>({ownerId:w.ownerId,growth:w.itemCount-w.startCount}))},flowsThatMutatedOwner($){let w=r.owners.get($);return w?[...w.flowIds]:[]},getLeak($){return[...r.leaks.values()][$]},allLeaks(){return[...r.leaks.values()]},pods(){return i.views()},podsOf($){return i.find($)}};return em(x),{unsubscribe:o(()=>{em(void 0),h()},"unsubscribe"),uris:[di,ci,pi,Kt,mi],lookups:x}}s(TE,"$b"),o(TE,"installMemoryReducer");function am(e){return{ownerId:e.ownerId,itemCount:e.itemCount,estimatedBytes:e.estimatedBytes,mutations:e.mutations,startCount:e.startCount,growthSinceStart:e.itemCount-e.startCount,lastMutatedAt:e.lastMutatedAt,flowIds:[...e.flowIds]}}s(am,"_k"),o(am,"toOwnerView");function PE(){let{session:e,providers:t}=j3(),r=U3(),i=q3();for(let x of i.problems)console.error(`[lensmcp] nx.json lensmcp.flows: ${x}`);oy({bus:e.bus,resources:e.resources}),cy({bus:e.bus,resources:e.resources}),fy({bus:e.bus,resources:e.resources}),vy({bus:e.bus,resources:e.resources}),Dy({bus:e.bus,resources:e.resources}),Iy({bus:e.bus,resources:e.resources}),Sy({bus:e.bus,resources:e.resources}),jy({bus:e.bus,resources:e.resources}),My({bus:e.bus,resources:e.resources,thresholds:r}),Zy({bus:e.bus,resources:e.resources,thresholds:r}),Wy({bus:e.bus,resources:e.resources,thresholds:r}),eE({bus:e.bus,resources:e.resources,thresholds:r}),cE({bus:e.bus,resources:e.resources}),hE({bus:e.bus,resources:e.resources,thresholds:r}),bE({bus:e.bus,resources:e.resources});let u=uc({bus:e.bus,resources:e.resources,flows:i});e.registerReducerRetention("flow",u.retentionStats),Q6({resources:e.resources});let n=AE({bus:e.bus,resources:e.resources,thresholds:r});e.registerReducerRetention("graph",n.retentionStats),TE({bus:e.bus,resources:e.resources}),C6({bus:e.bus,resources:e.resources,sessionId:e.id});let a=3e4,l=512*1024*1024,d=0,c=o(()=>{let x=process.memoryUsage(),$=Date.now(),w=x.rss>=l;w&&$-d>=5*6e4&&(d=$,console.warn(`[lensmcp] high process memory: rss=${Math.round(x.rss/1024/1024)}MB heap=${Math.round(x.heapUsed/1024/1024)}MB`)),e.bus.publish({id:lt(),sessionId:e.id,timestamp:$,source:"perf",category:"runtime",severity:w?"warning":"info",context:{sessionId:e.id},fingerprint:u4({kind:"process-memory",identity:process.env.LENSMCP_PROCESS_ROLE??"session"}),title:`LensMCP process memory (${process.env.LENSMCP_PROCESS_ROLE??"session"})`,raw:{kind:"process-memory",role:process.env.LENSMCP_PROCESS_ROLE??"session",memory:{rss:x.rss,heapUsed:x.heapUsed,heapTotal:x.heapTotal,external:x.external,arrayBuffers:x.arrayBuffers}}})},"publishProcessMemory");c();let p=setInterval(c,a);p.unref?.(),e.onShutdown({name:"process-memory",stop:o(()=>clearInterval(p),"stop")});let m=1200,f=new Map,h=e.bus.subscribe(x=>{let $=x.context.flowId;if(!$)return;let w=f.get($);w&&clearTimeout(w);let k=setTimeout(()=>{f.delete($);try{let C=Qe()?.getFlowEvents($);if(!C||C.length===0)return;let M=la(C,{flowId:$});M&&wc(M)}catch{}},m);k.unref?.(),f.set($,k)});e.onShutdown({name:"story-autocompile",stop:o(()=>{h();for(let x of f.values())clearTimeout(x);f.clear()},"stop")});let g=T3({bus:e.bus,sessionId:e.id,onError:o(x=>console.error("[lensmcp] ingest error:",x),"onError")});g.mode!=="none"&&console.error(`[lensmcp] event ingest active (mode=${g.mode})`),e.onShutdown({name:"event-ingest",stop:o(()=>g.stop(),"stop")});let b=process.env.LENSMCP_EVENT_FILE;return b&&(Yd({eventFile:b,flows:i,budget:_6(),prepare:UE(e.id)}),e.onShutdown({name:"flow-recovery",stop:o(()=>Yd(void 0),"stop")})),{session:e,providers:t,ingest:g,flows:i}}s(PE,"kk"),o(PE,"createLensSession");function UE(e){let t=Cd({}),r=oa({});return i=>(i.sessionId==="pending"&&(i.sessionId=e,i.context&&i.context.sessionId==="pending"&&(i.context.sessionId=e)),r.redact(t.clamp(i)))}s(UE,"iP"),o(UE,"ingestPreparation");var dI=new Set(["localhost","127.0.0.1","lensmcp.local"]);function qE(e){if(!e)return!1;let t=e.trim().toLowerCase();if(t.startsWith("[")){let r=t.indexOf("]");return r!==-1&&t.slice(1,r)==="::1"}return t.indexOf(":")===t.lastIndexOf(":")&&(t=t.split(":")[0]??""),dI.has(t)}s(qE,"aP"),o(qE,"hostHeaderIsLocal");function ZE(e,t){if(!e||qE(t))return{ok:!0};let r=(t??"").replace(/[^\x20-\x7e]/g,"?").slice(0,80);return{ok:!1,status:403,error:"this dashboard answers only requests addressed to this machine (localhost, 127.0.0.1, [::1] or lensmcp.local)"+(r?`; this one was addressed to "${r}"`:"")}}s(ZE,"Sk"),o(ZE,"dashboardHostVerdict");import{createHmac as LE,randomBytes as VE,timingSafeEqual as cI}from"node:crypto";import{chmodSync as pI,mkdirSync as mI,readFileSync as fI,writeFileSync as JE}from"node:fs";import{dirname as hI,join as gI}from"node:path";var Ys="__lensmcp_token",om="__lensmcp_login",WE=10*6e4,vI=720*60*60;function lm(e){return gI(e,".lensmcp","dashboard-token")}s(lm,"_b"),o(lm,"dashboardTokenPath");function GE(e,t,r={}){if(e.LENSMCP_ALLOW_INSECURE==="1")return{source:"disabled"};let i=e.LENSMCP_DASHBOARD_TOKEN?.trim();if(i)return{token:i,source:"env"};let u=r.read??(c=>fI(c,"utf8")),n=r.write??((c,p)=>JE(c,p,{mode:384,flag:"wx"})),a=r.ensureDir??(c=>{mI(c,{recursive:!0,mode:448})}),l=r.chmod??((c,p)=>pI(c,p)),d=lm(t);try{let c=u(d).trim();if(c){try{l(d,384)}catch{}return{token:c,source:"file"}}}catch{}try{a(hI(d));let c=VE(32).toString("hex");try{n(d,`${c}
|
|
72
|
-
`)}catch(p){if(p.code!=="EEXIST")throw p;let m=u(d).trim();if(m)return{token:m,source:"file"};
|
|
73
|
-
`,{mode:384})}try{l(d,384)}catch{}return{token:c,source:"created"}}catch(c){return{source:"unavailable",reason:c instanceof Error?c.message:String(c)}}}s(
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let l=a[1];if(t===a[0]){n(a);continue}if(e.external){let d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(l.cycle){n(a);continue}if(l.count>1&&e.reused==="ref"){n(a);continue}}}s(Rt,"Ot"),o(Rt,"extractDefs");function Tt(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=o(l=>{let d=e.seen.get(l);if(d.ref===null)return;let c=d.def??d.schema,p={...c},m=d.ref;if(d.ref=null,m){i(m);let h=e.seen.get(m),g=h.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,p),l._zod.parent===m)for(let b in c)b==="$ref"||b==="allOf"||b in p||delete c[b];if(g.$ref&&h.def)for(let b in c)b==="$ref"||b==="allOf"||b in h.def&&JSON.stringify(c[b])===JSON.stringify(h.def[b])&&delete c[b]}let f=l._zod.parent;if(f&&f!==m){i(f);let h=e.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(let g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}e.override({zodSchema:l,jsonSchema:c,path:d.path??[]})},"flattenRef");for(let l of[...e.seen.entries()].reverse())i(l[0]);let u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(l)}Object.assign(u,r.def??r.schema);let n=e.metadataRegistry.get(t)?.id;n!==void 0&&u.id===n&&delete u.id;let a=e.external?.defs??{};for(let l of e.seen.entries()){let d=l[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?u.$defs=a:u.definitions=a);try{let l=JSON.parse(JSON.stringify(u));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:wr(t,"input",e.processors),output:wr(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}s(Tt,"Mt"),o(Tt,"finalize");function xe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xe(i.element,r);if(i.type==="set")return xe(i.valueType,r);if(i.type==="lazy")return xe(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return xe(i.innerType,r);if(i.type==="intersection")return xe(i.left,r)||xe(i.right,r);if(i.type==="record"||i.type==="map")return xe(i.keyType,r)||xe(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xe(i.in,r)||xe(i.out,r);if(i.type==="object"){for(let u in i.shape)if(xe(i.shape[u],r))return!0;return!1}if(i.type==="union"){for(let u of i.options)if(xe(u,r))return!0;return!1}if(i.type==="tuple"){for(let u of i.items)if(xe(u,r))return!0;return!!(i.rest&&xe(i.rest,r))}return!1}s(xe,"ze"),o(xe,"isTransforming");var _v=o((e,t={})=>r=>{let i=Ot({...r,processors:t});return ie(e,i),Rt(i,e),Tt(i,e)},"createToJSONSchemaMethod"),wr=o((e,t,r={})=>i=>{let{libraryOptions:u,target:n}=i??{},a=Ot({...u??{},target:n,io:t,processors:r});return ie(e,a),Rt(a,e),Tt(a,e)},"createStandardJSONSchemaMethod"),aD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sv=o((e,t,r,i)=>{let u=r;u.type="string";let{minimum:n,maximum:a,format:l,patterns:d,contentEncoding:c}=e._zod.bag;if(typeof n=="number"&&(u.minLength=n),typeof a=="number"&&(u.maxLength=a),l&&(u.format=aD[l]??l,u.format===""&&delete u.format,l==="time"&&delete u.format),c&&(u.contentEncoding=c),d&&d.size>0){let p=[...d];p.length===1?u.pattern=p[0].source:p.length>1&&(u.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Fv=o((e,t,r,i)=>{let u=r,{minimum:n,maximum:a,format:l,multipleOf:d,exclusiveMaximum:c,exclusiveMinimum:p}=e._zod.bag;typeof l=="string"&&l.includes("int")?u.type="integer":u.type="number";let m=typeof p=="number"&&p>=(n??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";m?h?(u.minimum=p,u.exclusiveMinimum=!0):u.exclusiveMinimum=p:typeof n=="number"&&(u.minimum=n),f?h?(u.maximum=c,u.exclusiveMaximum=!0):u.exclusiveMaximum=c:typeof a=="number"&&(u.maximum=a),typeof d=="number"&&(u.multipleOf=d)},"numberProcessor"),jv=o((e,t,r,i)=>{r.type="boolean"},"booleanProcessor"),zv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Nv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Mv=o((e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),Ov=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Rv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Tv=o((e,t,r,i)=>{r.not={}},"neverProcessor"),Pv=o((e,t,r,i)=>{},"anyProcessor"),Uv=o((e,t,r,i)=>{},"unknownProcessor"),qv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Zv=o((e,t,r,i)=>{let u=e._zod.def,n=ki(u.entries);n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),r.enum=n},"enumProcessor"),Lv=o((e,t,r,i)=>{let u=e._zod.def,n=[];for(let a of u.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else n.every(a=>typeof a=="number")&&(r.type="number"),n.every(a=>typeof a=="string")&&(r.type="string"),n.every(a=>typeof a=="boolean")&&(r.type="boolean"),n.every(a=>a===null)&&(r.type="null"),r.enum=n},"literalProcessor"),Vv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Jv=o((e,t,r,i)=>{let u=r,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");u.type="string",u.pattern=n.source},"templateLiteralProcessor"),Wv=o((e,t,r,i)=>{let u=r,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:l,mime:d}=e._zod.bag;a!==void 0&&(n.minLength=a),l!==void 0&&(n.maxLength=l),d?d.length===1?(n.contentMediaType=d[0],Object.assign(u,n)):(Object.assign(u,n),u.anyOf=d.map(c=>({contentMediaType:c}))):Object.assign(u,n)},"fileProcessor"),Gv=o((e,t,r,i)=>{r.type="boolean"},"successProcessor"),Kv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),Hv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Xv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),Yv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),Qv=o((e,t,r,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),e1=o((e,t,r,i)=>{let u=r,n=e._zod.def,{minimum:a,maximum:l}=e._zod.bag;typeof a=="number"&&(u.minItems=a),typeof l=="number"&&(u.maxItems=l),u.type="array",u.items=ie(n.element,t,{...i,path:[...i.path,"items"]})},"arrayProcessor"),t1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="object",u.properties={};let a=n.shape;for(let c in a)u.properties[c]=ie(a[c],t,{...i,path:[...i.path,"properties",c]});let l=new Set(Object.keys(a)),d=new Set([...l].filter(c=>{let p=n.shape[c]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(u.required=Array.from(d)),n.catchall?._zod.def.type==="never"?u.additionalProperties=!1:n.catchall?n.catchall&&(u.additionalProperties=ie(n.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(u.additionalProperties=!1)},"objectProcessor"),c0=o((e,t,r,i)=>{let u=e._zod.def,n=u.inclusive===!1,a=u.options.map((l,d)=>ie(l,t,{...i,path:[...i.path,n?"oneOf":"anyOf",d]}));n?r.oneOf=a:r.anyOf=a},"unionProcessor"),u1=o((e,t,r,i)=>{let u=e._zod.def,n=ie(u.left,t,{...i,path:[...i.path,"allOf",0]}),a=ie(u.right,t,{...i,path:[...i.path,"allOf",1]}),l=o(c=>"allOf"in c&&Object.keys(c).length===1,"isSimpleIntersection"),d=[...l(n)?n.allOf:[n],...l(a)?a.allOf:[a]];r.allOf=d},"intersectionProcessor"),r1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=n.items.map((f,h)=>ie(f,t,{...i,path:[...i.path,a,h]})),c=n.rest?ie(n.rest,t,{...i,path:[...i.path,l,...t.target==="openapi-3.0"?[n.items.length]:[]]}):null;t.target==="draft-2020-12"?(u.prefixItems=d,c&&(u.items=c)):t.target==="openapi-3.0"?(u.items={anyOf:d},c&&u.items.anyOf.push(c),u.minItems=d.length,c||(u.maxItems=d.length)):(u.items=d,c&&(u.additionalItems=c));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(u.minItems=p),typeof m=="number"&&(u.maxItems=m)},"tupleProcessor"),i1=o((e,t,r,i)=>{let u=r,n=e._zod.def;u.type="object";let a=n.keyType,l=a._zod.bag?.patterns;if(n.mode==="loose"&&l&&l.size>0){let c=ie(n.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});u.patternProperties={};for(let p of l)u.patternProperties[p.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(u.propertyNames=ie(n.keyType,t,{...i,path:[...i.path,"propertyNames"]})),u.additionalProperties=ie(n.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let d=a._zod.values;if(d){let c=[...d].filter(p=>typeof p=="string"||typeof p=="number");c.length>0&&(u.required=c)}},"recordProcessor"),n1=o((e,t,r,i)=>{let u=e._zod.def,n=ie(u.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=u.innerType,r.nullable=!0):r.anyOf=[n,{type:"null"}]},"nullableProcessor"),s1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"nonoptionalProcessor"),a1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,r.default=JSON.parse(JSON.stringify(u.defaultValue))},"defaultProcessor"),o1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},"prefaultProcessor"),l1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType;let a;try{a=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},"catchProcessor"),d1=o((e,t,r,i)=>{let u=e._zod.def,n=u.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?n?u.out:u.in:u.out;ie(a,t,i);let l=t.seen.get(e);l.ref=a},"pipeProcessor"),c1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType,r.readOnly=!0},"readonlyProcessor"),p1=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"promiseProcessor"),p0=o((e,t,r,i)=>{let u=e._zod.def;ie(u.innerType,t,i);let n=t.seen.get(e);n.ref=u.innerType},"optionalProcessor"),m1=o((e,t,r,i)=>{let u=e._zod.innerType;ie(u,t,i);let n=t.seen.get(e);n.ref=u},"lazyProcessor"),m0={string:Sv,number:Fv,boolean:jv,bigint:zv,symbol:Nv,null:Mv,undefined:Ov,void:Rv,never:Tv,any:Pv,unknown:Uv,date:qv,enum:Zv,literal:Lv,nan:Vv,template_literal:Jv,file:Wv,success:Gv,custom:Kv,function:Hv,transform:Xv,map:Yv,set:Qv,array:e1,object:t1,union:c0,intersection:u1,tuple:r1,record:i1,nullable:n1,nonoptional:s1,default:a1,prefault:o1,catch:l1,pipe:d1,readonly:c1,promise:p1,optional:p0,lazy:m1};function f0(e,t){if("_idmap"in e){let i=e,u=Ot({...t,processors:m0}),n={};for(let d of i._idmap.entries()){let[c,p]=d;ie(p,u)}let a={},l={registry:i,uri:t?.uri,defs:n};u.external=l;for(let d of i._idmap.entries()){let[c,p]=d;Rt(u,p),a[c]=Tt(u,p)}if(Object.keys(n).length>0){let d=u.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:n}}return{schemas:a}}let r=Ot({...t,processors:m0});return ie(e,r),Rt(r,e),Tt(r,e)}s(f0,"cs"),o(f0,"toJSONSchema");var oD=class{static{s(this,"us")}static{o(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Ot({processors:m0,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return ie(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Rt(this.ctx,e);let r=Tt(this.ctx,e),{"~standard":i,...u}=r;return u}},lD={},f1={};ut(f1,{ZodAny:s(()=>cl,"ZodAny"),ZodArray:s(()=>yl,"ZodArray"),ZodBase64:s(()=>wn,"ZodBase64"),ZodBase64URL:s(()=>Dn,"ZodBase64URL"),ZodBigInt:s(()=>Ar,"ZodBigInt"),ZodBigIntFormat:s(()=>kn,"ZodBigIntFormat"),ZodBoolean:s(()=>kr,"ZodBoolean"),ZodCIDRv4:s(()=>En,"ZodCIDRv4"),ZodCIDRv6:s(()=>bn,"ZodCIDRv6"),ZodCUID:s(()=>pn,"ZodCUID"),ZodCUID2:s(()=>mn,"ZodCUID2"),ZodCatch:s(()=>Gl,"ZodCatch"),ZodCodec:s(()=>Or,"ZodCodec"),ZodCustom:s(()=>Tr,"ZodCustom"),ZodCustomStringFormat:s(()=>mu,"ZodCustomStringFormat"),ZodDate:s(()=>In,"ZodDate"),ZodDefault:s(()=>Ll,"ZodDefault"),ZodDiscriminatedUnion:s(()=>xl,"ZodDiscriminatedUnion"),ZodE164:s(()=>$n,"ZodE164"),ZodEmail:s(()=>ln,"ZodEmail"),ZodEmoji:s(()=>dn,"ZodEmoji"),ZodEnum:s(()=>gu,"ZodEnum"),ZodExactOptional:s(()=>Ul,"ZodExactOptional"),ZodFile:s(()=>Rl,"ZodFile"),ZodFunction:s(()=>sd,"ZodFunction"),ZodGUID:s(()=>$r,"ZodGUID"),ZodIPv4:s(()=>vn,"ZodIPv4"),ZodIPv6:s(()=>yn,"ZodIPv6"),ZodIntersection:s(()=>kl,"ZodIntersection"),ZodJWT:s(()=>Bn,"ZodJWT"),ZodKSUID:s(()=>gn,"ZodKSUID"),ZodLazy:s(()=>rd,"ZodLazy"),ZodLiteral:s(()=>Ml,"ZodLiteral"),ZodMAC:s(()=>P0,"ZodMAC"),ZodMap:s(()=>Sl,"ZodMap"),ZodNaN:s(()=>Kl,"ZodNaN"),ZodNanoID:s(()=>cn,"ZodNanoID"),ZodNever:s(()=>fl,"ZodNever"),ZodNonOptional:s(()=>On,"ZodNonOptional"),ZodNull:s(()=>dl,"ZodNull"),ZodNullable:s(()=>ql,"ZodNullable"),ZodNumber:s(()=>xr,"ZodNumber"),ZodNumberFormat:s(()=>Pt,"ZodNumberFormat"),ZodObject:s(()=>_r,"ZodObject"),ZodOptional:s(()=>jn,"ZodOptional"),ZodPipe:s(()=>Nr,"ZodPipe"),ZodPrefault:s(()=>Vl,"ZodPrefault"),ZodPreprocess:s(()=>Ql,"ZodPreprocess"),ZodPromise:s(()=>id,"ZodPromise"),ZodReadonly:s(()=>ed,"ZodReadonly"),ZodRecord:s(()=>hu,"ZodRecord"),ZodSet:s(()=>jl,"ZodSet"),ZodString:s(()=>Dr,"ZodString"),ZodStringFormat:s(()=>ae,"ZodStringFormat"),ZodSuccess:s(()=>Jl,"ZodSuccess"),ZodSymbol:s(()=>sl,"ZodSymbol"),ZodTemplateLiteral:s(()=>td,"ZodTemplateLiteral"),ZodTransform:s(()=>Pl,"ZodTransform"),ZodTuple:s(()=>Al,"ZodTuple"),ZodType:s(()=>Q,"ZodType"),ZodULID:s(()=>fn,"ZodULID"),ZodURL:s(()=>Br,"ZodURL"),ZodUUID:s(()=>He,"ZodUUID"),ZodUndefined:s(()=>ol,"ZodUndefined"),ZodUnion:s(()=>Sr,"ZodUnion"),ZodUnknown:s(()=>ml,"ZodUnknown"),ZodVoid:s(()=>hl,"ZodVoid"),ZodXID:s(()=>hn,"ZodXID"),ZodXor:s(()=>$l,"ZodXor"),_ZodString:s(()=>on,"_ZodString"),_default:s(()=>Nn,"_default"),_function:s(()=>Rr,"_function"),any:s(()=>pl,"any"),array:s(()=>fu,"array"),base64:s(()=>V0,"base64"),base64url:s(()=>J0,"base64url"),bigint:s(()=>rl,"bigint"),boolean:s(()=>Cn,"boolean"),catch:s(()=>Tn,"catch"),check:s(()=>ad,"check"),cidrv4:s(()=>Z0,"cidrv4"),cidrv6:s(()=>L0,"cidrv6"),codec:s(()=>Xl,"codec"),cuid:s(()=>z0,"cuid"),cuid2:s(()=>N0,"cuid2"),custom:s(()=>od,"custom"),date:s(()=>vl,"date"),describe:s(()=>_1,"describe"),discriminatedUnion:s(()=>Cl,"discriminatedUnion"),e164:s(()=>W0,"e164"),email:s(()=>B0,"email"),emoji:s(()=>F0,"emoji"),enum:s(()=>jr,"enum"),exactOptional:s(()=>zn,"exactOptional"),file:s(()=>Tl,"file"),float32:s(()=>Q0,"float32"),float64:s(()=>el,"float64"),function:s(()=>Rr,"function"),guid:s(()=>x0,"guid"),hash:s(()=>Y0,"hash"),hex:s(()=>X0,"hex"),hostname:s(()=>H0,"hostname"),httpUrl:s(()=>S0,"httpUrl"),instanceof:s(()=>ld,"instanceof"),int:s(()=>Cr,"int"),int32:s(()=>tl,"int32"),int64:s(()=>il,"int64"),intersection:s(()=>_n,"intersection"),invertCodec:s(()=>Yl,"invertCodec"),ipv4:s(()=>T0,"ipv4"),ipv6:s(()=>q0,"ipv6"),json:s(()=>dd,"json"),jwt:s(()=>G0,"jwt"),keyof:s(()=>El,"keyof"),ksuid:s(()=>R0,"ksuid"),lazy:s(()=>Un,"lazy"),literal:s(()=>Ol,"literal"),looseObject:s(()=>Dl,"looseObject"),looseRecord:s(()=>_l,"looseRecord"),mac:s(()=>U0,"mac"),map:s(()=>Fl,"map"),meta:s(()=>S1,"meta"),nan:s(()=>Hl,"nan"),nanoid:s(()=>j0,"nanoid"),nativeEnum:s(()=>Nl,"nativeEnum"),never:s(()=>Ir,"never"),nonoptional:s(()=>Rn,"nonoptional"),null:s(()=>An,"null"),nullable:s(()=>yu,"nullable"),nullish:s(()=>Zl,"nullish"),number:s(()=>xn,"number"),object:s(()=>bl,"object"),optional:s(()=>vu,"optional"),partialRecord:s(()=>Il,"partialRecord"),pipe:s(()=>Mr,"pipe"),prefault:s(()=>Mn,"prefault"),preprocess:s(()=>cd,"preprocess"),promise:s(()=>nd,"promise"),readonly:s(()=>Pn,"readonly"),record:s(()=>Fn,"record"),refine:s(()=>qn,"refine"),set:s(()=>zl,"set"),strictObject:s(()=>wl,"strictObject"),string:s(()=>pu,"string"),stringFormat:s(()=>K0,"stringFormat"),stringbool:s(()=>F1,"stringbool"),success:s(()=>Wl,"success"),superRefine:s(()=>Zn,"superRefine"),symbol:s(()=>al,"symbol"),templateLiteral:s(()=>ud,"templateLiteral"),transform:s(()=>zr,"transform"),tuple:s(()=>Sn,"tuple"),uint32:s(()=>ul,"uint32"),uint64:s(()=>nl,"uint64"),ulid:s(()=>M0,"ulid"),undefined:s(()=>ll,"undefined"),union:s(()=>Fr,"union"),unknown:s(()=>gt,"unknown"),url:s(()=>_0,"url"),uuid:s(()=>C0,"uuid"),uuidv4:s(()=>k0,"uuidv4"),uuidv6:s(()=>A0,"uuidv6"),uuidv7:s(()=>I0,"uuidv7"),void:s(()=>gl,"void"),xid:s(()=>O0,"xid"),xor:s(()=>Bl,"xor")});var h1={};ut(h1,{endsWith:s(()=>fr,"endsWith"),gt:s(()=>nt,"gt"),gte:s(()=>Ce,"gte"),includes:s(()=>pr,"includes"),length:s(()=>lu,"length"),lowercase:s(()=>dr,"lowercase"),lt:s(()=>it,"lt"),lte:s(()=>ze,"lte"),maxLength:s(()=>ou,"maxLength"),maxSize:s(()=>Mt,"maxSize"),mime:s(()=>hr,"mime"),minLength:s(()=>ht,"minLength"),minSize:s(()=>st,"minSize"),multipleOf:s(()=>Nt,"multipleOf"),negative:s(()=>rn,"negative"),nonnegative:s(()=>sn,"nonnegative"),nonpositive:s(()=>nn,"nonpositive"),normalize:s(()=>gr,"normalize"),overwrite:s(()=>Ke,"overwrite"),positive:s(()=>un,"positive"),property:s(()=>an,"property"),regex:s(()=>lr,"regex"),size:s(()=>au,"size"),slugify:s(()=>br,"slugify"),startsWith:s(()=>mr,"startsWith"),toLowerCase:s(()=>yr,"toLowerCase"),toUpperCase:s(()=>Er,"toUpperCase"),trim:s(()=>vr,"trim"),uppercase:s(()=>cr,"uppercase")});var h0={};ut(h0,{ZodISODate:s(()=>y0,"ZodISODate"),ZodISODateTime:s(()=>g0,"ZodISODateTime"),ZodISODuration:s(()=>D0,"ZodISODuration"),ZodISOTime:s(()=>b0,"ZodISOTime"),date:s(()=>E0,"date"),datetime:s(()=>v0,"datetime"),duration:s(()=>$0,"duration"),time:s(()=>w0,"time")});var g0=B("ZodISODateTime",(e,t)=>{lh.init(e,t),ae.init(e,t)});function v0(e){return Io(g0,e)}s(v0,"uf"),o(v0,"datetime");var y0=B("ZodISODate",(e,t)=>{dh.init(e,t),ae.init(e,t)});function E0(e){return _o(y0,e)}s(E0,"lf"),o(E0,"date");var b0=B("ZodISOTime",(e,t)=>{ch.init(e,t),ae.init(e,t)});function w0(e){return So(b0,e)}s(w0,"df"),o(w0,"time");var D0=B("ZodISODuration",(e,t)=>{ph.init(e,t),ae.init(e,t)});function $0(e){return Fo(D0,e)}s($0,"pf"),o($0,"duration");var g1=o((e,t)=>{$a.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o(r=>Si(e,r),"value")},flatten:{value:o(r=>_i(e,r),"value")},addIssue:{value:o(r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Vu,2)},"value")},addIssues:{value:o(r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Vu,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),dD=B("ZodError",g1),Ne=B("ZodError",g1,{Parent:Error}),v1=Hu(Ne),y1=Xu(Ne),E1=Yu(Ne),b1=Qu(Ne),w1=Ia(Ne),D1=_a(Ne),$1=Sa(Ne),B1=Fa(Ne),x1=ja(Ne),C1=za(Ne),k1=Na(Ne),A1=Ma(Ne),I1=new WeakMap;function cu(e,t,r){let i=Object.getPrototypeOf(e),u=I1.get(i);if(u||(u=new Set,I1.set(i,u)),!u.has(t)){u.add(t);for(let n in r){let a=r[n];Object.defineProperty(i,n,{configurable:!0,enumerable:!1,get(){let l=a.bind(this);return Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}s(cu,"Yn"),o(cu,"_installLazyMethods");var Q=B("ZodType",(e,t)=>(X.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wr(e,"input"),output:wr(e,"output")}}),e.toJSONSchema=_v(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,i)=>v1(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>E1(e,r,i),e.parseAsync=async(r,i)=>y1(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>b1(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>w1(e,r,i),e.decode=(r,i)=>D1(e,r,i),e.encodeAsync=async(r,i)=>$1(e,r,i),e.decodeAsync=async(r,i)=>B1(e,r,i),e.safeEncode=(r,i)=>x1(e,r,i),e.safeDecode=(r,i)=>C1(e,r,i),e.safeEncodeAsync=async(r,i)=>k1(e,r,i),e.safeDecodeAsync=async(r,i)=>A1(e,r,i),cu(e,"ZodType",{check(...r){let i=this.def;return this.clone(te.mergeDefs(i,{checks:[...i.checks??[],...r.map(u=>typeof u=="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Se(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(qn(r,i))},superRefine(r,i){return this.check(Zn(r,i))},overwrite(r){return this.check(Ke(r))},optional(){return vu(this)},exactOptional(){return zn(this)},nullable(){return yu(this)},nullish(){return vu(yu(this))},nonoptional(r){return Rn(this,r)},array(){return fu(this)},or(r){return Fr([this,r])},and(r){return _n(this,r)},transform(r){return Mr(this,zr(r))},default(r){return Nn(this,r)},prefault(r){return Mn(this,r)},catch(r){return Tn(this,r)},pipe(r){return Mr(this,r)},readonly(){return Pn(this)},describe(r){let i=this.clone();return Re.add(i,{description:r}),i},meta(...r){if(r.length===0)return Re.get(this);let i=this.clone();return Re.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Re.get(e)?.description},configurable:!0}),e)),on=B("_ZodString",(e,t)=>{tr.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Sv(e,i,u,n);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,cu(e,"_ZodString",{regex(...i){return this.check(lr(...i))},includes(...i){return this.check(pr(...i))},startsWith(...i){return this.check(mr(...i))},endsWith(...i){return this.check(fr(...i))},min(...i){return this.check(ht(...i))},max(...i){return this.check(ou(...i))},length(...i){return this.check(lu(...i))},nonempty(...i){return this.check(ht(1,...i))},lowercase(i){return this.check(dr(i))},uppercase(i){return this.check(cr(i))},trim(){return this.check(vr())},normalize(...i){return this.check(gr(...i))},toLowerCase(){return this.check(yr())},toUpperCase(){return this.check(Er())},slugify(){return this.check(br())}})}),Dr=B("ZodString",(e,t)=>{tr.init(e,t),on.init(e,t),e.email=r=>e.check(Mi(ln,r)),e.url=r=>e.check(or(Br,r)),e.jwt=r=>e.check(tn(Bn,r)),e.emoji=r=>e.check(Ui(dn,r)),e.guid=r=>e.check(ar($r,r)),e.uuid=r=>e.check(Oi(He,r)),e.uuidv4=r=>e.check(Ri(He,r)),e.uuidv6=r=>e.check(Ti(He,r)),e.uuidv7=r=>e.check(Pi(He,r)),e.nanoid=r=>e.check(qi(cn,r)),e.guid=r=>e.check(ar($r,r)),e.cuid=r=>e.check(Zi(pn,r)),e.cuid2=r=>e.check(Li(mn,r)),e.ulid=r=>e.check(Vi(fn,r)),e.base64=r=>e.check(Yi(wn,r)),e.base64url=r=>e.check(Qi(Dn,r)),e.xid=r=>e.check(Ji(hn,r)),e.ksuid=r=>e.check(Wi(gn,r)),e.ipv4=r=>e.check(Gi(vn,r)),e.ipv6=r=>e.check(Ki(yn,r)),e.cidrv4=r=>e.check(Hi(En,r)),e.cidrv6=r=>e.check(Xi(bn,r)),e.e164=r=>e.check(en($n,r)),e.datetime=r=>e.check(v0(r)),e.date=r=>e.check(E0(r)),e.time=r=>e.check(w0(r)),e.duration=r=>e.check($0(r))});function pu(e){return Co(Dr,e)}s(pu,"Wn"),o(pu,"string");var ae=B("ZodStringFormat",(e,t)=>{se.init(e,t),on.init(e,t)}),ln=B("ZodEmail",(e,t)=>{eh.init(e,t),ae.init(e,t)});function B0(e){return Mi(ln,e)}s(B0,"qw"),o(B0,"email");var $r=B("ZodGUID",(e,t)=>{Yf.init(e,t),ae.init(e,t)});function x0(e){return ar($r,e)}s(x0,"Vw"),o(x0,"guid");var He=B("ZodUUID",(e,t)=>{Qf.init(e,t),ae.init(e,t)});function C0(e){return Oi(He,e)}s(C0,"Gw"),o(C0,"uuid");function k0(e){return Ri(He,e)}s(k0,"Jw"),o(k0,"uuidv4");function A0(e){return Ti(He,e)}s(A0,"Ww"),o(A0,"uuidv6");function I0(e){return Pi(He,e)}s(I0,"Kw"),o(I0,"uuidv7");var Br=B("ZodURL",(e,t)=>{th.init(e,t),ae.init(e,t)});function _0(e){return or(Br,e)}s(_0,"Xw"),o(_0,"url");function S0(e){return or(Br,{protocol:ft.httpProtocol,hostname:ft.domain,...te.normalizeParams(e)})}s(S0,"Hw"),o(S0,"httpUrl");var dn=B("ZodEmoji",(e,t)=>{uh.init(e,t),ae.init(e,t)});function F0(e){return Ui(dn,e)}s(F0,"Yw"),o(F0,"emoji");var cn=B("ZodNanoID",(e,t)=>{rh.init(e,t),ae.init(e,t)});function j0(e){return qi(cn,e)}s(j0,"Qw"),o(j0,"nanoid");var pn=B("ZodCUID",(e,t)=>{ih.init(e,t),ae.init(e,t)});function z0(e){return Zi(pn,e)}s(z0,"ex"),o(z0,"cuid");var mn=B("ZodCUID2",(e,t)=>{nh.init(e,t),ae.init(e,t)});function N0(e){return Li(mn,e)}s(N0,"tx"),o(N0,"cuid2");var fn=B("ZodULID",(e,t)=>{sh.init(e,t),ae.init(e,t)});function M0(e){return Vi(fn,e)}s(M0,"rx"),o(M0,"ulid");var hn=B("ZodXID",(e,t)=>{ah.init(e,t),ae.init(e,t)});function O0(e){return Ji(hn,e)}s(O0,"nx"),o(O0,"xid");var gn=B("ZodKSUID",(e,t)=>{oh.init(e,t),ae.init(e,t)});function R0(e){return Wi(gn,e)}s(R0,"ox"),o(R0,"ksuid");var vn=B("ZodIPv4",(e,t)=>{mh.init(e,t),ae.init(e,t)});function T0(e){return Gi(vn,e)}s(T0,"ix"),o(T0,"ipv4");var P0=B("ZodMAC",(e,t)=>{hh.init(e,t),ae.init(e,t)});function U0(e){return Ao(P0,e)}s(U0,"sx"),o(U0,"mac");var yn=B("ZodIPv6",(e,t)=>{fh.init(e,t),ae.init(e,t)});function q0(e){return Ki(yn,e)}s(q0,"ax"),o(q0,"ipv6");var En=B("ZodCIDRv4",(e,t)=>{gh.init(e,t),ae.init(e,t)});function Z0(e){return Hi(En,e)}s(Z0,"cx"),o(Z0,"cidrv4");var bn=B("ZodCIDRv6",(e,t)=>{vh.init(e,t),ae.init(e,t)});function L0(e){return Xi(bn,e)}s(L0,"ux"),o(L0,"cidrv6");var wn=B("ZodBase64",(e,t)=>{yh.init(e,t),ae.init(e,t)});function V0(e){return Yi(wn,e)}s(V0,"lx"),o(V0,"base64");var Dn=B("ZodBase64URL",(e,t)=>{Eh.init(e,t),ae.init(e,t)});function J0(e){return Qi(Dn,e)}s(J0,"dx"),o(J0,"base64url");var $n=B("ZodE164",(e,t)=>{bh.init(e,t),ae.init(e,t)});function W0(e){return en($n,e)}s(W0,"px"),o(W0,"e164");var Bn=B("ZodJWT",(e,t)=>{wh.init(e,t),ae.init(e,t)});function G0(e){return tn(Bn,e)}s(G0,"fx"),o(G0,"jwt");var mu=B("ZodCustomStringFormat",(e,t)=>{Dh.init(e,t),ae.init(e,t)});function K0(e,t,r={}){return du(mu,e,t,r)}s(K0,"mx"),o(K0,"stringFormat");function H0(e){return du(mu,"hostname",ft.hostname,e)}s(H0,"hx"),o(H0,"hostname");function X0(e){return du(mu,"hex",ft.hex,e)}s(X0,"gx"),o(X0,"hex");function Y0(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,u=ft[i];if(!u)throw new Error(`Unrecognized hash format: ${i}`);return du(mu,i,u,t)}s(Y0,"vx"),o(Y0,"hash");var xr=B("ZodNumber",(e,t)=>{Ga.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Fv(e,i,u,n),cu(e,"ZodNumber",{gt(i,u){return this.check(nt(i,u))},gte(i,u){return this.check(Ce(i,u))},min(i,u){return this.check(Ce(i,u))},lt(i,u){return this.check(it(i,u))},lte(i,u){return this.check(ze(i,u))},max(i,u){return this.check(ze(i,u))},int(i){return this.check(Cr(i))},safe(i){return this.check(Cr(i))},positive(i){return this.check(nt(0,i))},nonnegative(i){return this.check(Ce(0,i))},negative(i){return this.check(it(0,i))},nonpositive(i){return this.check(ze(0,i))},multipleOf(i,u){return this.check(Nt(i,u))},step(i,u){return this.check(Nt(i,u))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function xn(e){return jo(xr,e)}s(xn,"If"),o(xn,"number");var Pt=B("ZodNumberFormat",(e,t)=>{$h.init(e,t),xr.init(e,t)});function Cr(e){return No(Pt,e)}s(Cr,"hs"),o(Cr,"int");function Q0(e){return Mo(Pt,e)}s(Q0,"yx"),o(Q0,"float32");function el(e){return Oo(Pt,e)}s(el,"bx"),o(el,"float64");function tl(e){return Ro(Pt,e)}s(tl,"wx"),o(tl,"int32");function ul(e){return To(Pt,e)}s(ul,"xx"),o(ul,"uint32");var kr=B("ZodBoolean",(e,t)=>{Ka.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>jv(e,r,i,u)});function Cn(e){return Po(kr,e)}s(Cn,"Rf"),o(Cn,"boolean");var Ar=B("ZodBigInt",(e,t)=>{Ha.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>zv(e,i,u,n),e.gte=(i,u)=>e.check(Ce(i,u)),e.min=(i,u)=>e.check(Ce(i,u)),e.gt=(i,u)=>e.check(nt(i,u)),e.gte=(i,u)=>e.check(Ce(i,u)),e.min=(i,u)=>e.check(Ce(i,u)),e.lt=(i,u)=>e.check(it(i,u)),e.lte=(i,u)=>e.check(ze(i,u)),e.max=(i,u)=>e.check(ze(i,u)),e.positive=i=>e.check(nt(BigInt(0),i)),e.negative=i=>e.check(it(BigInt(0),i)),e.nonpositive=i=>e.check(ze(BigInt(0),i)),e.nonnegative=i=>e.check(Ce(BigInt(0),i)),e.multipleOf=(i,u)=>e.check(Nt(i,u));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function rl(e){return qo(Ar,e)}s(rl,"$x"),o(rl,"bigint");var kn=B("ZodBigIntFormat",(e,t)=>{Bh.init(e,t),Ar.init(e,t)});function il(e){return Lo(kn,e)}s(il,"_x"),o(il,"int64");function nl(e){return Vo(kn,e)}s(nl,"kx"),o(nl,"uint64");var sl=B("ZodSymbol",(e,t)=>{xh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Nv(e,r,i,u)});function al(e){return Jo(sl,e)}s(al,"Sx"),o(al,"symbol");var ol=B("ZodUndefined",(e,t)=>{Ch.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Ov(e,r,i,u)});function ll(e){return Wo(ol,e)}s(ll,"Ix"),o(ll,"_undefined");var dl=B("ZodNull",(e,t)=>{kh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Mv(e,r,i,u)});function An(e){return Go(dl,e)}s(An,"jf"),o(An,"_null");var cl=B("ZodAny",(e,t)=>{Ah.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Pv(e,r,i,u)});function pl(){return Ko(cl)}s(pl,"Rx"),o(pl,"any");var ml=B("ZodUnknown",(e,t)=>{Ih.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Uv(e,r,i,u)});function gt(){return Ho(ml)}s(gt,"or"),o(gt,"unknown");var fl=B("ZodNever",(e,t)=>{_h.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Tv(e,r,i,u)});function Ir(e){return Xo(fl,e)}s(Ir,"Ns"),o(Ir,"never");var hl=B("ZodVoid",(e,t)=>{Sh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Rv(e,r,i,u)});function gl(e){return Yo(hl,e)}s(gl,"Ex"),o(gl,"_void");var In=B("ZodDate",(e,t)=>{Fh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>qv(e,i,u,n),e.min=(i,u)=>e.check(Ce(i,u)),e.max=(i,u)=>e.check(ze(i,u));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function vl(e){return Qo(In,e)}s(vl,"Tx"),o(vl,"date");var yl=B("ZodArray",(e,t)=>{jh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>e1(e,r,i,u),e.element=t.element,cu(e,"ZodArray",{min(r,i){return this.check(ht(r,i))},nonempty(r){return this.check(ht(1,r))},max(r,i){return this.check(ou(r,i))},length(r,i){return this.check(lu(r,i))},unwrap(){return this.element}})});function fu(e,t){return u0(yl,e,t)}s(fu,"to"),o(fu,"array");function El(e){let t=e._zod.def.shape;return jr(Object.keys(t))}s(El,"Ax"),o(El,"keyof");var _r=B("ZodObject",(e,t)=>{Nh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>t1(e,r,i,u),te.defineLazy(e,"shape",()=>t.shape),cu(e,"ZodObject",{keyof(){return jr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:gt()})},loose(){return this.clone({...this._zod.def,catchall:gt()})},strict(){return this.clone({...this._zod.def,catchall:Ir()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return te.extend(this,r)},safeExtend(r){return te.safeExtend(this,r)},merge(r){return te.merge(this,r)},pick(r){return te.pick(this,r)},omit(r){return te.omit(this,r)},partial(...r){return te.partial(jn,this,r[0])},required(...r){return te.required(On,this,r[0])}})});function bl(e,t){let r={type:"object",shape:e??{},...te.normalizeParams(t)};return new _r(r)}s(bl,"jx"),o(bl,"object");function wl(e,t){return new _r({type:"object",shape:e,catchall:Ir(),...te.normalizeParams(t)})}s(wl,"zx"),o(wl,"strictObject");function Dl(e,t){return new _r({type:"object",shape:e,catchall:gt(),...te.normalizeParams(t)})}s(Dl,"Ox"),o(Dl,"looseObject");var Sr=B("ZodUnion",(e,t)=>{ji.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c0(e,r,i,u),e.options=t.options});function Fr(e,t){return new Sr({type:"union",options:e,...te.normalizeParams(t)})}s(Fr,"Ps"),o(Fr,"union");var $l=B("ZodXor",(e,t)=>{Sr.init(e,t),Mh.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c0(e,r,i,u),e.options=t.options});function Bl(e,t){return new $l({type:"union",options:e,inclusive:!1,...te.normalizeParams(t)})}s(Bl,"Mx"),o(Bl,"xor");var xl=B("ZodDiscriminatedUnion",(e,t)=>{Sr.init(e,t),Oh.init(e,t)});function Cl(e,t,r){return new xl({type:"union",options:t,discriminator:e,...te.normalizeParams(r)})}s(Cl,"Nx"),o(Cl,"discriminatedUnion");var kl=B("ZodIntersection",(e,t)=>{Rh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>u1(e,r,i,u)});function _n(e,t){return new kl({type:"intersection",left:e,right:t})}s(_n,"Lf"),o(_n,"intersection");var Al=B("ZodTuple",(e,t)=>{ro.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>r1(e,r,i,u),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Sn(e,t,r){let i=t instanceof X,u=i?r:t,n=i?t:null;return new Al({type:"tuple",items:e,rest:n,...te.normalizeParams(u)})}s(Sn,"Bf"),o(Sn,"tuple");var hu=B("ZodRecord",(e,t)=>{Th.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>i1(e,r,i,u),e.keyType=t.keyType,e.valueType=t.valueType});function Fn(e,t,r){return!t||!t._zod?new hu({type:"record",keyType:pu(),valueType:e,...te.normalizeParams(t)}):new hu({type:"record",keyType:e,valueType:t,...te.normalizeParams(r)})}s(Fn,"Zf"),o(Fn,"record");function Il(e,t,r){let i=Se(e);return i._zod.values=void 0,new hu({type:"record",keyType:i,valueType:t,...te.normalizeParams(r)})}s(Il,"Px"),o(Il,"partialRecord");function _l(e,t,r){return new hu({type:"record",keyType:e,valueType:t,mode:"loose",...te.normalizeParams(r)})}s(_l,"Dx"),o(_l,"looseRecord");var Sl=B("ZodMap",(e,t)=>{Ph.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Yv(e,r,i,u),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Mt(...r)),e.size=(...r)=>e.check(au(...r))});function Fl(e,t,r){return new Sl({type:"map",keyType:e,valueType:t,...te.normalizeParams(r)})}s(Fl,"Cx"),o(Fl,"map");var jl=B("ZodSet",(e,t)=>{Uh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Qv(e,r,i,u),e.min=(...r)=>e.check(st(...r)),e.nonempty=r=>e.check(st(1,r)),e.max=(...r)=>e.check(Mt(...r)),e.size=(...r)=>e.check(au(...r))});function zl(e,t){return new jl({type:"set",valueType:e,...te.normalizeParams(t)})}s(zl,"Ux"),o(zl,"set");var gu=B("ZodEnum",(e,t)=>{qh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(i,u,n)=>Zv(e,i,u,n),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,u)=>{let n={};for(let a of i)if(r.has(a))n[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new gu({...t,checks:[],...te.normalizeParams(u),entries:n})},e.exclude=(i,u)=>{let n={...t.entries};for(let a of i)if(r.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new gu({...t,checks:[],...te.normalizeParams(u),entries:n})}});function jr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new gu({type:"enum",entries:r,...te.normalizeParams(t)})}s(jr,"Ds"),o(jr,"_enum");function Nl(e,t){return new gu({type:"enum",entries:e,...te.normalizeParams(t)})}s(Nl,"Lx"),o(Nl,"nativeEnum");var Ml=B("ZodLiteral",(e,t)=>{Zh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Lv(e,r,i,u),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 Ol(e,t){return new Ml({type:"literal",values:Array.isArray(e)?e:[e],...te.normalizeParams(t)})}s(Ol,"Fx"),o(Ol,"literal");var Rl=B("ZodFile",(e,t)=>{Lh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Wv(e,r,i,u),e.min=(r,i)=>e.check(st(r,i)),e.max=(r,i)=>e.check(Mt(r,i)),e.mime=(r,i)=>e.check(hr(Array.isArray(r)?r:[r],i))});function Tl(e){return r0(Rl,e)}s(Tl,"Bx"),o(Tl,"file");var Pl=B("ZodTransform",(e,t)=>{Vh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Xv(e,r,i,u),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ci(e.constructor.name);r.addIssue=n=>{if(typeof n=="string")r.issues.push(te.issue(n,r.value,t));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(te.issue(a))}};let u=t.transform(r.value,r);return u instanceof Promise?u.then(n=>(r.value=n,r.fallback=!0,r)):(r.value=u,r.fallback=!0,r)}});function zr(e){return new Pl({type:"transform",transform:e})}s(zr,"Cs"),o(zr,"transform");var jn=B("ZodOptional",(e,t)=>{co.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p0(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function vu(e){return new jn({type:"optional",innerType:e})}s(vu,"Xn"),o(vu,"optional");var Ul=B("ZodExactOptional",(e,t)=>{Jh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p0(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function zn(e){return new Ul({type:"optional",innerType:e})}s(zn,"Xf"),o(zn,"exactOptional");var ql=B("ZodNullable",(e,t)=>{Wh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>n1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function yu(e){return new ql({type:"nullable",innerType:e})}s(yu,"Hn"),o(yu,"nullable");function Zl(e){return vu(yu(e))}s(Zl,"Zx"),o(Zl,"nullish");var Ll=B("ZodDefault",(e,t)=>{Gh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>a1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nn(e,t){return new Ll({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(Nn,"Qf"),o(Nn,"_default");var Vl=B("ZodPrefault",(e,t)=>{Kh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>o1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Mn(e,t){return new Vl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():te.shallowClone(t)}})}s(Mn,"tm"),o(Mn,"prefault");var On=B("ZodNonOptional",(e,t)=>{Hh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>s1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Rn(e,t){return new On({type:"nonoptional",innerType:e,...te.normalizeParams(t)})}s(Rn,"rm"),o(Rn,"nonoptional");var Jl=B("ZodSuccess",(e,t)=>{Xh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Gv(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Wl(e){return new Jl({type:"success",innerType:e})}s(Wl,"qx"),o(Wl,"success");var Gl=B("ZodCatch",(e,t)=>{Yh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>l1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tn(e,t){return new Gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}s(Tn,"im"),o(Tn,"_catch");var Kl=B("ZodNaN",(e,t)=>{Qh.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Vv(e,r,i,u)});function Hl(e){return t0(Kl,e)}s(Hl,"Vx"),o(Hl,"nan");var Nr=B("ZodPipe",(e,t)=>{fo.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>d1(e,r,i,u),e.in=t.in,e.out=t.out});function Mr(e,t){return new Nr({type:"pipe",in:e,out:t})}s(Mr,"gs"),o(Mr,"pipe");var Or=B("ZodCodec",(e,t)=>{Nr.init(e,t),ho.init(e,t)});function Xl(e,t,r){return new Or({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}s(Xl,"Gx"),o(Xl,"codec");function Yl(e){let t=e._zod.def;return new Or({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}s(Yl,"Jx"),o(Yl,"invertCodec");var Ql=B("ZodPreprocess",(e,t)=>{Nr.init(e,t),eg.init(e,t)}),ed=B("ZodReadonly",(e,t)=>{tg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>c1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function Pn(e){return new ed({type:"readonly",innerType:e})}s(Pn,"um"),o(Pn,"readonly");var td=B("ZodTemplateLiteral",(e,t)=>{ug.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Jv(e,r,i,u)});function ud(e,t){return new td({type:"template_literal",parts:e,...te.normalizeParams(t)})}s(ud,"Wx"),o(ud,"templateLiteral");var rd=B("ZodLazy",(e,t)=>{ng.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>m1(e,r,i,u),e.unwrap=()=>e._zod.def.getter()});function Un(e){return new rd({type:"lazy",getter:e})}s(Un,"pm"),o(Un,"lazy");var id=B("ZodPromise",(e,t)=>{ig.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>p1(e,r,i,u),e.unwrap=()=>e._zod.def.innerType});function nd(e){return new id({type:"promise",innerType:e})}s(nd,"Kx"),o(nd,"promise");var sd=B("ZodFunction",(e,t)=>{rg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Hv(e,r,i,u)});function Rr(e){return new sd({type:"function",input:Array.isArray(e?.input)?Sn(e?.input):e?.input??fu(gt()),output:e?.output??gt()})}s(Rr,"Xx"),o(Rr,"_function");var Tr=B("ZodCustom",(e,t)=>{sg.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,i,u)=>Kv(e,r,i,u)});function ad(e){let t=new de({check:"custom"});return t._zod.check=e,t}s(ad,"Hx"),o(ad,"check");function od(e,t){return i0(Tr,e??(()=>!0),t)}s(od,"Yx"),o(od,"custom");function qn(e,t={}){return n0(Tr,e,t)}s(qn,"hm"),o(qn,"refine");function Zn(e,t){return s0(e,t)}s(Zn,"gm"),o(Zn,"superRefine");var _1=o0,S1=l0;function ld(e,t={}){let r=new Tr({type:"custom",check:"custom",fn:o(i=>i instanceof e,"fn"),abort:!0,...te.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}s(ld,"t$"),o(ld,"_instanceof");var F1=o((...e)=>d0({Codec:Or,Boolean:kr,String:Dr},...e),"stringbool");function dd(e){let t=Un(()=>Fr([pu(e),xn(),Cn(),An(),fu(t),Fn(pu(),t)]));return t}s(dd,"n$"),o(dd,"json");function cd(e,t){return new Ql({type:"pipe",in:zr(e),out:t})}s(cd,"o$"),o(cd,"preprocess");var cD={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 j1(e){be({customError:e})}s(j1,"DR"),o(j1,"setErrorMap");function z1(){return be().customError}s(z1,"CR"),o(z1,"getErrorMap");var pd;pd||(pd={});var q={...f1,...h1,iso:h0},pD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function N1(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}s(N1,"LR"),o(N1,"detectVersion");function M1(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let u=r[1];if(!u||!t.defs[u])throw new Error(`Reference not found: ${e}`);return t.defs[u]}throw new Error(`Reference not found: ${e}`)}s(M1,"FR"),o(M1,"resolveRef");function md(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let u=e.$ref;if(t.refs.has(u))return t.refs.get(u);if(t.processing.has(u))return q.lazy(()=>{if(!t.refs.has(u))throw new Error(`Circular reference not resolved: ${u}`);return t.refs.get(u)});t.processing.add(u);let n=M1(u,t),a=$e(n,t);return t.refs.set(u,a),t.processing.delete(u),a}if(e.enum!==void 0){let u=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&u.length===1&&u[0]===null)return q.null();if(u.length===0)return q.never();if(u.length===1)return q.literal(u[0]);if(u.every(a=>typeof a=="string"))return q.enum(u);let n=u.map(a=>q.literal(a));return n.length<2?n[0]:q.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let r=e.type;if(Array.isArray(r)){let u=r.map(n=>{let a={...e,type:n};return md(a,t)});return u.length===0?q.never():u.length===1?u[0]:q.union(u)}if(!r)return q.any();let i;switch(r){case"string":{let u=q.string();if(e.format){let n=e.format;n==="email"?u=u.check(q.email()):n==="uri"||n==="uri-reference"?u=u.check(q.url()):n==="uuid"||n==="guid"?u=u.check(q.uuid()):n==="date-time"?u=u.check(q.iso.datetime()):n==="date"?u=u.check(q.iso.date()):n==="time"?u=u.check(q.iso.time()):n==="duration"?u=u.check(q.iso.duration()):n==="ipv4"?u=u.check(q.ipv4()):n==="ipv6"?u=u.check(q.ipv6()):n==="mac"?u=u.check(q.mac()):n==="cidr"?u=u.check(q.cidrv4()):n==="cidr-v6"?u=u.check(q.cidrv6()):n==="base64"?u=u.check(q.base64()):n==="base64url"?u=u.check(q.base64url()):n==="e164"?u=u.check(q.e164()):n==="jwt"?u=u.check(q.jwt()):n==="emoji"?u=u.check(q.emoji()):n==="nanoid"?u=u.check(q.nanoid()):n==="cuid"?u=u.check(q.cuid()):n==="cuid2"?u=u.check(q.cuid2()):n==="ulid"?u=u.check(q.ulid()):n==="xid"?u=u.check(q.xid()):n==="ksuid"&&(u=u.check(q.ksuid()))}typeof e.minLength=="number"&&(u=u.min(e.minLength)),typeof e.maxLength=="number"&&(u=u.max(e.maxLength)),e.pattern&&(u=u.regex(new RegExp(e.pattern))),i=u;break}case"number":case"integer":{let u=r==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(u=u.min(e.minimum)),typeof e.maximum=="number"&&(u=u.max(e.maximum)),typeof e.exclusiveMinimum=="number"?u=u.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(u=u.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?u=u.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(u=u.lt(e.maximum)),typeof e.multipleOf=="number"&&(u=u.multipleOf(e.multipleOf)),i=u;break}case"boolean":{i=q.boolean();break}case"null":{i=q.null();break}case"object":{let u={},n=e.properties||{},a=new Set(e.required||[]);for(let[d,c]of Object.entries(n)){let p=$e(c,t);u[d]=a.has(d)?p:p.optional()}if(e.propertyNames){let d=$e(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?$e(e.additionalProperties,t):q.any();if(Object.keys(u).length===0){i=q.record(d,c);break}let p=q.object(u).passthrough(),m=q.looseRecord(d,c);i=q.intersection(p,m);break}if(e.patternProperties){let d=e.patternProperties,c=Object.keys(d),p=[];for(let f of c){let h=$e(d[f],t),g=q.string().regex(new RegExp(f));p.push(q.looseRecord(g,h))}let m=[];if(Object.keys(u).length>0&&m.push(q.object(u).passthrough()),m.push(...p),m.length===0)i=q.object({}).passthrough();else if(m.length===1)i=m[0];else{let f=q.intersection(m[0],m[1]);for(let h=2;h<m.length;h++)f=q.intersection(f,m[h]);i=f}break}let l=q.object(u);e.additionalProperties===!1?i=l.strict():typeof e.additionalProperties=="object"?i=l.catchall($e(e.additionalProperties,t)):i=l.passthrough();break}case"array":{let u=e.prefixItems,n=e.items;if(u&&Array.isArray(u)){let a=u.map(d=>$e(d,t)),l=n&&typeof n=="object"&&!Array.isArray(n)?$e(n,t):void 0;l?i=q.tuple(a).rest(l):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=n.map(d=>$e(d,t)),l=e.additionalItems&&typeof e.additionalItems=="object"?$e(e.additionalItems,t):void 0;l?i=q.tuple(a).rest(l):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(n!==void 0){let a=$e(n,t),l=q.array(a);typeof e.minItems=="number"&&(l=l.min(e.minItems)),typeof e.maxItems=="number"&&(l=l.max(e.maxItems)),i=l}else i=q.array(q.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}s(md,"i$"),o(md,"convertBaseSchema");function $e(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r=md(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let l=e.anyOf.map(c=>$e(c,t)),d=q.union(l);r=i?q.intersection(r,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let l=e.oneOf.map(c=>$e(c,t)),d=q.xor(l);r=i?q.intersection(r,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:q.any();else{let l=i?r:$e(e.allOf[0],t),d=i?0:1;for(let c=d;c<e.allOf.length;c++)l=q.intersection(l,$e(e.allOf[c],t));r=l}e.nullable===!0&&t.version==="openapi-3.0"&&(r=q.nullable(r)),e.readOnly===!0&&(r=q.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let u={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let l of n)l in e&&(u[l]=e[l]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let l of a)l in e&&(u[l]=e[l]);for(let l of Object.keys(e))pD.has(l)||(u[l]=e[l]);return Object.keys(u).length>0&&t.registry.add(r,u),e.description&&(r=r.describe(e.description)),r}s($e,"Re"),o($e,"convertSchema");function O1(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=N1(r,t?.defaultTarget),u=r.$defs||r.definitions||{},n={version:i,defs:u,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Re};return $e(r,n)}s(O1,"s$"),o(O1,"fromJSONSchema");var R1={};ut(R1,{bigint:s(()=>q1,"bigint"),boolean:s(()=>U1,"boolean"),date:s(()=>Z1,"date"),number:s(()=>P1,"number"),string:s(()=>T1,"string")});function T1(e){return ko(Dr,e)}s(T1,"BR"),o(T1,"string");function P1(e){return zo(xr,e)}s(P1,"ZR"),o(P1,"number");function U1(e){return Uo(kr,e)}s(U1,"qR"),o(U1,"boolean");function q1(e){return Zo(Ar,e)}s(q1,"VR"),o(q1,"bigint");function Z1(e){return e0(In,e)}s(Z1,"GR"),o(Z1,"date"),be(bo());var fd=v.object({file:v.string(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),symbol:v.string().optional(),componentName:v.string().optional(),hookName:v.string().optional()}),mD=v.enum(["user-click","user-input","keyboard","route-load","effect","memo-recompute","timer","raf","idle-callback","websocket-message","broadcast-channel","post-message","storage-event","service-worker-message","media-query-change","visibility-change","resize","intersection-observer","mutation-observer","backend-response","hmr-update","ai-turn","page-load","form-submit","input-change"]),L1=v.object({sessionId:v.string(),browserContextId:v.string().optional(),tabId:v.string().optional(),frameId:v.string().optional(),route:v.string().optional(),url:v.string().optional(),flowId:v.string().optional(),originType:mD.optional(),originNodeId:v.string().optional(),causedByNodeId:v.string().optional(),requestId:v.string().optional(),parentRequestId:v.string().optional(),traceparent:v.string().optional(),projectName:v.string().optional(),userActionId:v.string().optional(),userIdHash:v.string().optional(),tenantIdHash:v.string().optional()}),fD=v.enum(["nx","vite","typescript","eslint","rollup","client-runtime","chrome","react","valtio","nestjs","nextjs","db","redis","queue","memory","visual","perf","security","gateway","external","ai","lens"]),hD=v.enum(["build","lint","typecheck","test","runtime","render","visual","trace","state","network","backend","db","memory","performance","security","deps","cluster","ai"]),hd=v.enum(["debug","info","warning","error","fatal"]),i_=v.object({id:v.string(),sessionId:v.string(),timestamp:v.number().int().nonnegative(),source:fD,category:hD,severity:hd,context:L1,fingerprint:v.string(),title:v.string(),message:v.string().optional(),location:fd.optional(),relatedFiles:v.array(v.string()).optional(),relatedUrls:v.array(v.string()).optional(),raw:v.unknown().optional()}),gD=v.enum(["session","browser-context","tab","renderer","router","route","page","component","element","slot","render","react-mount","react-unmount","hook","effect","effect-run","memo","memo-compute","ui-event","handler","animation","animation-frame","transition","timer","api-client-call","http-request","http-response","server-process","nest-app","nest-module","nest-provider","singleton-instance","server-request","guard","controller","service-method","loop","loop-iteration","queue-job","db-query","redis-op","promise","promise-continuation","state-store","state-update","selector","selector-update","visual-frame","visual-violation","style-change","layout-change","memory-owner","memory-mutation","memory-retention","heap-snapshot","build-event","lint-event","typecheck-event","test-event","bundle-report","hmr-update"]),vD=v.enum(["created","active","completed","disposed","errored"]),n_=v.object({id:v.string(),parentTraceNodeId:v.string().optional(),type:gD,logicalId:v.string().optional(),instanceId:v.string().optional(),generation:v.number().int().nonnegative().optional(),lifecycle:vD,context:L1,name:v.string(),startTime:v.number().int().nonnegative(),endTime:v.number().int().nonnegative().optional(),durationMs:v.number().nonnegative().optional(),location:fd.optional(),attributes:v.record(v.string(),v.unknown())}),yD=v.enum(["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"]),s_=v.object({id:v.string(),from:v.string(),to:v.string(),axis:yD,type:v.string(),timestamp:v.number().int().nonnegative(),attributes:v.record(v.string(),v.unknown()).optional()}),ED=v.enum(["mount","update"]),bD=v.discriminatedUnion("type",[v.object({type:v.literal("props"),changedKeys:v.array(v.string())}),v.object({type:v.literal("react-state"),hookIndex:v.number().int()}),v.object({type:v.literal("context"),contextName:v.string()}),v.object({type:v.literal("valtio-path"),path:v.string(),changedKeys:v.array(v.string())}),v.object({type:v.literal("parent-render"),parentRenderId:v.string()}),v.object({type:v.literal("hook-dep-changed"),hookInstanceId:v.string(),depsHashBefore:v.string(),depsHashAfter:v.string()}),v.object({type:v.literal("force"),reason:v.string()})]),a_=v.object({phase:ED,actualDurationMs:v.number().nonnegative(),baseDurationMs:v.number().nonnegative(),startTime:v.number().nonnegative(),commitTime:v.number().nonnegative(),why:v.array(bD)}),o_=v.object({hookInstanceId:v.string(),depsHash:v.string(),prevDepsHash:v.string().optional(),durationMs:v.number().nonnegative(),cleanupRan:v.boolean().optional()}),l_=v.object({storeId:v.string(),path:v.string(),changedKeys:v.array(v.string()),beforeHash:v.string(),afterHash:v.string(),preview:v.unknown().optional()}),d_=v.object({method:v.string(),route:v.string(),status:v.number().int().optional(),durationMs:v.number().nonnegative().optional(),traceparent:v.string().optional()}),wD=v.enum(["N+1","sequential-await","growing-allocation"]),c_=v.object({iterations:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),dbCallsInsideLoop:v.number().int().nonnegative(),redisCallsInsideLoop:v.number().int().nonnegative(),awaitedOperationsInsideLoop:v.number().int().nonnegative(),slowestIterations:v.array(v.object({index:v.number().int().nonnegative(),durationMs:v.number().nonnegative(),childNodeIds:v.array(v.string())})).optional(),patterns:v.array(wD).optional()}),DD=v.enum(["Map","Set","Array","EventEmitter","Queue","RxSubject","Timer","Interval","Custom"]),p_=v.object({ownerInstanceId:v.string(),containerKind:DD,fieldName:v.string(),itemCount:v.number().int().nonnegative(),estimatedBytes:v.number().nonnegative(),retainedBytes:v.number().nonnegative().optional(),growthSinceStart:v.number()}),$D=v.enum(["set","push","add","delete","clear","subscribe","listen","schedule"]),m_=v.object({ownerNodeId:v.string(),operation:$D,beforeCount:v.number().int().nonnegative(),afterCount:v.number().int().nonnegative(),estimatedDeltaBytes:v.number(),keyPreview:v.string().optional(),valueType:v.string().optional()}),V1=v.object({x:v.number(),y:v.number(),width:v.number().nonnegative(),height:v.number().nonnegative()}),BD=v.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]),xD=v.enum(["computed-style","layout","paint-order"]),f_=v.object({causedBy:BD,viewport:V1,layoutSnapshotId:v.string(),styleSnapshotId:v.string(),screenshotId:v.string().optional(),changedNodes:v.array(v.object({uid:v.string(),component:v.string().optional(),change:xD,property:v.string().optional(),before:v.unknown().optional(),after:v.unknown().optional()}))}),CD=v.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]),kD=v.enum(["always","after-animation","stable-only","during-animation"]),AD=v.enum(["info","warning","error"]),h_=v.object({ruleId:v.string(),ruleType:CD,severity:AD,timing:kD,element:v.object({uid:v.string(),component:v.string().optional(),rect:V1}),expected:v.record(v.string(),v.unknown()),actual:v.record(v.string(),v.unknown()),evidence:v.object({computedStyle:v.string().optional(),screenshotCrop:v.string().optional(),trace:v.string().optional(),cssCause:v.object({selector:v.string(),file:v.string().optional(),line:v.number().int().optional(),declaration:v.string().optional()}).optional()})}),ID=v.enum(["none","connected"]),_D=v.enum(["running","clean","failing","error"]),SD=v.object({id:v.string(),tool:v.string(),project:v.string().optional(),firstReportedAt:v.number().int().nonnegative(),lastReportedAt:v.number().int().nonnegative(),lastRunStatus:_D,lastRunDurationMs:v.number().int().nonnegative().optional(),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative().optional(),error:v.string().optional()}),Ln=v.object({producer:ID,producers:v.array(SD),lastReportedAt:v.number().int().nonnegative().optional(),ageMs:v.number().int().nonnegative().optional(),stale:v.boolean(),detail:v.string()}),J1=10*6e4;function Vn(e){let t=e.now??Date.now(),r=[...e.producers].sort((c,p)=>p.lastReportedAt-c.lastReportedAt);if(r.length===0)return{producer:"none",producers:[],stale:!1,detail:`No ${e.domain} producer has ever reported into this session \u2014 this is NOT a clean result, nothing is watching. ${e.noProducerHint}`};let i=r[0].lastReportedAt,u=Math.max(0,t-i),n=u>J1,a=r.filter(c=>c.lastRunStatus==="failing"),l=r.filter(c=>c.lastRunStatus==="error"),d=[`${r.length} ${e.domain} producer${r.length===1?"":"s"} reporting (${r.map(c=>c.id).join(", ")}); newest report ${W1(u)}.`];return l.length>0&&d.push(`${l.length} produced NO verdict (the tool itself failed): ${l.map(c=>`${c.id} \u2014 ${c.error??"unknown error"}`).join("; ")}.`),a.length>0&&d.push(`${a.length} reporting errors.`),n&&d.push(`Older than ${Math.round(J1/6e4)}m \u2014 the verdict may predate the current source.`),{producer:"connected",producers:r,lastReportedAt:i,ageMs:u,stale:n,detail:d.join(" ")}}s(Vn,"Yr"),o(Vn,"summariseProducers");function W1(e){return e<1e3?"just now":e<6e4?`${Math.round(e/1e3)}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(W1,"pE"),o(W1,"describeAge");var Eu=v.object({$schema:v.string().optional(),schemaVersion:v.literal(1),revision:v.number().int().nonnegative(),updatedAt:v.string().datetime().optional()}),FD=v.enum(["starting","clean","warning","failing"]),G1=v.object({source:v.string(),severity:hd,title:v.string(),fingerprint:v.string(),resource:v.string(),pageId:v.string().optional(),flowId:v.string().optional(),location:fd.optional(),rule:v.string().optional(),fix:v.string().optional(),verify:v.string().optional(),docs:v.string().optional()}),jD=v.object({typecheck:v.enum(["passed","failed","unknown"]).optional(),lint:v.enum(["passed","failed","unknown"]).optional(),build:v.enum(["passed","failed","unknown"]).optional(),runtime:v.enum(["passed","failed","warning","unknown"]).optional(),visual:v.enum(["passed","failed","warning","unknown"]).optional(),memory:v.enum(["passed","failed","warning","unknown"]).optional()}),zD=v.enum(["embedded","shared"]),ND=v.object({mode:zD,pid:v.number(),startedAt:v.string(),url:v.string().optional()}),g_=Eu.extend({sessionId:v.string(),status:FD,activeTab:v.string().optional(),tabsWithIssues:v.array(v.string()).optional(),blocking:v.array(G1),warnings:v.array(G1).default([]),suggestedReads:v.array(v.string()),checks:jD.optional(),server:ND.optional()}),MD=v.object({eventsResident:v.number().int().nonnegative(),eventsResidentBytes:v.number().int().nonnegative(),eventsIngested:v.number().int().nonnegative(),eventsDropped:v.number().int().nonnegative(),eventsDroppedForBytes:v.number().int().nonnegative().optional(),eventCap:v.number().int().nonnegative().optional(),eventByteCap:v.number().int().nonnegative().optional(),artifactsResident:v.number().int().nonnegative().optional(),artifactsResidentBytes:v.number().int().nonnegative().optional(),artifactsDropped:v.number().int().nonnegative().optional(),artifactByteCap:v.number().int().nonnegative().optional(),truncatedEvents:v.number().int().nonnegative().optional(),truncatedBytesReclaimed:v.number().int().nonnegative().optional(),rawByteLimit:v.number().int().nonnegative().optional(),reducers:v.record(v.string(),v.object({residentEvents:v.number().int().nonnegative(),residentBytes:v.number().int().nonnegative(),evictedEvents:v.number().int().nonnegative(),evictedForBytes:v.number().int().nonnegative(),eventCap:v.number().int().nonnegative(),byteCap:v.number().int().nonnegative()})).optional()}),v_=Eu.extend({sessionId:v.string(),supportedResources:v.array(v.string()),supportedTools:v.array(v.string()),supportedJobs:v.array(v.string()),supportedChannels:v.array(v.string()),subscribedByDefault:v.array(v.string()),transports:v.array(v.enum(["stdio","http","socket"])),host:v.object({platform:v.string(),node:v.string()}),project:v.object({name:v.string(),nxVersion:v.string().optional()}),storage:MD.optional()}),OD=v.object({id:v.string(),timestamp:v.number().int().nonnegative(),message:v.string(),fingerprint:v.string(),code:v.string().optional(),rule:v.string().optional(),severity:hd.optional(),file:v.string().optional(),line:v.number().int().nonnegative().optional(),column:v.number().int().nonnegative().optional(),project:v.string().optional()}),y_=Eu.merge(Ln).extend({status:v.enum(["unknown","clean","failing"]),errorCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),E_=Eu.merge(Ln).extend({errors:v.array(OD)}),b_=Eu.merge(Ln).extend({status:v.enum(["unknown","clean","warning","failing"]),errorCount:v.number().int().nonnegative(),warningCount:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),w_=Eu.merge(Ln).extend({status:v.enum(["unknown","clean","warning","failing"]),hmrUpdates:v.number().int().nonnegative(),lastRunAt:v.number().int().nonnegative().optional()}),Pr=Symbol.for("@lensmcp/session/Session"),Ur=Symbol.for("@lensmcp/core/EventBus"),RD=Symbol.for("@lensmcp/core/GraphStore"),Z=Symbol.for("@lensmcp/core/ResourceStore"),TD=Symbol.for("@lensmcp/storage/Storage"),PD="capture-request.json",UD="capture-runner.json",qD="capture-rules.json",gd="__lensmcpTruncation",ZD="__lensmcpTruncated";function Xe(e,t=Number.POSITIVE_INFINITY,r=12){return Ut(e,t,r,32)}s(Xe,"We"),o(Xe,"estimateJsonBytes");function vd(e,t,r=12){return Ut(e,t,r,Number.POSITIVE_INFINITY)>t}s(vd,"Zs"),o(vd,"exceedsJsonByteBudget");function Ut(e,t,r,i){switch(typeof e){case"undefined":case"function":case"symbol":return 0;case"boolean":return 5;case"number":return Number.isFinite(e)?8:4;case"bigint":return 20;case"string":return e.length+2;default:break}if(e===null)return 4;if(r<=0)return i;if(e instanceof Date)return 26;if(Array.isArray(e)){let a=2;for(let l=0;l<e.length;l++)if(a+=Ut(e[l],t-a,r-1,i)+1,a>t)return a;return a}let u=2,n=e;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let l=Ut(n[a],t-u,r-1,i);if(l!==0&&(u+=a.length+4+l,u>t))return u}return u}s(Ut,"en"),o(Ut,"walk");function Jn(e,t){e.truncatedAnything=!0,e.paths.length<20&&e.paths.push(t||"<root>")}s(Jn,"bm"),o(Jn,"record");function K1(e,t,r){return Jn(e,r),{[ZD]:!0,originalBytes:Xe(t,Number.POSITIVE_INFINITY,64)}}s(K1,"bE"),o(K1,"stub");function H1(e){if(e===null)return!0;let t=typeof e;return t==="number"||t==="boolean"||t==="string"||t==="bigint"}s(H1,"wE"),o(H1,"isScalar");function bu(e,t,r,i){if(typeof e=="string"){let u=t.budget<=0?256:t.maxStringBytes;if(e.length+2<=u)return t.budget-=e.length+2,e;let n=Math.max(0,u-64);return Jn(t,i),t.budget-=n,`${e.slice(0,n)}\u2026[lensmcp truncated: ${e.length-n} more chars]`}return e===null||typeof e!="object"?(t.budget-=Ut(e,Number.POSITIVE_INFINITY,1,32),e):r<=0?K1(t,e,i):e instanceof Date?(t.budget-=26,e):Array.isArray(e)?X1(e,t,r,i):Y1(e,t,r,i)}s(bu,"tn"),o(bu,"clampValue");function X1(e,t,r,i){let u=[],n=Math.min(e.length,t.maxArrayItems);for(let a=0;a<n&&!(t.budget<=0);a++)u.push(bu(e[a],t,r-1,`${i}[${a}]`));return u.length<e.length&&Jn(t,`${i}[] (+${e.length-u.length} items dropped)`),u}s(X1,"xE"),o(X1,"clampArray");function Y1(e,t,r,i){let u={},n,a=t.budget<=0;for(let l in e){if(!Object.prototype.hasOwnProperty.call(e,l))continue;let d=e[l],c=Ut(d,512,r-1,Number.POSITIVE_INFINITY);if(c<=512&&(!a||H1(d))){u[l]=d,t.budget-=l.length+4+c;continue}(n??=[]).push({key:l,bytes:c})}if(!n)return u;n.sort((l,d)=>l.bytes===d.bytes?0:l.bytes<d.bytes?-1:1);for(let{key:l}of n){let d=i?`${i}.${l}`:l;u[l]=bu(e[l],t,r-1,d)}return u}s(Y1,"$E"),o(Y1,"clampObject");function Q1(e,t={}){let r=t.rawByteLimit??32768,i=t.maxDepth??12;if(r<=0)return{value:void 0,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(e==null)return{value:e,truncated:!1,originalBytes:0,keptBytes:0,paths:[]};if(!vd(e,r,i)){let d=Xe(e,r,i),c={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1};return{value:bu(e,c,i,""),truncated:!1,originalBytes:d,keptBytes:d,paths:[]}}let u=Xe(e,Number.POSITIVE_INFINITY,64),n={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},a=bu(e,n,i,""),l=Xe(a,Number.POSITIVE_INFINITY,i);if(n.truncatedAnything&&a!==null&&typeof a=="object"&&!Array.isArray(a)){let d={truncated:!0,originalBytes:u,keptBytes:l,paths:n.paths};a[gd]=d}return{value:a,truncated:n.truncatedAnything,originalBytes:u,keptBytes:l,paths:n.paths}}s(Q1,"wm"),o(Q1,"boundedClone");function qt(e,t){if(e.size<=t)return 0;let r=0,i=e.keys();for(;e.size>t;){let u=i.next();if(u.done)break;e.delete(u.value)&&(r+=1)}return r}s(qt,"tt"),o(qt,"capMap");var qr=256,wu="error-dismissed",Wn="error-restored",e3="lens",LD=new Set(["dashboard","cli","agent"]);function yd(e){if(e.source!==e3||!e.raw||typeof e.raw!="object")return;let t=e.raw,r=t.groupId;if(typeof r!="string"||r.length===0||r.length>2048)return;if(t.kind===Wn)return{kind:Wn,groupId:r};if(t.kind!==wu)return;let i=t.until;if(typeof i!="number"||!Number.isFinite(i))return;let u=Array.isArray(t.eventIds)?t.eventIds.filter(c=>typeof c=="string"&&c.length>0).slice(0,200):[],n=LD.has(t.by)?t.by:void 0,a=o((c,p)=>typeof c=="string"&&c.trim()?c.trim().slice(0,p):void 0,"text"),l=a(t.reason,500),d=a(t.title,300);return{kind:wu,groupId:r,until:Math.min(i,e.timestamp),eventIds:u,...n?{by:n}:{},...l?{reason:l}:{},...d?{title:d}:{}}}s(yd,"qs"),o(yd,"readErrorDismissal");var VD=["pod-memory","pod-memory-retained","pod-memory-released","pod-memory-exited"];function Gn(e){if(!e||typeof e!="object")return;let t=e;if(VD.includes(t.kind)&&!(typeof t.project!="string"||!t.project)&&!(typeof t.pod!="number"||typeof t.pid!="number")&&!(t.kind==="pod-memory"&&(typeof t.live!="number"||!Number.isFinite(t.live)))&&!((t.kind==="pod-memory-retained"||t.kind==="pod-memory-released")&&typeof t.gen!="number"))return e}s(Gn,"nn"),o(Gn,"asPodMemoryRaw");var JD=["perf-rule-finding","perf-rule-retracted","perf-rule-scan"],Ed="https://github.com/kiwiapps-ltd/lensmcp/blob/main/docs/lensmcp/concepts/memory-and-build-cost.mdx",t3={"bundle/heavy-barrel-import":`${Ed}#bundleheavy-barrel-import`,"pod/heap-budget":`${Ed}#podheap-budget`,"pod/retained-generation":`${Ed}#podretained-generation`};function u3(e,t,r){return`perf-rule:${e}:${t}:${r}`}s(u3,"g$"),o(u3,"perfRuleFingerprint");var WD=/^[a-z][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/,GD=12,KD=4e3,vt=o((e,t=KD)=>typeof e=="string"&&e.length>0&&e.length<=t,"isText");function r3(e){if(!e||typeof e!="object")return;let t=e;if(!JD.includes(t.kind)||typeof t.rule!="string"||!WD.test(t.rule)||!vt(t.project,512))return;if(t.kind==="perf-rule-scan"){let i=t.open;return!Array.isArray(i)||i.length>256||!i.every(u=>vt(u,512))?void 0:e}if(!vt(t.subject,512))return;if(t.kind==="perf-rule-retracted")return e;if(t.severity!=="warning"&&t.severity!=="error"||!vt(t.title)||!vt(t.summary)||!vt(t.verify)||!vt(t.docs,1024))return;let r=t.fix;if(!(!Array.isArray(r)||r.length===0||r.length>GD||!r.every(i=>vt(i)))&&!(!t.evidence||typeof t.evidence!="object"||Array.isArray(t.evidence))&&!(!t.cost||typeof t.cost!="object"||Array.isArray(t.cost)))return e}s(r3,"v$"),o(r3,"asPerfRuleRaw");function bd(e){let{source:t,category:r,title:i,kind:u}=e;return t==="ai"?"ai":u?.startsWith("memory")||u==="db-query"?"data":t==="gateway"||u==="gateway-request"?"gateway":u==="queue-process"||u==="queue-active"||u==="queue-completed"||u==="queue-failed"?"services":t==="db"||t==="redis"||t==="queue"||u==="redis-op"||u?.startsWith("queue-")?"data":t==="external"||u==="egress"?"network":t==="nestjs"||t==="nest"?/(?:Repository|Repo|Dao|Store)\./.test(i)?"data":"services":t==="valtio"?"state":r==="network"?"network":"browser"}s(bd,"Sm"),o(bd,"areaOf");var i3=240,HD=new Set(["systemPrompt","prompt","prompts","messages","completion","completions","input","output","draft","text","content","result","arguments","params"]),XD=new Set(["tenantId","caller","userId","accountId","email","subject"]),YD=8;function n3(e){let t=Kn(e,0);return Q1(Zu({redacted:!0,...t}),{rawByteLimit:16*1024}).value}s(n3,"zE"),o(n3,"aiProjection");function Kn(e,t){if(typeof e=="string")return s3(e);if(e===null||typeof e!="object")return e;if(t>=YD)return;if(Array.isArray(e))return e.slice(0,32).map(i=>Kn(i,t+1));let r={};for(let[i,u]of Object.entries(e))if(!XD.has(i)){if(HD.has(i)){typeof u=="string"?r[`${i}Chars`]=u.length:Array.isArray(u)?r[`${i}Count`]=u.length:u!=null&&(r[`${i}Present`]=!0);continue}r[i]=Kn(u,t+1)}return r}s(Kn,"km"),o(Kn,"projectAi");function s3(e){return e.length<=i3?dt(e):`${dt(e.slice(0,i3))}\u2026`}s(s3,"OE"),o(s3,"clipText");function a3(e,t={}){let r=e.raw??{},i=r.render??{},u=r.span??{},n=r.request??{},a=o(y=>typeof y=="number"?y:void 0,"num"),l=r.loop??{},d=r.effect??{},c=a(r.durationMs)??a(u.durationMs)??a(n.durationMs)??a(l.durationMs)??a(i.actualDurationMs)??a(d.durationMs),p=typeof r.kind=="string"?r.kind:void 0,m=p==="fetch-done"||p==="fetch-error",f=a(i.commitTime),h=p==="render"&&f!==void 0&&Math.abs(f-e.timestamp)<6e4,g=m?e.timestamp:h?f:a(r.startedAt)??a(u.startTime)??a(n.startedAt)??a(l.startedAt)??(c!==void 0?e.timestamp-c:e.timestamp),b;if(typeof r.query=="string"){let y=Array.isArray(r.params)?` [${r.params.join(", ")}]`:"",D=typeof r.result=="string"?` \u2192 ${r.result}`:"";b=r.query+y+D}else if(typeof r.command=="string"){let y=typeof r.value=="string"?` \u2192 ${r.value}`:r.hit===!1?" \u2192 (miss)":"";b=r.command+y}else if(p==="state-update"){let y=r.update??{},D="";try{D=JSON.stringify(y.preview)}catch{}b=`${y.storeId??""}.${y.path??""} = ${D}`}else p==="queue-completed"&&typeof r.returned=="string"?b=`returned ${r.returned}`:p==="queue-enqueued"&&(b=`${r.job??"job"}#${r.jobId??"?"} \u2192 ${r.queue??""}${typeof r.data=="string"?" "+r.data:""}`);let x;if(p==="gateway-request")x=`${r.host??""}${String(r.url??"").split("?")[0]}`;else if(p==="fetch-start"||p==="fetch-done"||p==="fetch-error")try{let y=new URL(String(r.href??r.url??""));x=`${y.hostname}${y.pathname}`}catch{}let $;if(p==="gateway-request"&&Array.isArray(r.steps))$=r.steps.map(y=>{let D=[String(y.step)];return y.project&&D.push(String(y.project)),y.prefix&&D.push(String(y.prefix)),y.mode&&D.push(String(y.mode)+(y.ok===!1?" \u2717":y.ok===!0?" \u2713":"")),y.caller&&D.push("by "+String(y.caller)),y.pod&&D.push(String(y.pod)),typeof y.atMs=="number"&&D.push(`@${y.atMs}ms`),D.join(" ")}),b=$.map(y=>y.replace(/ @\d+ms$/,"")).join(" \u2192 ");else if(p==="egress")b=`${r.method??"GET"} ${r.host??""} \u2192 ${r.status??"?"}`;else if(e.source==="ai"){if(p==="ai-call"){let y=r.usage??{},D=y.promptTokens!==void 0||y.completionTokens!==void 0?` \xB7 ${a(y.promptTokens)??"?"}\u2192${a(y.completionTokens)??"?"} tok`:"",A=r.status!==void 0?` \xB7 ${String(r.status)}`:r.error?" \xB7 failed":"",j=a(r.toolCallCount)?` \xB7 ${a(r.toolCallCount)} tool call${a(r.toolCallCount)===1?"":"s"}`:"",N=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${r.provider??""}/${r.model??"?"}${D}${A}${j}${N}${r.stream===!0?" \xB7 stream":""}`}else if(p==="ai-round"){let y=r.model??{},D=r.usage??{},A=Array.isArray(r.toolCalls)?r.toolCalls:[],j=`${a(D.promptTokens)??"?"}\u2192${a(D.completionTokens)??"?"} tok`,N=A.length?` \xB7 ${A.length} tool call${A.length===1?"":"s"}`:"",K=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${y.provider??""}/${y.model??""} \xB7 ${j}${N}${K}`}else if(p==="ai-turn-start"){let y=Array.isArray(r.tools)?r.tools:[];b=`skill ${r.skill??""} \xB7 ${r.output??""}${y.length?" \xB7 tools: "+y.join(", "):""}`}else if(p==="ai-tool-call"){let y=r.call??{},D=r.result??{},A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${y.name??"tool"} ${D.error!=null?"\u2717 "+String(D.error):"\u2713"}${A}`}else if(p==="ai-turn-end"){let y=r.usage??{},D=a(r.rounds)!==void 0?` \xB7 ${a(r.rounds)} round${a(r.rounds)===1?"":"s"}`:"",A=a(r.durationMs)!==void 0?` \xB7 ${(a(r.durationMs)/1e3).toFixed(1)}s`:"";b=`${r.ok===!1?"FAILED":"ok"} \xB7 ${a(y.promptTokens)??"?"}+${a(y.completionTokens)??"?"} tok${D}${A}`}}let w;p==="db-query"&&typeof r.query=="string"?w=r.query:p==="redis-op"?w=`${r.op??""} ${String(r.key??"").replace(/\d+/g,"#")}`:p==="egress"?w=`${r.method??"GET"} ${r.host??""}`:p==="ai-call"?w=`ai ${r.provider??""} ${r.model??""} ${r.api??""}`:p==="queue-enqueued"?w=`enqueue ${r.queue??""}`:p==="span"&&typeof u.name=="string"?w=u.name:p==="memory-mutation"&&(w=e.title);let k=e.context??{},C=i.commitId??d.commitId??r.commitId,M=Array.isArray(i.why)?i.why.map(y=>typeof y?.type=="string"?y.type:void 0).filter(y=>!!y):[];return{id:e.id,t:e.timestamp,start:g,...w?{sig:w}:{},...x?{urlKey:x}:{},...typeof r.queue=="string"?{queue:r.queue}:{},...r.jobId!=null?{jobId:String(r.jobId)}:{},source:e.source,category:e.category,severity:e.severity,title:e.title,kind:p,area:bd({source:e.source,category:e.category,title:e.title,kind:p}),...typeof u.role=="string"?{role:u.role}:{},...typeof k.requestId=="string"?{requestId:k.requestId}:{},...typeof k.parentRequestId=="string"?{parentRequestId:k.parentRequestId}:{},...typeof C=="string"?{commitId:C}:{},...typeof i.componentName=="string"?{component:i.componentName}:{},...typeof i.phase=="string"?{phase:i.phase}:{},...M.length?{why:M}:{},...p==="effect-run"&&typeof d.hookLogicalId=="string"?{hook:d.hookLogicalId}:{},...p==="effect-run"&&d.cleanupRan===!0?{cleanup:!0}:{},...p==="render-commit-truncated"?{renderTotal:a(r.total),renderPublished:a(r.published)}:{},...typeof k.projectName=="string"?{project:k.projectName}:typeof r.project=="string"?{project:r.project}:{},...c!==void 0?{durationMs:c}:{},...m&&a(r.startedAt)!==void 0?{fetchStartedAt:a(r.startedAt)}:{},...e.source==="ai"?{ai:t.includeRaw?r:n3(r)}:{},...b?{detail:b}:{},...$?{steps:$}:{}}}s(a3,"ME"),o(a3,"trimFlowEvent");var o3=1;function l3(e){return e==="flow-origin"?0:e?.endsWith("-start")?1:e==="gateway-request"?2:e==="server-request"?3:e==="span"?4:e==="render"||e==="render-commit-truncated"?6:e==="effect-run"?7:5}s(l3,"NE"),o(l3,"kindRank");function Du(e){return e.kind==="span"&&e.role==="controller"?3.5:e.kind==="queue-process"?3:l3(e.kind)}s(Du,"uo"),o(Du,"causalRank");function Hn(e,t={}){let r=xi(e),i=e.slice().filter(E=>{let _=E.raw??{},I=typeof _.kind=="string"?_.kind:"";if(I==="subscription-added"||I==="subscription-removed"||I==="hook-run"||I==="store-created"||I==="singleton-instance"||I===da)return!1;let S=_.span;return!(typeof S?.name=="string"&&S.name.startsWith("nest.request "))}).map(E=>a3(E,t)),u=new Set;for(let E=i.length-1;E>=0;E--)u.has(i[E].id)?i.splice(E,1):u.add(i[E].id);let n=new Map;for(let E of i)(E.kind==="gateway-request"||E.kind==="queue-process")&&E.requestId&&!n.has(E.requestId)&&n.set(E.requestId,E.start);let a=o(E=>E.source!=="react"&&E.source!=="valtio"&&E.requestId&&n.has(E.requestId)?n.get(E.requestId):E.start,"anchorOf");i.sort((E,_)=>a(E)-a(_)||E.start-_.start||Du(E)-Du(_)||(_.durationMs??0)-(E.durationMs??0)||E.t-_.t);let l=o(E=>(E.kind==="span"||E.kind==="server-request"||E.kind==="gateway-request"||E.kind==="queue-process")&&(E.durationMs??0)>0,"spanLike"),d=i;for(let E of d)E.group=E.source==="react"||E.source==="valtio"||E.source==="client-runtime"||E.source==="visual"?"browser":"server";let c=new Map;for(let E of d)if((E.kind==="gateway-request"||E.kind==="queue-process")&&E.requestId&&E.project){let _=c.get(E.requestId)??[];_.push({project:E.project,start:E.start,end:E.start+(E.durationMs??0)}),c.set(E.requestId,_)}let p=o((E,_)=>{let I=c.get(E);if(I?.length)return I.every(S=>S.project===I[0].project)?I[0].project:I.filter(S=>S.start<=_+1&&S.end>=_-1).sort((S,U)=>U.start-S.start)[0]?.project},"projectOf");for(let E of d)if(!E.project&&E.source==="nestjs"&&E.requestId){let _=p(E.requestId,E.start);_&&(E.project=_)}for(let E of d){let _,I=E.requestId;for(let S of d){if(S===E||!l(S)||S.group!==E.group||S.requestId!==I)continue;let U=S.project,W=E.project;if(S.kind!=="gateway-request"&&E.kind!=="gateway-request"&&U!==void 0&&W!==void 0&&U!==W)continue;let ue=S.durationMs??0,re=E.durationMs??0,L=Math.abs(S.start-E.start)<=o3,V=Du(S),Y=Du(E),ne=S.start<=E.start;if(!(S.start+ue>E.start&&(ne||L&&V<Y)&&(!L||(V!==Y?V<Y:ne&&ue>re))))continue;let Ee=_?Du(_):-1,me=_?Math.abs(S.start-_.start)<=o3:!1;(!_||!me&&S.start>_.start||me&&V>Ee||me&&V===Ee&&(S.durationMs??0)<(_.durationMs??0))&&(_=S)}_&&(E.parent=_.id)}let m=new Map;for(let E of d){if(!E.requestId)continue;let _=m.get(E.requestId);_?_.push(E):m.set(E.requestId,[E])}let f=new Map(d.map(E=>[E.id,E])),h=o((E,_)=>{let I=(m.get(E)??[]).filter(S=>l(S)&&S.start<=_&&S.start+(S.durationMs??0)>=_);if(I.length!==0)return I.sort((S,U)=>U.start-S.start||(S.durationMs??0)-(U.durationMs??0)),I[0]},"callerNodeFor");for(let E of d){if(!E.parentRequestId||E.kind!=="server-request"&&E.kind!=="gateway-request")continue;let _=E.parent?f.get(E.parent):void 0;if(_&&_.requestId===E.requestId)continue;let I=h(E.parentRequestId,E.start);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}let g=d,b=new Map;for(let E of g)E.kind==="gateway-request"&&E.requestId&&!b.has(E.requestId)&&b.set(E.requestId,E);for(let E of g)if(E.group==="server"&&!E.parent&&E.requestId&&E.kind!=="gateway-request"){let _=b.get(E.requestId);_&&_!==E&&_.start<=E.start&&(E.parent=_.id)}let x=new Set,$=new Set,w=[];for(let E of g){if(E.kind!=="gateway-request")continue;if(!E.requestId){w.push(E);continue}let _=m.get(E.requestId)??[];if(_.filter(U=>U.kind==="gateway-request").sort((U,W)=>U.start-W.start)[0]!==E)continue;let I=_.find(U=>U.kind==="fetch-start"),S=_.find(U=>U.kind==="fetch-done"||U.kind==="fetch-error");if(!I&&!S){w.push(E);continue}I&&(E.fetchStartId=I.id,x.add(I.id)),S&&(E.fetchDoneId=S.id,$.add(S.id))}let k=new Map;for(let E of g){if(!E.urlKey)continue;let _=k.get(E.urlKey)??{gws:[],starts:[],dones:[]};E.kind==="gateway-request"?w.includes(E)&&_.gws.push(E):E.kind==="fetch-start"?x.has(E.id)||_.starts.push(E):(E.kind==="fetch-done"||E.kind==="fetch-error")&&($.has(E.id)||_.dones.push(E)),k.set(E.urlKey,_)}for(let{gws:E,starts:_,dones:I}of k.values()){E.sort((U,W)=>U.start-W.start),_.sort((U,W)=>U.start-W.start);let S=new Set;E.forEach((U,W)=>{let ue=_[W];ue&&(U.fetchStartId=ue.id);let re=ue?ue.t:U.start,L,V=1/0;for(let Y of I){if(S.has(Y.id))continue;let ne=Y.fetchStartedAt??Y.start-(Y.durationMs??0),Ee=Math.abs(ne-re);Ee<V&&(V=Ee,L=Y)}L&&(U.fetchDoneId=L.id,S.add(L.id))})}let C=new Map,M=new Map;for(let E of g)!E.queue||!E.jobId||(E.kind==="queue-enqueued"&&C.set(`${E.queue}#${E.jobId}`,E),E.kind==="queue-process"&&M.set(`${E.queue}#${E.jobId}`,E));for(let E of g){if(!E.queue||!E.jobId)continue;let _=`${E.queue}#${E.jobId}`;if(E.kind==="queue-process"&&!E.parent){let I=C.get(_);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}else if(E.kind==="queue-active"||E.kind==="queue-completed"||E.kind==="queue-failed"){let I=M.get(_);I&&I!==E&&I.start<=E.start&&(E.parent=I.id)}}let y=d;{let E=new Map;for(let I of y)I.kind==="fetch-start"&&E.set(I.id,I);let _=new Map;for(let I of y){if(I.kind!=="fetch-done"&&I.kind!=="fetch-error")continue;let S=[...E.values()].find(ue=>ue.requestId&&ue.requestId===I.requestId)?.id,U=S?E.get(S):void 0;if(!U)continue;let W=I.fetchStartedAt??U.start;U.title=I.title,U.severity=I.severity,U.durationMs=I.durationMs??Math.max(0,I.t-W),U.kind="fetch",I.detail&&!U.detail&&(U.detail=I.detail),_.set(I.id,U.id)}if(_.size>0){y=y.filter(I=>!_.has(I.id));for(let I of y)for(I.fetchDoneId&&_.has(I.fetchDoneId)&&(I.fetchDoneId=_.get(I.fetchDoneId));I.parent&&_.has(I.parent);)I.parent=_.get(I.parent)}}let D=o(E=>!!E.commitId&&(E.kind==="render"||E.kind==="effect-run"||E.kind==="render-commit-truncated"),"commitMember"),A=o(E=>[...new Set(E)],"uniq"),j=o(E=>A(E.map(_=>_.component).filter(_=>!!_)),"named"),N=o(E=>E.length<=2?E.join(" + "):`${E[0]} + ${E.length-1} more`,"nameList"),K=o(E=>{let _=new Map;for(let I of E)I.component&&_.set(I.component,(_.get(I.component)??0)+1);return[..._].map(([I,S])=>S>1?`${I} \xD7${S}`:I).join(", ")},"tally"),H=o(E=>{if(!E)return"effect";let _=/([^/\\]+?):(\d+)(?::\d+)?$/.exec(E);return _?`${_[1]}:${_[2]}`:E},"shortHook"),ye=o(E=>`${H(E.hook)}${E.cleanup?" (cleanup)":""}`,"hookLabel"),Ze=o(E=>{let _=Math.min(...E.map(S=>S.start)),I=Math.max(...E.map(S=>S.start+(S.durationMs??0)));return{start:_,durationMs:I-_}},"extent"),Je=o(E=>(delete E.component,delete E.why,delete E.phase,delete E.hook,delete E.cleanup,delete E.renderTotal,delete E.renderPublished,E),"asGroup");function It(E){let _=E[0],I=E.filter(he=>he.kind==="render"),S=E.filter(he=>he.kind==="effect-run"),U=E.find(he=>he.kind==="render-commit-truncated"),W=[...I].sort((he,qu)=>(qu.durationMs??0)-(he.durationMs??0)),ue=W.filter(he=>(he.why??[]).some(qu=>qu!=="parent-render")),re=A(ue.flatMap(he=>(he.why??[]).filter(qu=>qu!=="parent-render"))),L=j(ue),V=I.filter(he=>he.phase==="mount"),Y=I.filter(he=>he.phase!=="mount"&&!ue.includes(he)),ne=W[0]?.component??"view",Ee=I.length>0&&V.length===I.length,me=re.length?re.join(" + "):void 0,_t=Ee?"mount":"update",St=L.length?`view update \xB7 ${N(L)} \u2190 ${me}`:Ee?`view mount \xB7 ${ne}`:`view update \xB7 ${ne}`,Um=U?.renderTotal??I.length,s5=[V.length?`mounted ${K(V)}`:"",Y.length?`re-rendered ${K(Y)}`:"",!L.length&&!Ee&&I.length?"trigger not recorded \u2014 every captured render came from its parent":"",U?`${Um} renders, ${U.renderPublished??I.length} recorded (per-commit cap)`:`${I.length} render${I.length===1?"":"s"}`,S.length?`${S.length} effect${S.length===1?"":"s"}: ${S.map(ye).join(", ")}`:""].filter(Boolean).join(" \xB7 "),qm=j(I);return Je({..._,...Ze(E),kind:"view-update",title:St,detail:s5,commitId:_.commitId,viewPhase:_t,...me?{cause:me}:{},causeComponents:L,components:qm,mounted:j(V),renderCount:Um,recordedRenders:I.length,effects:S.length,effectHooks:S.map(ye),memberIds:E.map(he=>he.id),sig:`commit:${_t}:${me??"-"}:${L.join(",")}:${qm.slice().sort().join(",")}`,severity:E.some(he=>he.severity==="error")?"error":_.severity})}s(It,"pr"),o(It,"viewUpdateNode");function tt(E){let _=E[0],I=E.map(ye);return Je({..._,...Ze(E),kind:"commit-effects",title:E.length===1?`effect \xB7 ${I[0]}`:`effects \xB7 ${I[0]} + ${E.length-1} more`,detail:I.join(", "),commitId:_.commitId,effects:E.length,effectHooks:I,memberIds:E.map(S=>S.id),sig:`effects:${I.slice().sort().join(",")}`})}s(tt,"_t"),o(tt,"effectsNode");let $i=o(E=>A(E.map(_=>_==="state-update"?"state update":_==="fetch-start"?"request":_==="flow-origin"?"interaction":"response")).join(" + "),"describeInputs");function Uu(E,_){let I=E[0],S=E[E.length-1],U=E.length,W=I.detail,ue=Math.min(...E.map(Y=>Y.start)),re=Math.max(...E.map(Y=>Y.start+(Y.durationMs??0))),L=Math.round(E.reduce((Y,ne)=>Y+(ne.durationMs??0),0)/U*10)/10,V=Math.round((re-ue)*10)/10;I.count=U,I.avgMs=L,I.wallMs=V,I.durationMs=re-ue,I.items=E.slice(0,12).map(Y=>({start:Y.start-ue,...Y.durationMs!=null?{durationMs:Y.durationMs}:{}})),I.memberIds=E.flatMap(Y=>Y.memberIds??[Y.id]),I.title=`\xD7${U} ${I.title}`,E.some(Y=>Y.severity==="error")&&(I.severity="error"),I.kind==="view-update"?I.detail=[`${U} commits, ${_.length?`one per ${$i(_)}`:"back to back"}`,`avg ${L}ms \xB7 wall ${V}ms`,W??""].filter(Boolean).join(" \xB7 "):I.kind==="state-update"&&W&&S.detail?I.detail=`${U} updates in a row \xB7 wall ${V}ms \xB7 first ${W} \xB7 last ${S.detail}`:I.detail=[`${U} in a row \xB7 wall ${V}ms`,W??""].filter(Boolean).join(" \xB7 ")}s(Uu,"ei"),o(Uu,"collapseRepeat");let Oe=[],Bi=new Map,Tm=new Set;for(let E=0;E<y.length;E++){if(Tm.has(E))continue;let _=y[E];if(!D(_)){Oe.push(_);continue}let I=[E];for(let W=E+1;W<y.length;W++){let ue=y[W];if(ue.group==="browser"){if(!D(ue)||ue.commitId!==_.commitId)break;I.push(W)}}for(let W of I)Tm.add(W);let S=I.map(W=>y[W]),U=S.some(W=>W.kind!=="effect-run")?It(S):tt(S);for(let W of S)W.id!==U.id&&Bi.set(W.id,U.id);Oe.push(U)}if(Bi.size>0||Oe.some(E=>E.kind==="view-update"||E.kind==="commit-effects")){y=Oe;for(let E of y)for(;E.parent&&Bi.has(E.parent);)E.parent=Bi.get(E.parent)}{let E=new Map;for(let _ of y)_.kind==="view-update"&&_.commitId&&!E.has(_.commitId)&&E.set(_.commitId,_);for(let _ of y){if(_.kind!=="commit-effects"||_.parent||!_.commitId)continue;let I=E.get(_.commitId);I&&I.start<=_.start&&(_.parent=I.id)}}{let E=new Set(["state-update","fetch","fetch-start","fetch-done","fetch-error","flow-origin"]),_=y.map((L,V)=>L.group==="browser"?V:-1).filter(L=>L>=0),I=o(L=>`${L.kind}|${L.sig??L.title}`,"keyOf"),S=_.map(L=>I(y[L])),U=o((L,V,Y)=>{for(let ne=0;ne<Y;ne++)if(S[L+ne]!==S[V+ne])return!1;return!0},"sameBlock"),W=o(L=>S[L].split("|")[0],"kindAt"),ue=o(L=>{let V=0,Y=1;for(let ne=1;ne<=4&&L+ne<=S.length;ne++){let Ee=1;for(;L+(Ee+1)*ne<=S.length&&U(L,L+Ee*ne,ne);)Ee+=1;Ee>=3&&ne*Ee>V*Y&&(V=ne,Y=Ee)}return{k:V,r:Y}},"bestBlockAt"),re=new Map;for(let L=0;L<S.length;){let{k:V,r:Y}=ue(L);if(V===0){L+=1;continue}let ne=[...Array(V).keys()].find(me=>E.has(W(L+me)));if(ne!==void 0&&ne>0){let me=ue(L+ne);if(me.k===V&&me.r>=3&&me.r>=Y-1){L+=ne;continue}}let Ee=S.slice(L,L+V).map(me=>me.split("|")[0]).filter(me=>E.has(me));for(let me=0;me<V;me++){let _t=[];for(let St=0;St<Y;St++)_t.push(y[_[L+me+St*V]]);Uu(_t,Ee);for(let St of _t.slice(1))re.set(St.id,_t[0].id)}L+=V*Y}if(re.size>0){y=y.filter(L=>!re.has(L.id));for(let L of y)for(;L.parent&&re.has(L.parent);)L.parent=re.get(L.parent)}}{let E=new Map(y.map(_=>[_.id,_]));for(let _ of y){let I=new Set([_.id]),S=_;for(;S?.parent;){if(I.has(S.parent)){S.parent=void 0;break}I.add(S.parent),S=E.get(S.parent)}}}let Pm=o(E=>{let _=new Map;for(let S of y){if(!S.sig||l(S)!==E||S.kind==="server-request"||S.kind==="gateway-request"||S.group==="browser")continue;let U=`${S.parent??"root"}|${S.kind}|${S.sig}`,W=_.get(U);W?W.push(S):_.set(U,[S])}let I=new Map;for(let S of _.values()){if(S.length<3)continue;S.sort((V,Y)=>V.start-Y.start);let U=S[0],W=!1;for(let V=0;V+1<S.length;V++)if(S[V+1].start<S[V].start+(S[V].durationMs??0)){W=!0;break}let ue=U.start,re=Math.max(...S.map(V=>V.start+(V.durationMs??0))),L=S.reduce((V,Y)=>V+(Y.durationMs??0),0);U.count=S.length,U.parallel=W,U.avgMs=Math.round(L/S.length*10)/10,U.wallMs=re-ue,U.durationMs=re-ue,U.title=`\xD7${S.length} ${U.title.replace(/\s*\((?:\d+ rows?, )?\d+ms\)$/,"")}`,U.detail=`${U.sig} \xD7${S.length} ${W?"\u2016 parallel":"\u21BB sequential loop"} \xB7 avg ${U.avgMs}ms \xB7 wall ${U.wallMs}ms`,U.items=S.slice(0,12).map(V=>({start:V.start-ue,...V.durationMs!=null?{durationMs:V.durationMs}:{}})),U.memberIds=S.flatMap(V=>V.memberIds??[V.id]),S.some(V=>V.severity==="error")&&(U.severity="error");for(let V of S.slice(1))I.set(V.id,U.id)}if(I.size!==0){y=y.filter(S=>!I.has(S.id));for(let S of y)for(;S.parent&&I.has(S.parent);)S.parent=I.get(S.parent)}},"aggregatePass");Pm(!0),Pm(!1);for(let E of y){if(!l(E))continue;let _=E.durationMs??0;if(_<40)continue;let I=y.filter(re=>re.parent===E.id&&(re.durationMs??0)>0).map(re=>[re.start,re.start+(re.durationMs??0)]).sort((re,L)=>re[0]-L[0]),S=0,U=-1,W=-1;for(let[re,L]of I)re>W?(W>U&&(S+=W-U),U=re,W=L):L>W&&(W=L);W>U&&(S+=W-U);let ue=Math.max(0,_-S);(ue>=50||ue/_>=.7&&_>=40)&&(E.selfMs=ue,E.detail=`\u26A0 cpu-heavy: ${ue}ms self-time of ${_}ms${E.detail?" \xB7 "+E.detail:""}`)}return{events:y,...r?{sql:r}:{}}}s(Hn,"lo"),o(Hn,"buildFlowDetail");var Xn=["user-action","page-load","navigation","api","ai","background","test","system","other"],Yn=new Map;function $u(e,t){let r=Yn.get(e);return r||(r=new RegExp(`^${e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")}$`),Yn.size>500&&Yn.clear(),Yn.set(e,r)),r.test(t)}s($u,"po"),o($u,"globMatch");var QD=o(e=>/^[A-Z]+ /.test(e),"hasMethod");function d3(e,t){return t.some(r=>r.route?QD(e)?$u(e,`${r.method??"GET"} ${r.route}`):$u(e,r.route):!1)}s(d3,"DE"),o(d3,"routeMatches");function wd(e,t){return!([e.flowId,e.originType,e.origin,e.route,e.project].filter(r=>r!==void 0).length===0||e.flowId!==void 0&&!$u(e.flowId,t.flowId)||e.originType!==void 0&&e.originType!==t.origin.type||e.origin!==void 0&&!(t.origin.nodeId!==void 0&&$u(e.origin,t.origin.nodeId))||e.route!==void 0&&!d3(e.route,t.segments)||e.project!==void 0&&!t.segments.some(r=>r.projects.some(i=>$u(e.project,i))))}s(wd,"w$"),o(wd,"ruleMatches");var Dd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj"),yt=o(e=>typeof e=="string"&&e!==""?e:void 0,"str"),Qn=o(e=>Dd(e.raw)?yt(e.raw.kind)??"":"","kindOf");function c3(e){let t=[...e].sort((l,d)=>(Number(l.timestamp)||0)-(Number(d.timestamp)||0)||(l.id<d.id?-1:1)),r=t.find(l=>Qn(l)==="flow-origin"),i=r??t.find(l=>yt(l.context?.originType));if(!i)return{};let u=Dd(i.raw)?i.raw:{},n=yt(i.context?.originType)??(r?yt(i.title):void 0),a=yt(u.originNodeId)??yt(i.context?.originNodeId);return{...n?{type:n}:{},...a?{nodeId:a}:{}}}s(c3,"CE"),o(c3,"originOf");var e$=/^(verify|e2e|test|smoke|load)[-_:]/i,t$=o((e,t)=>e$.test(e)||t!==void 0&&/^(ui:)?(tools|scripts?|e2e)\//.test(t),"isTestFlow"),p3={"page-load":"page-load","user-click":"user-action","form-submit":"user-action","input-change":"user-action","double-click":"user-action","context-menu":"user-action","key-press":"user-action","route-load":"navigation","route-change":"navigation",navigation:"navigation","ai-turn":"ai",timer:"background",cron:"background",interval:"background",queue:"background",job:"background","websocket-message":"background","hmr-update":"system"},u$=new Set(["page-load","user-action","navigation"]),r$=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function es(e){return e.replace(/[?#].*$/,"").split("/").map(t=>r$.test(t)||/^[0-9a-f]{16,}$/i.test(t)||/^\d{2,}$/.test(t)?":id":t).join("/")}s(es,"Im"),o(es,"templatePath");function m3(e){let t=/^ui:(?:.*\/)?([^/:]+?)(?:\.[a-z]+)?:\d+:([A-Za-z]+)$/.exec(e);return t?`${t[1]} \xB7 ${t[2]}`:e}s(m3,"ZE"),o(m3,"componentOf");function f3(e){let t=e.replace(/[-_:][0-9a-f]{6,}(?:-[0-9a-f]+)*$/i,"");return t=t.replace(/[-_:](?=[a-z0-9]*\d)[a-z0-9]{6,}$/i,""),t=t.replace(/[-_:]\d+$/,""),t||e}s(f3,"qE"),o(f3,"scriptFamily");function h3(e,t,r,i){let u=t.nodeId,n=u?/^(page|route|ambient):(.*)$/.exec(u):null;if(n)return`${n[1]}:${es(n[2])}`;if(t.type&&p3[t.type]==="user-action"&&u)return m3(u);if(e==="test")return f3(r.flowId);let a=r.segments.find(d=>d.kind==="request"&&d.route);if(a?.route)return`${a.method??"GET"} ${es(a.route)}`;let l=i.find(d=>Qn(d)==="ai-call");return l&&Dd(l.raw)?`ai \xB7 ${yt(l.raw.model)??yt(l.raw.provider)??"call"}`:u?es(u):void 0}s(h3,"VE"),o(h3,"subjectOf");var i$=10,n$=1e3,s$=3,a$=500,o$=1e3;function g3(e,t){let r=new Set,i=t.segments.filter(n=>n.kind==="request");t.segments.some(n=>n.counts.errors>0)&&r.add("has-error"),i.some(n=>n.durationMs>=n$)&&r.add("slow"),i.length>=i$&&r.add("fan-out"),new Set(t.segments.flatMap(n=>n.projects)).size>=3&&r.add("multi-service"),e.some(n=>Qn(n)==="queue-enqueued")&&r.add("queue"),e.some(n=>Qn(n)==="ai-call"||n.source==="ai")&&r.add("ai"),t.stats.bookkeeping>=a$&&t.stats.bookkeeping*2>=t.stats.events&&r.add("storm"),t.stats.events>=o$&&r.add("large");let u=new Map;for(let n of i)(!n.part||n.part.index===1)&&u.set(n.label,(u.get(n.label)??0)+1);return[...u.values()].some(n=>n>=s$)&&r.add("repeated-requests"),[...r].sort()}s(g3,"HE"),o(g3,"tagsOf");function v3(e,t,r=[]){let i=c3(e),u={flowId:t.flowId,origin:i,segments:t.segments},n=g3(e,t),a=o((p,m,f)=>{let h=h3(p,i,t,e);return{category:p,decidedBy:m,...f!==void 0?{ruleIndex:f}:{},tags:n,origin:i,...h?{subject:h}:{}}},"done"),l=r.findIndex(p=>p.category&&wd(p,u));if(l!==-1)return a(r[l].category,"rule",l);if(t$(t.flowId,i.nodeId))return a("test","test");let d=i.type?p3[i.type]:void 0;if(d)return a(d,"origin");if(n.includes("ai"))return a("ai","shape");let c=t.segments.filter(p=>p.kind==="request");return c.length>0?a(c.every(p=>p.requestId?.startsWith("job:"))?"background":"api","shape"):t.segments.length>0&&t.segments.every(p=>p.kind==="ambient")?a("system","shape"):a("other","shape")}s(v3,"$$"),o(v3,"classifyFlow");function y3(e,t,r=[]){let i=r.find(u=>u.category&&(u.route!==void 0||u.project!==void 0)&&u.flowId===void 0&&u.origin===void 0&&u.originType===void 0&&wd(u,{flowId:e.flowId,origin:t.origin,segments:[e]}));return i?i.category:e.kind==="request"?e.requestId?.startsWith("job:")?"background":"api":e.kind==="ambient"?"system":e.kind==="origin"&&u$.has(t.category)?t.category:"ui"}s(y3,"_$"),o(y3,"categoryOfSegment");function E3(e){return b3(e).map(t=>{let r=new Map;for(let u of t.items){let n=r.get(u.subject);n?n.push(u):r.set(u.subject,[u])}let i=[...r.entries()].sort((u,n)=>(u[0]===void 0?1:0)-(n[0]===void 0?1:0)||n[1].length-u[1].length||String(u[0]).localeCompare(String(n[0]))).map(([u,n])=>({subject:u,count:n.length,items:n}));return{...t,subjects:i}})}s(E3,"k$"),o(E3,"groupFlows");function b3(e){let t=new Map;for(let i of e){let u=t.get(i.category);u?u.push(i):t.set(i.category,[i])}let r=o(i=>{let u=Xn.indexOf(i);return u===-1?Xn.length:u},"rank");return[...t.entries()].sort((i,u)=>r(i[0])-r(u[0])||(i[0]<u[0]?-1:i[0]>u[0]?1:0)).map(([i,u])=>({category:i,count:u.length,items:u}))}s(b3,"YE"),o(b3,"groupByCategory");var Et={categories:[],segments:{},problems:[]},$d=200,w3=200,D3=64,l$=/^[A-Za-z0-9][A-Za-z0-9 ._:/-]*$/,d$=["category","flowId","originType","origin","route","project"],c$={phaseGapMs:[50,6e5],burstGapMs:[10,6e4],attachWindowMs:[0,6e4],maxSegmentEvents:[20,1e4],occurrenceSlackMs:[0,1e3]},Bd=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isObj");function $3(e,t){if(!Bd(e))return{problems:[`${t}: not an object`]};let r=[];for(let l of Object.keys(e))d$.includes(l)||r.push(`${t}: unknown field "${l}" ignored`);let i=e.category;if(typeof i!="string"||i.trim()==="")return{problems:[...r,`${t}: "category" must be a non-empty string \u2014 rule dropped`]};let u=i.trim();if(u.length>D3||!l$.test(u))return{problems:[...r,`${t}: category "${u.slice(0,40)}" is not a usable name (letters, digits, space . _ : / -; up to ${D3}) \u2014 rule dropped`]};let n={category:u},a=0;for(let l of["flowId","originType","origin","route","project"]){let d=e[l];if(d!==void 0){if(typeof d!="string"||d===""||d.length>w3)return{problems:[...r,`${t}: "${l}" must be a non-empty string of up to ${w3} characters \u2014 rule dropped`]};n[l]=d,a+=1}}return a===0?{problems:[...r,`${t}: "${u}" has no match field (flowId, originType, origin, route or project) \u2014 rule dropped`]}:{rule:n,problems:r}}s($3,"rT"),o($3,"parseRule");function B3(e){if(e==null)return Et;if(!Bd(e))return{...Et,problems:["lensmcp.flows must be an object \u2014 ignored"]};let t=[],r=[],i=e.categories;i!==void 0&&(Array.isArray(i)?(i.length>$d&&t.push(`flows.categories has ${i.length} rules; only the first ${$d} are used`),i.slice(0,$d).forEach((a,l)=>{let d=$3(a,`flows.categories[${l}]`);t.push(...d.problems),d.rule&&r.push(d.rule)})):t.push("flows.categories must be an array \u2014 ignored"));let u={},n=e.segments;if(n!==void 0)if(!Bd(n))t.push("flows.segments must be an object \u2014 ignored");else for(let[a,l]of Object.entries(n)){let d=c$[a];if(!d){t.push(`flows.segments.${a}: unknown option ignored`);continue}if(typeof l!="number"||!Number.isFinite(l)||l<d[0]||l>d[1]){t.push(`flows.segments.${a}: ${JSON.stringify(l)} is outside ${d[0]}\u2013${d[1]}; using the default (${n4[a]})`);continue}u[a]=l}return{categories:r,segments:u,problems:t}}s(B3,"R$"),o(B3,"parseFlowsConfig");function ts(e,t=Et){let r=p4(e,t.segments),i=v3(e,r,t.categories),u={};for(let n of r.segments)u[n.id]=y3(n,i,t.categories);return{segmentation:r,classification:i,segmentCategories:u}}s(ts,"on"),o(ts,"analyzeFlow");function xd(e,t={}){let r=t.threshold??5,i=[];for(let u of e){let n=u.raw??null;if(n?.kind!=="loop"||!n.loop)continue;let a=n.loop.dbCallsInsideLoop??0;a>r&&i.push({kind:"db-in-loop",severity:"warning",title:`${a} DB calls inside a loop (${n.loop.iterations??"?"} iterations)`,evidence:[u.id],details:{dbCallsInsideLoop:a,iterations:n.loop.iterations,durationMs:n.loop.durationMs,threshold:r},detectedAt:u.timestamp})}return i}s(xd,"Js"),o(xd,"detectDbInLoop");function x3(e,t={}){let r=t.threshold??3,i=new Map;for(let n of e){let a=n.raw??null;if(a?.kind!=="db-query"||!a.query?.signature)continue;let l=a.query.signature,d=i.get(l);d||(d=[],i.set(l,d)),d.push(n)}let u=[];for(let[n,a]of i)a.length>=r&&u.push({kind:"n+1-query",severity:"warning",title:`Query repeated ${a.length}\xD7 \u2014 likely N+1`,evidence:a.map(l=>l.id),details:{signature:n,count:a.length,threshold:r},detectedAt:a[a.length-1].timestamp});return u}s(x3,"E$"),o(x3,"detectNPlusOne");function C3(e,t={}){let r=t.threshold??5,i=t.windowMs??250,u=new Map;for(let a of e){if(a.source!=="react")continue;let l=a.raw??null;if(l?.kind!=="render"||!l.render?.componentInstanceId)continue;let d=l.render.componentInstanceId,c=u.get(d);c||(c=[],u.set(d,c)),c.push(a)}let n=[];for(let[a,l]of u){l.sort((c,p)=>c.timestamp-p.timestamp);let d=0;for(let c=0;c<l.length;c++){for(;l[c].timestamp-l[d].timestamp>i;)d++;let p=c-d+1;if(p>r){let m=l.slice(d,c+1),f=m[0].raw.render?.componentName??a;n.push({kind:"render-storm",severity:"warning",title:`${f} rendered ${p}\xD7 in ${i}ms`,evidence:m.map(h=>h.id),details:{componentInstanceId:a,count:p,windowMs:i,threshold:r},detectedAt:m[m.length-1].timestamp});break}}}return n}s(C3,"T$"),o(C3,"detectRenderStorm");function k3(e,t,r){let i=new Map,u=new Set;function n(l){let d=i.get(l);if(d)return d;if(u.has(l))return{path:[l],totalDurationMs:r(l)};u.add(l);let c=r(l),p=t.get(l)??[],m;for(let h of p){let g=n(h);(!m||g.totalDurationMs>m.totalDurationMs)&&(m=g)}u.delete(l);let f=m?{path:[l,...m.path],totalDurationMs:c+m.totalDurationMs}:{path:[l],totalDurationMs:c};return i.set(l,f),f}s(n,"i"),o(n,"best");let a={path:[],totalDurationMs:0};for(let l of e){let d=n(l);d.totalDurationMs>a.totalDurationMs&&(a=d)}return a}s(k3,"A$"),o(k3,"findSlowPath");var A3={dbInLoop:5,nPlusOne:3,renderStorm:5,slowRouteMs:500,slowRenderMs:16,slowQueryMs:100,duplicateRequestPeak:3,slowEgressMs:1e3};function Ye(e){let t={...A3};if(e)for(let r of Object.keys(A3)){let i=e[r];typeof i=="number"&&Number.isFinite(i)&&i>=0&&(t[r]=i)}return t}s(Ye,"Ee"),o(Ye,"resolveThresholds");function I3(e){let t=e.raw??null,r=t?.kind,i=e.context,u={id:e.id,parentTraceNodeId:i.causedByNodeId??i.originNodeId,lifecycle:"completed",context:i,startTime:e.timestamp,attributes:{...t??{}}};if(e.source==="react"&&r==="render"){let n=t;return{parentAxis:"render",node:{...u,type:"render",logicalId:n.render?.componentLogicalId,instanceId:n.render?.componentInstanceId,name:`render ${n.render?.componentName??"?"}`,durationMs:n.render?.actualDurationMs}}}if(e.source==="valtio"&&r==="state-update"){let n=t;return{parentAxis:"state",node:{...u,type:"state-update",logicalId:n.update?.storeId,name:`${n.update?.storeId??"?"}.${n.update?.path??"?"}`}}}if(e.source==="nestjs"&&r==="server-request"){let n=t;return{parentAxis:"backend",node:{...u,type:"server-request",name:`${n.request?.method??"?"} ${n.request?.route??"?"}`,durationMs:n.request?.durationMs}}}if(r==="db-query"){let n=t,a=[n.op,n.table].filter(Boolean).join(" ")||(n.name??"query");return{parentAxis:"backend",node:{...u,type:"db-query",logicalId:n.table?`db:${n.op??"query"}:${n.table}`:void 0,name:n.error?`${a} (failed)`:a,durationMs:n.durationMs}}}if(r==="loop")return{parentAxis:"performance",node:{...u,type:"loop",name:"loop",durationMs:t.loop?.durationMs}};if(e.source==="client-runtime"&&r==="user-action"){let n=t;return{parentAxis:"caused",node:{...u,type:"ui-event",logicalId:n.origin?.nodeId,name:n.origin?.label??e.title}}}}s(I3,"nT"),o(I3,"eventToNode");function _3(e,t){let r=[...t].sort((l,d)=>l.timestamp-d.timestamp),i=[];for(let l of r){let d=I3(l);d&&(e.addNode(d.node),i.push(d))}let u=0,n=o((l,d,c,p)=>{let m={id:`${c}:${l}->${d}`,from:l,to:d,axis:c,type:p,timestamp:e.getNode(d)?.startTime??0};e.addEdge(m),u++},"addEdge");for(let l of i){let d=l.node.context.causedByNodeId;d&&e.getNode(d)&&n(d,l.node.id,l.parentAxis??"caused","caused-by")}let a=new Map;for(let l of i){let d=l.node.context.flowId;if(!d)continue;let c=a.get(d);c||(c=[],a.set(d,c)),c.push(l)}for(let l of a.values())for(let d=1;d<l.length;d++){let c=l[d-1].node,p=l[d].node;p.context.causedByNodeId!==c.id&&n(c.id,p.id,"caused","flow-sequence")}return{nodeCount:i.length,edgeCount:u}}s(_3,"z$"),o(_3,"buildGraphFromEvents");var S3=new WeakMap;function us(e){let t=S3.get(e);if(t!==void 0)return t;let r=Xe(e);return S3.set(e,r),r}s(us,"sn"),o(us,"estimateEventBytes");function F3(e,t={}){let r=t.rawByteLimit??32768,i=t.maxDepth??12,u=e.raw;if(u==null)return{event:e,truncated:!1,originalBytes:0,keptBytes:0};if(!vd(u,r,i)){let c=Xe(u,r,i);return{event:e,truncated:!1,originalBytes:c,keptBytes:c}}let n=Xe(u,Number.POSITIVE_INFINITY,64),a={budget:r,maxStringBytes:t.maxStringBytes??4096,maxArrayItems:t.maxArrayItems??64,paths:[],truncatedAnything:!1},l=bu(u,a,i,""),d=Xe(l,Number.POSITIVE_INFINITY,i);if(a.truncatedAnything&&l!==null&&typeof l=="object"&&!Array.isArray(l)){let c={truncated:!0,originalBytes:n,keptBytes:d,paths:a.paths};l[gd]=c}return{event:{...e,raw:l},truncated:a.truncatedAnything,originalBytes:n,keptBytes:d}}s(F3,"cT"),o(F3,"clampEventRaw");function Cd(e={}){let t=0,r=0,i=0,u=e.rawByteLimit??32768;return{clamp(n){t+=1;let a=F3(n,e);return a.truncated&&(r+=1,i+=Math.max(0,a.originalBytes-a.keptBytes)),a.event},stats(){return{inspected:t,truncated:r,bytesReclaimed:i,rawByteLimit:u}},reset(){t=0,r=0,i=0}}}s(Cd,"Ws"),o(Cd,"createEventClamp");var p$={screenshot:50,"visual-crop":50,"visual-frame":200,"build-report":20,"heap-snapshot":3,"trace-with-errors":20,verification:10},m$=64*1024*1024,f$=32*1024*1024,h$=class{static{s(this,"Ks")}static{o(this,"InMemoryRingBuffer")}constructor(e={}){this.events=[],this.eventBytes=[],this.residentEventBytes=0,this.ingested=0,this.dropped=0,this.droppedForBytes=0,this.artifactsByKind=new Map,this.artifactsById=new Map,this.artifactBytesById=new Map,this.artifactOrder=[],this.residentArtifactBytes=0,this.artifactsDropped=0,this.eventCap=e.eventCap??5e3,this.eventByteCap=e.eventByteCap??m$,this.artifactCaps={...p$,...e.artifactCapacities},this.artifactByteCap=e.artifactByteCap??f$}appendEvent(e){let t=us(e);for(this.events.push(e),this.eventBytes.push(t),this.residentEventBytes+=t,this.ingested+=1,this.events.length>this.eventCap&&this.evictOldestEvents(this.events.length-this.eventCap);this.residentEventBytes>this.eventByteCap&&this.events.length>1;)this.evictOldestEvents(1),this.droppedForBytes+=1}evictOldestEvents(e){if(e<=0)return;let t=Math.min(e,this.events.length);for(let r=0;r<t;r++)this.residentEventBytes-=this.eventBytes[r]??0;this.events.splice(0,t),this.eventBytes.splice(0,t),this.dropped+=t,this.events.length===0&&(this.residentEventBytes=0)}recentEvents(e){return e===void 0||e>=this.events.length?[...this.events]:this.events.slice(this.events.length-e)}totalEventsIngested(){return this.ingested}totalEventsDropped(){return this.dropped}putArtifact(e){let t=this.artifactCaps[e.kind]??0;if(t<=0)return;let r=this.artifactsByKind.get(e.kind);r||(r=[],this.artifactsByKind.set(e.kind,r)),this.artifactsById.has(e.id)&&this.removeArtifact(e.id);let i=Xe(e.data);for(r.push(e),this.artifactsById.set(e.id,e),this.artifactBytesById.set(e.id,i),this.artifactOrder.push(e.id),this.residentArtifactBytes+=i;r.length>t;){let u=r.shift();u&&(this.forgetArtifact(u.id),this.artifactsDropped+=1)}for(;this.residentArtifactBytes>this.artifactByteCap&&this.artifactOrder.length>1;){let u=this.artifactOrder[0];if(u===void 0)break;this.removeArtifact(u),this.artifactsDropped+=1}}removeArtifact(e){let t=this.artifactsById.get(e);if(t){let r=this.artifactsByKind.get(t.kind);if(r){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}this.forgetArtifact(e)}forgetArtifact(e){this.artifactsById.delete(e),this.residentArtifactBytes-=this.artifactBytesById.get(e)??0,this.artifactBytesById.delete(e);let t=this.artifactOrder.indexOf(e);t!==-1&&this.artifactOrder.splice(t,1),this.artifactsById.size===0&&(this.residentArtifactBytes=0)}getArtifact(e){return this.artifactsById.get(e)}listArtifacts(e){return[...this.artifactsByKind.get(e)??[]]}approximateSizeBytes(){return this.residentEventBytes+this.residentArtifactBytes}stats(){let e={};for(let[t,r]of this.artifactsByKind)r.length>0&&(e[t]=r.length);return{events:{resident:this.events.length,residentBytes:this.residentEventBytes,ingested:this.ingested,dropped:this.dropped,droppedForBytes:this.droppedForBytes,cap:this.eventCap,byteCap:this.eventByteCap},artifacts:{resident:this.artifactsById.size,residentBytes:this.residentArtifactBytes,dropped:this.artifactsDropped,byteCap:this.artifactByteCap,byKind:e}}}},g$=class{static{s(this,"Xs")}static{o(this,"Session")}constructor(e={}){this.state="idle",this.hooks=[],this.reducerRetention=new Map,this.id=e.sessionId??lt(),this.storage=e.storage??new h$,this.clamp=e.clamp===!1?void 0:Cd(e.clamp??{}),this.redactor=e.redact===!1?void 0:oa(e.redact??{});let t=[this.clamp?.clamp,this.redactor?.redact].filter(r=>r!==void 0);this.bus=new Hm({capacity:e.eventBusCapacity,...t.length?{transform:o(r=>t.reduce((i,u)=>u(i),r),"transform")}:{}}),this.graph=new t4,this.resources=new e4,this.reducers=new B5,this.bus.subscribe(r=>{this.storage.appendEvent(r),this.reducers.dispatch(r)})}get lifecycle(){return this.state}storageStats(){let e=Object.fromEntries([...this.reducerRetention].map(([t,r])=>[t,r()]));return{...this.storage.stats?{storage:this.storage.stats()}:{},...this.clamp?{clamp:this.clamp.stats()}:{},...Object.keys(e).length>0?{reducers:e}:{}}}registerReducerRetention(e,t){this.reducerRetention.set(e,t)}start(){this.state==="idle"&&(this.state="active")}onShutdown(e){this.hooks.push(e)}async stop(){if(!(this.state==="closed"||this.state==="stopping")){this.state="stopping";for(let e=this.hooks.length-1;e>=0;e--){let t=this.hooks[e];try{let r=t.stop();r&&typeof r.then=="function"&&await r}catch{}}this.state="closed"}}};import{AsyncProvider as Zr,ProviderScope as Lr}from"@frontmcp/sdk";var kd;function j3(e){kd=e}s(j3,"M$"),o(j3,"setActiveSession");function Bu(){if(!kd)throw new Error("No LensMCP session is active. Did you call bootstrapLensmcp() before the FrontMCP container started?");return kd}s(Bu,"go"),o(Bu,"requireSession");var v$=Zr({provide:Pr,name:"LensmcpSession",description:"The active LensMCP Session instance.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu(),"useFactory")}),y$=Zr({provide:Ur,name:"LensmcpEventBus",description:"The session's normalised event bus.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().bus,"useFactory")}),E$=Zr({provide:RD,name:"LensmcpGraphStore",description:"The typed multi-axis trace graph.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().graph,"useFactory")}),b$=Zr({provide:Z,name:"LensmcpResourceStore",description:"Registry of agent-readable MCP resources.",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().resources,"useFactory")}),w$=Zr({provide:TD,name:"LensmcpStorage",description:"Hot-tier storage backend (in-memory ring buffer by default).",scope:Lr.GLOBAL,inject:o(()=>[],"inject"),useFactory:o(()=>Bu().storage,"useFactory")}),D$=[v$,y$,E$,b$,w$];function z3(e={}){let t=new g$(e);return t.start(),j3(t),{session:t,providers:D$}}s(z3,"P$"),o(z3,"bootstrapLensmcp");var $_=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g"),B_=["ai/agents/hazard-analyst/src/hazard-analyst.agent.ts(52,12): error TS2416: Property 'outputSchema' in type 'HazardAnalystAgent' is not assignable to the same property in base type 'BaseAgent<HazardInput, HazardOutput>'.","server/apps/haccp/src/modules/plan/plan.service.ts(118,7): error TS2322: Type 'string' is not assignable to type 'PlanStatus'.","web/libs/ui/src/report/report-renderer.tsx(9,3): warning TS6133: {0} is declared but its value is never read."].join(`
|
|
66
|
+
`);import{createSocket as $$}from"node:dgram";import{closeSync as B$,existsSync as N3,openSync as x$,readSync as C$,statSync as M3}from"node:fs";import{createServer as k$}from"node:net";import{existsSync as O3,unlinkSync as R3}from"node:fs";var A$=1024*1024;function T3(e){let t=e.onError??(()=>{});try{O3(e.path)&&R3(e.path)}catch{}let r=new Set,i=e.maxFrameBytes??A$,u=k$(n=>{r.add(n);let a="";n.setEncoding("utf8"),n.on("data",l=>{a+=l;let d;for(;(d=a.indexOf(`
|
|
67
|
+
`))!==-1;){let c=a.slice(0,d);a=a.slice(d+1),c&&e.onMessage(c)}a.length>i&&(t(new Error(`uds: frame exceeded ${i} bytes without a newline \u2014 connection dropped`)),a="",n.destroy())}),n.on("error",l=>t(l)),n.on("close",()=>r.delete(n))});return u.on("error",n=>t(n)),u.listen(e.path,()=>e.onListening?.()),u.unref(),{close:o(()=>new Promise(n=>{for(let a of r)try{a.destroy()}catch{}r.clear();try{u.close(()=>{try{O3(e.path)&&R3(e.path)}catch{}n()})}catch{n()}}),"close")}}s(T3,"zm"),o(T3,"createUdsServer");function P3(e){let t=e.eventFile??process.env.LENSMCP_EVENT_FILE,r=e.socketPath??process.env.LENSMCP_IPC_SOCKET,i=e.udsPath??process.env.LENSMCP_UDS,u=e.onError??(()=>{}),n=0,a=o(f=>{let h=f.trim();if(!h)return;let g;try{g=JSON.parse(h)}catch{return}if(!(!g||typeof g!="object"||!("id"in g)||!("source"in g)))try{e.sessionId&&g.sessionId==="pending"&&(g.sessionId=e.sessionId,g.context&&g.context.sessionId==="pending"&&(g.context.sessionId=e.sessionId)),e.bus.publish(g),n+=1}catch(b){u(b)}},"publish"),l=[],d=!1,c=!1,p=!1;if(t){d=!0;let f=0,h="",g=!1,b=e.replayBytes??Number(process.env.LENSMCP_REPLAY_BYTES??4*1024*1024);if(N3(t))try{let w=M3(t).size;Number.isFinite(b)&&b>0&&w>0?(f=Math.max(0,w-b),g=f>0):f=w}catch{f=0}let x=Buffer.alloc(64*1024),$=setInterval(o(()=>{if(!N3(t))return;let w;try{w=M3(t).size}catch{return}for(w<f&&(f=0,h="");f<w;){let k;try{k=x$(t,"r")}catch(C){u(C);return}try{let C=Math.min(x.length,w-f),M=C$(k,x,0,C,f);if(M<=0)break;f+=M,h+=x.toString("utf8",0,M);let y;for(;(y=h.indexOf(`
|
|
68
|
+
`))!==-1;){let D=h.slice(0,y);if(h=h.slice(y+1),g){g=!1;continue}a(D)}}finally{B$(k)}}},"drain"),e.pollMs??50);$.unref?.(),l.push(()=>clearInterval($))}if(r){let[f,h]=r.split(":"),g=Number(h);if(f&&Number.isFinite(g)){c=!0;let b;try{b=$$("udp4"),b.on("message",x=>a(x.toString("utf8"))),b.on("error",x=>u(x)),b.bind(g,f),b.unref()}catch(x){u(x),c=!1}if(b){let x=b;l.push(()=>new Promise($=>{try{x.close(()=>$())}catch{$()}}))}}}if(i)try{let f=T3({path:i,onMessage:o(h=>a(h),"onMessage"),onError:u});p=!0,l.push(()=>f.close())}catch(f){u(f)}let m=[];return d&&m.push("file"),c&&m.push("udp"),p&&m.push("uds"),{mode:m.join("+")||"none",count:o(()=>n,"count"),async stop(){for(let f of l)try{await f()}catch{}}}}s(P3,"Om"),o(P3,"startEventIngest");import{existsSync as I$,readFileSync as U3}from"node:fs";import{dirname as _$,join as S$}from"node:path";function q3(e=process.cwd()){let t=Ad("nx.json",e);if(!t)return Ye();try{let r=JSON.parse(U3(t,"utf8"));return Ye(r.lensmcp?.thresholds)}catch{return Ye()}}s(q3,"Mm"),o(q3,"loadWorkspaceThresholds");function Z3(e=process.cwd()){let t=Ad("nx.json",e);if(!t)return Et;try{let r=JSON.parse(U3(t,"utf8"));return B3(r.lensmcp?.flows)}catch(r){return{...Et,problems:[`${t} could not be read as JSON (${r instanceof Error?r.message:String(r)}) \u2014 flow config ignored`]}}}s(Z3,"Nm"),o(Z3,"loadWorkspaceFlowsConfig");function Ad(e,t){let r=t;for(let i=0;i<8;i++){let u=S$(r,e);if(I$(u))return u;let n=_$(r);if(n===r)break;r=n}}s(Ad,"B$"),o(Ad,"findUp");function F(e,t,r,i){var u=arguments.length,n=u<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(n=(u<3?a(n):u>3?a(t,r,n):a(t,r))||n);return u>3&&n&&Object.defineProperty(t,r,n),n}s(F,"$"),o(F,"__decorate");import{App as F$}from"@frontmcp/sdk";import{Resource as j$,ResourceContext as z$}from"@frontmcp/sdk";import{existsSync as N$,readFileSync as M$}from"node:fs";import{dirname as O$,join as R$}from"node:path";var Le="perf://rules",Zt="pod/heap-budget",Lt="pod/retained-generation",L3=512,V3=.9,T$=64,P$=16,U$=16,J3=256,W3=1024*1024,q$="LENSMCP_PERF_RULES",Z$="LENSMCP_POD_HEAP_BUDGET_MB",L$={heapBudgetEnabled:!0,retainedEnabled:!0,budgetMb:L3,services:{}},V$=/^(0|off|false|no)$/i,Id=o(e=>{let t=typeof e=="string"&&e.trim()!==""?Number(e):e;return typeof t=="number"&&Number.isFinite(t)&&t>=16&&t<=1e6?t:void 0},"budget");function rs(e,t){let r=t&&typeof t=="object"&&!Array.isArray(t)?t:{},i=r[Zt]&&typeof r[Zt]=="object"?r[Zt]:{},u=r[Lt]&&typeof r[Lt]=="object"?r[Lt]:{},n=V$.test((e[q$]??"").trim())||r.enabled===!1,a={};if(i.services&&typeof i.services=="object"&&!Array.isArray(i.services))for(let[l,d]of Object.entries(i.services)){let c=Id(d);c!==void 0&&(a[l]=c)}return{heapBudgetEnabled:!n&&i.enabled!==!1,retainedEnabled:!n&&u.enabled!==!1,budgetMb:Id(e[Z$])??Id(i.budgetMb)??L3,services:a}}s(rs,"Hs"),o(rs,"resolvePodRuleThresholds");function G3(e=process.cwd(),t=process.env){let r=e;for(let i=0;i<8;i++){let u=R$(r,".lensmcp","config.json");if(N$(u))try{let a=JSON.parse(M$(u,"utf8"));return rs(t,a?.perfRules)}catch{return rs(t,void 0)}let n=O$(r);if(n===r)break;r=n}return rs(t,void 0)}s(G3,"Um"),o(G3,"loadPodRuleThresholds");var Vr=o((e,t,r)=>`${e}\0${t}\0${r}`,"key"),Ve=o(e=>Math.round(e/W3),"mb"),_d=0,J$=o(()=>(_d=(_d+1)%65535,`perf-${Date.now().toString(36)}${_d.toString(36)}${Math.random().toString(36).slice(2,7)}`),"eventId"),W$=class{static{s(this,"yo")}static{o(this,"PerfRuleBook")}constructor(e={}){this.options=e,this.findings=new Map,this.pods=new Map,this.heard=!1,this.thresholds=e.thresholds??L$,this.now=e.now??Date.now}ingest(e){return e.source==="perf"?this.ingestRule(e):e.source==="memory"?this.ingestPod(e):!1}ingestRule(e){let t=r3(e.raw);if(!t||t.rule.startsWith("pod/"))return!1;let r=!this.heard;if(this.heard=!0,t.kind==="perf-rule-scan"){let n=!1,a=new Set(t.open);for(let[l,d]of this.findings)d.rule===t.rule&&d.project===t.project&&!a.has(d.subject)&&(this.findings.delete(l),n=!0);return n||r}let i=Vr(t.rule,t.project,t.subject);if(t.kind==="perf-rule-retracted")return this.findings.delete(i)||r;let u=this.findings.get(i);return this.findings.set(i,{rule:t.rule,project:t.project,subject:t.subject,severity:t.severity,title:t.title,summary:t.summary,evidence:t.evidence,cost:t.cost,fix:t.fix,verify:t.verify,docs:t.docs,firstSeenAt:u?.firstSeenAt??e.timestamp,lastSeenAt:Math.max(e.timestamp,u?.lastSeenAt??0)}),this.bound(),!0}projectPods(e,t,r){let i=this.pods.get(e);if(!i&&(i={service:t,lastSeenAt:r,readings:new Map,retained:new Map},this.pods.set(e,i),this.pods.size>T$)){let u=[...this.pods.entries()].sort((n,a)=>n[1].lastSeenAt-a[1].lastSeenAt)[0];u&&u[0]!==e&&(this.pods.delete(u[0]),this.close(Vr(Zt,u[0],u[1].service),"evicted",r),this.close(Vr(Lt,u[0],u[1].service),"evicted",r))}return i.service=t||i.service,i.lastSeenAt=Math.max(i.lastSeenAt,r),i}ingestPod(e){let t=Gn(e.raw);if(!t)return!1;let r=e.timestamp,i=this.projectPods(t.project,t.service||t.project,r),u=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory"){if(t.previousAlive!==!0&&i.readings.set(u,this.reading(t,r)),t.trigger==="boot"){for(let d of[...i.readings.keys()])d.startsWith(`${t.pod}:`)&&d!==u&&i.readings.delete(d);for(let d of[...i.retained.keys()])d.startsWith(`${t.pod}:`)&&!d.startsWith(`${u}:`)&&i.retained.delete(d)}if(i.readings.size>P$){let d=[...i.readings.entries()].sort((c,p)=>c[1].at-p[1].at)[0];d&&i.readings.delete(d[0])}}else if(t.kind==="pod-memory-retained"){i.retained.set(`${u}:${t.gen}`,this.retainedOf(t,r));let d=[...i.retained.keys()].filter(c=>c.startsWith(`${u}:`));d.length>U$&&i.retained.delete(d[0])}else if(t.kind==="pod-memory-released")i.retained.delete(`${u}:${t.gen}`);else if(t.kind==="pod-memory-exited"){i.readings.delete(u);for(let d of[...i.retained.keys()])d.startsWith(`${u}:`)&&i.retained.delete(d)}let n=!this.heard;this.heard=!0;let a=this.evaluateHeap(t.project,i,r),l=this.evaluateRetained(t.project,i,r);return a||l||n}reading(e,t){return{pod:e.pod,pid:e.pid,service:e.service||e.project,at:e.at??t,trigger:e.trigger,gen:e.gen,swaps:e.swaps,live:e.live,reserved:e.reserved,rss:e.rss,...e.baseline!==void 0?{baseline:e.baseline}:{}}}retainedOf(e,t){return{pod:e.pod,pid:e.pid,gen:e.gen,at:t,ageMs:e.ageMs,swapsSinceClose:e.swapsSinceClose,gcs:e.gcs,alive:Array.isArray(e.alive)?e.alive.slice(0,8):[],...e.counts?{counts:e.counts}:{},live:e.live}}budgetFor(e,t){return this.thresholds.services[t]??this.thresholds.services[e]??this.thresholds.budgetMb}related(e){return[...this.findings.values()].filter(t=>t.project===e&&!t.rule.startsWith("pod/")).map(t=>`${t.rule}: ${t.title}`)}evaluateHeap(e,t,r){let i=t.service,u=Vr(Zt,e,i),n=this.findings.get(u);if(!this.thresholds.heapBudgetEnabled)return n?this.close(u,"disabled",r):!1;let a=this.budgetFor(e,t.service),l=a*W3,d=[...t.readings.values()].sort((g,b)=>b.live-g.live),c=d.filter(g=>g.live>l),p=d.some(g=>g.live>l*V3);if(c.length===0&&!(n&&p))return n?this.close(u,d.length?"cleared":"pod-exited",r):!1;if(c.length===0)return!1;let m=c[0],f=c.reduce((g,b)=>g+(b.live-l),0),h={rule:Zt,project:e,subject:i,severity:m.live>=2*l?"error":"warning",title:`${t.service}: ${Ve(m.live)} MB live heap after a full GC \u2014 over its ${a} MB budget${c.length>1?` (${c.length} pods)`:""}`,summary:`Pod #${m.pod} of ${t.service} holds ${Ve(m.live)} MB of live objects right after a full GC (${Ve(m.reserved)} MB reserved, rss ${Ve(m.rss)} MB${m.baseline!==void 0?`; ${Ve(m.baseline)} MB at boot`:""}, generation ${m.gen} after ${m.swaps} swap${m.swaps===1?"":"s"}). That is not garbage: it is what the app keeps, in every pod of the service.`,evidence:{budgetMb:a,pods:c.map(g=>({pod:g.pod,pid:g.pid,liveMb:Ve(g.live),reservedMb:Ve(g.reserved),rssMb:Ve(g.rss),...g.baseline!==void 0?{baselineMb:Ve(g.baseline)}:{},gen:g.gen,swaps:g.swaps,trigger:g.trigger,at:g.at})),related:this.related(e)},cost:{bytes:f,memoryMb:Ve(f),basis:`live heap after a full GC above the ${a} MB budget, summed over the pods over it`},fix:[`See what the heap is made of: \`memory.explain_pod({ service: '${t.service}' })\`, then \`lensmcp mem ${t.service} --snapshot --analyze\` \u2014 read "bytes by package/module" and the largest retainers.`,`If one shared library dominates (FoodGuard: ~300 MB of zod schemas per pod from a contracts barrel), import it by subpath \u2014 see any bundle/heavy-barrel-import finding for ${e} \u2014 and build large schema catalogs lazily (a function that builds on first use), not at module load.`,"If the bundle text dominates (eval strings, source maps), keep the default `eval` devtool and no `--enable-source-maps` (LENSMCP_DEV_DEVTOOL unset).",`If the heap grows with each swap or request, it is retention, not size: look for module-level caches, registries and listeners that outlive a request (\`memory.explain_leak\`). A service that genuinely needs more raises its budget: \`.lensmcp/config.json\` perfRules["pod/heap-budget"].services["${t.service}"].`],verify:`After the change rebuilds and the pod swaps, its next post-GC report (\`memory.pods\`) shows live heap under ${Math.round(a*V3)} MB and LensMCP retracts this finding (\`observe_current_status\` no longer lists pod/heap-budget for ${t.service}).`,docs:t3[Zt],firstSeenAt:n?.firstSeenAt??r,lastSeenAt:r};return this.open(u,h,n)}evaluateRetained(e,t,r){let i=t.service,u=Vr(Lt,e,i),n=this.findings.get(u),a=[...t.retained.values()].sort((p,m)=>m.ageMs-p.ageMs);if(!this.thresholds.retainedEnabled||a.length===0)return n?this.close(u,this.thresholds.retainedEnabled?"released":"disabled",r):!1;let l=a[0],d=Math.max(1,Math.round(l.ageMs/6e4)),c={rule:Lt,project:e,subject:i,severity:"warning",title:`${t.service}: ${a.length===1?`generation ${l.gen} is`:`${a.length} closed generations are`} still in memory ${d} min after the hot swap that closed ${a.length===1?"it":"them"}`,summary:`Pod #${l.pod} closed generation ${l.gen} ${d} min ago, ${l.swapsSinceClose} swap(s) and ${l.gcs} full GC(s) since, and ${l.alive.join(", ")||"its objects"} ${l.alive.length===1?"is":"are"} still alive: something still points into the old app \u2014 a whole copy of it stays resident with every swap that leaks.`,evidence:{generations:a.slice(0,8).map(p=>({pod:p.pod,pid:p.pid,gen:p.gen,ageMs:p.ageMs,swapsSinceClose:p.swapsSinceClose,gcs:p.gcs,alive:p.alive,...p.counts?{counts:p.counts}:{},liveMb:Ve(p.live)}))},cost:{basis:"one copy of the app per retained generation; its size is in the heap snapshot (`lensmcp mem --snapshot --analyze`)"},fix:[`Find what holds it: \`lensmcp mem ${t.service} --snapshot --analyze\` prints the shortest path from the GC roots to generation ${l.gen} \u2014 the first frame outside your app's own objects is the culprit.`,"Usual culprits: a timer or interval never cleared on shutdown; a BullMQ worker, queue event or Redis client never closed in onModuleDestroy / onApplicationShutdown; `process.on(\u2026)` / an EventEmitter listener added per app instance; a module-level registry, cache or singleton keyed by class or holding app instances.","Release it in the app's shutdown hooks (Nest calls them on every hot swap), or move the module-level state into a provider the container owns."],verify:'Save a file to swap again; within ~5 min the pod reports "generation N freed" (`memory.pods`), LensMCP retracts this finding, and `memory://leaks/suspected` no longer lists the generation.',docs:t3[Lt],firstSeenAt:n?.firstSeenAt??r,lastSeenAt:r};return this.open(u,c,n)}open(e,t,r){return this.findings.set(e,t),this.bound(),(!r||r.title!==t.title||r.severity!==t.severity)&&this.emit(t,"finding"),!0}close(e,t,r){let i=this.findings.get(e);return i?(this.findings.delete(e),this.emit({...i,lastSeenAt:r},"retracted",t),!0):!1}emit(e,t,r){let i=this.options.publish;if(!i)return;let u=this.options.sessionId??"pending",n=this.now(),a={id:J$(),sessionId:u,timestamp:n,source:"perf",category:"performance",severity:t==="finding"?e.severity:"info",context:{sessionId:u,projectName:e.project},fingerprint:u3(e.rule,e.project,e.subject),title:t==="finding"?`${e.rule}: ${e.title}`:`${e.rule}: cleared for ${e.project} (${e.subject})`,raw:t==="finding"?{kind:"perf-rule-finding",rule:e.rule,project:e.project,subject:e.subject,severity:e.severity,title:e.title,summary:e.summary,evidence:e.evidence,cost:e.cost,fix:e.fix,verify:e.verify,docs:e.docs,detectedAt:n}:{kind:"perf-rule-retracted",rule:e.rule,project:e.project,subject:e.subject,reason:r??"cleared",at:n}};queueMicrotask(()=>{try{i(a)}catch{}})}bound(){if(this.findings.size<=J3)return;let e=[...this.findings.entries()].sort((t,r)=>t[1].lastSeenAt-r[1].lastSeenAt).slice(0,this.findings.size-J3);for(let[t]of e)this.findings.delete(t)}openFindings(){return[...this.findings.values()].sort((e,t)=>e.severity===t.severity?t.lastSeenAt-e.lastSeenAt:e.severity==="error"?-1:1)}report(e){let t=this.openFindings(),r={};for(let i of t)r[i.rule]=(r[i.rule]??0)+1;return{schemaVersion:1,revision:e,updatedAt:new Date(this.now()).toISOString(),producer:this.heard?"connected":"none",detail:this.heard?t.length?`${t.length} open performance finding${t.length===1?"":"s"}: ${Object.entries(r).map(([i,u])=>`${u} ${i}`).join(", ")}`:"no open performance findings":"no performance rule has reported yet \u2014 rules run after a dev-cluster compilation (bundle/*) and on pod memory reports (pod/*); start the gateway",findings:t,counts:r}}};function K3(e,t=700){let r=e.fix.map((i,u)=>`${u+1}) ${i}`).join(" ");return r.length>t?`${r.slice(0,t-40).trimEnd()}\u2026 (all steps: ${Le})`:r}s(K3,"Lm"),o(K3,"compactFix");var H3=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord"),X3=o(e=>Array.isArray(e)?e.length:void 0,"arrayLen"),bt=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"asCount"),Te=o(e=>typeof e=="string"?e:void 0,"asString");function pe(e,...t){for(let r of t){let i=X3(e[r])??bt(e[r]);if(i!==void 0)return i}}s(pe,"me"),o(pe,"countOf");var fe=o((e,t,r=`${t}s`)=>`${e} ${e===1?t:r}`,"plural");function is(e,t,r,i,u){if(t>0)return{state:"failed",count:t,detail:`${fe(t,`${i} error`)} \u2014 read ${u}`};if(r>0)return{state:"warning",count:r,detail:fe(r,`${i} warning`)};let n=Te(e.status);return n==="clean"||n==="passed"?{state:"passed",count:0,detail:`${i} clean`}:{state:"unknown",detail:`${i} has not reported a result yet (status=${n??"absent"})`}}s(is,"Fm"),o(is,"fromStatusField");var ns=[{kind:"typecheck",resource:"typecheck://current",reads:o(()=>["typecheck://errors"],"reads"),blocking:!0,source:"typescript",read:o(e=>is(e,pe(e,"errorCount","errors")??0,0,"typecheck","typecheck://errors"),"read")},{kind:"lint",resource:"lint://current",reads:o(e=>e==="warning"?["lint://warnings"]:["lint://errors"],"reads"),blocking:!0,source:"eslint",read:o(e=>is(e,pe(e,"errorCount","errors")??0,pe(e,"warningCount","warnings")??0,"lint","lint://errors"),"read")},{kind:"build",resource:"build://current",reads:o(e=>e==="warning"?["build://current"]:["build://failures"],"reads"),blocking:!0,source:"vite",read:o(e=>{let t=Array.isArray(e.failures)?e.failures.filter(u=>{let n=u?.domain;return n!=="typecheck"&&n!=="lint"}).length:pe(e,"failures","failureCount")??0,r=(X3(e.failures)??t)-t,i=t===0&&r>0&&Te(e.status)==="failing"?{...e,status:"clean"}:e;return is(i,t,pe(e,"warnings","warningCount")??0,"build","build://failures")},"read")},{kind:"runtime",resource:"runtime://browser/errors",reads:o(()=>["runtime://browser/errors","runtime://browser/failed-requests"],"reads"),blocking:!0,source:"client-runtime",read:o(e=>{let t=pe(e,"count","entries")??0;return t>0?{state:"failed",count:t,detail:`${fe(t,"browser runtime error")} \u2014 read runtime://browser/errors`}:{state:"unknown",count:0,detail:"no browser runtime errors recorded (a browser may never have connected)"}},"read")},{kind:"runtime",resource:"runtime://errors",reads:o(()=>["runtime://errors"],"reads"),blocking:!0,source:"nestjs",read:o(e=>{let t=pe(e,"count","entries")??0,r=Array.isArray(e.entries)?e.entries.filter(u=>u?.outcome==="declared").length:0,i=r>0?` (${t-r} unhandled, ${r} a 5xx the app answered on purpose)`:"";return t>0?{state:"failed",count:t,detail:`${fe(t,"server-side error")}${i} \u2014 read runtime://errors (route, status, request id and stack)`}:{state:"unknown",count:0,detail:"no server-side errors recorded (no pod may have handled a request yet)"}},"read")},{kind:"cluster",resource:"process://cluster",reads:o(()=>["process://cluster"],"reads"),blocking:!0,source:"gateway",read:o(e=>{if((pe(e,"services")??0)===0)return{state:"unknown",detail:"no cluster lifecycle events seen (the gateway may not be running)"};let t=pe(e,"crashLooping")??0,r=pe(e,"wedged")??0,i=pe(e,"buildFailed")??0,u=pe(e,"typeErrors")??0,n=u>0?`${fe(u,"service")} with type errors no typecheck producer reports`:void 0,a=pe(e,"down")??0,l=bt(e.restarts)??0,d=Array.isArray(e.services)?e.services.filter(h=>{let g=h??{};return g.buildFailed===!0&&g.state==="up"}).length:0,c=Math.max(0,i-d),p=d>0?`${fe(d,"service")} failing to build while still serving the last good bundle`:void 0,m=[p,n?`${n} (still serving)`:void 0].filter(Boolean);if(t>0||r>0||c>0){let h=[t>0?`${fe(t,"service")} crash-looping`:void 0,r>0?`${fe(r,"service")} wedged`:void 0,c>0?`${fe(c,"service")} failing to build`:void 0].filter(Boolean);return{state:"failed",count:t+r+i+u,detail:`${h.join(", ")} \u2014 read process://cluster (requests to them 502)${m.length?`; ${m.join("; ")}`:""}`}}if(p)return{state:"failed",count:i+u,detail:`${p} \u2014 read process://cluster for the error lines${n?`; ${n} (still serving)`:""}`};if(n)return{state:"failed",count:u,detail:`${n} \u2014 read process://cluster for the lines (the bundle built; the services still serve)`};if(a>0)return{state:"warning",count:a,detail:`${fe(a,"service")} down (idle scale-to-zero is normal; the next request restarts it)`};let f=pe(e,"up")??0;return{state:"passed",count:0,detail:`${fe(f,"service")} up${l>0?`, ${fe(l,"restart")} this session`:""}`}},"read")},{kind:"memory",resource:"memory://leaks/suspected",reads:o(()=>["memory://leaks/suspected","memory://owners/growing"],"reads"),blocking:!1,source:"memory",read:o(e=>{let t=pe(e,"suspected","leaks")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"suspected leak")} \u2014 read memory://leaks/suspected`}:{state:"passed",count:0,detail:"no suspected leaks"}},"read")},{kind:"visual",resource:"visual://violations/current",reads:o(()=>["visual://violations/current"],"reads"),blocking:!1,source:"visual",read:o(e=>{let t=pe(e,"violations")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"visual violation")} \u2014 read visual://violations/current`}:{state:"passed",count:0,detail:"no visual violations"}},"read")},{kind:"perf",resource:"perf://slow-routes",reads:o(()=>["perf://slow-routes"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"routes")??0,r=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"route")} over${r?` ${r}ms`:" the slow-route threshold"} \u2014 read perf://slow-routes`}:{state:"passed",count:0,detail:"no slow routes"}},"read")},{kind:"duplicate-requests",resource:"perf://duplicate-requests",reads:o(()=>["perf://duplicate-requests"],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"endpoints")??0,r=bt(e.peakThreshold);return t>0?{state:"warning",count:t,detail:`${fe(t,"endpoint")} called ${r?`\u2265${r}\xD7`:"several times"} concurrently by one page \u2014 read perf://duplicate-requests`}:{state:"passed",count:0,detail:"no duplicated requests"}},"read")},{kind:"db",resource:"db://slow-queries",reads:o(()=>["db://slow-queries","db://analysis"],"reads"),blocking:!1,source:"db",read:o(e=>{let t=pe(e,"queries")??0,r=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"query shape")} over${r?` ${r}ms`:" the slow-query threshold"} \u2014 read db://slow-queries`}:{state:"passed",count:0,detail:"no slow query shapes"}},"read")},{kind:"egress",resource:"net://egress/hosts",reads:o(e=>e==="warning"?["net://egress/hosts","net://egress/failures"]:["net://egress/hosts"],"reads"),blocking:!1,source:"external",read:o(e=>{let t=pe(e,"failingHosts")??0,r=pe(e,"slowHosts")??0,i=bt(e.thresholdMs);return t>0?{state:"warning",count:t,detail:`${fe(t,"external host")} failing \u2014 read net://egress/failures`}:r>0?{state:"warning",count:r,detail:`${fe(r,"external host")} over${i?` ${i}ms`:" the slow-egress threshold"} \u2014 read net://egress/hosts`}:{state:"passed",count:0,detail:"no failing or slow external calls"}},"read")},{kind:"perf-rules",resource:Le,reads:o(()=>[Le],"reads"),blocking:!1,source:"perf",read:o(e=>{let t=pe(e,"findings")??0;return t>0?{state:"warning",count:t,detail:`${fe(t,"performance finding")} \u2014 read ${Le} (each has a fix and a verify step)`}:{state:"passed",count:0,detail:"no open performance findings"}},"read"),items:o(e=>{let t=(Array.isArray(e.findings)?e.findings:[]).map(H3).filter(i=>!!i),r=t.slice(0,Sd).map(i=>{let u=Te(i.rule)??"perf",n=Te(i.project)??"?",a=Te(i.subject)??"?",l=Array.isArray(i.fix)?i.fix.filter(d=>typeof d=="string"):[];return{source:"perf",severity:"warning",title:`${u} \xB7 ${Te(i.title)??n}`,fingerprint:`agent-status:perf-rule:${u}:${n}:${a}`,resource:Le,rule:u,...l.length?{fix:K3({fix:l})}:{},...Te(i.verify)?{verify:Te(i.verify)}:{},...Te(i.docs)?{docs:Te(i.docs)}:{}}});return t.length>Sd&&r.push({source:"perf",severity:"warning",title:`${fe(t.length-Sd,"more performance finding")} \u2014 read ${Le}`,fingerprint:"agent-status:perf-rules:more",resource:Le}),r},"items")}],Sd=5,Y3=new WeakMap,M_=ns.map(e=>e.resource);async function Q3(e,t){let r={kind:t.kind,resource:t.resource},i;try{i=H3(await e.read(t.resource))}catch{return{...r,producer:"none",state:"unknown",detail:`no producer for ${t.resource} \u2014 this signal is unmonitored, not healthy`,reads:t.reads("unknown")}}if(!i)return{...r,producer:"none",state:"unknown",detail:`${t.resource} produced no readable payload`,reads:t.reads("unknown")};let u=Te(i.producer),n=(e.revision(t.resource)??0)>0,a=u==="none"?"none":u==="connected"||n?"connected":"none",l=Te(i.detail);if(a==="none")return{...r,producer:a,state:"unknown",detail:l??(u==="none"?`${t.resource} reports no producer attached \u2014 this signal is unmonitored, not healthy`:`${t.resource} is registered but has never reported \u2014 this signal is unmonitored, not healthy`),reads:t.reads("unknown")};let d;try{d=t.read(i)}catch{d={state:"unknown",detail:`${t.resource} payload could not be interpreted`}}let c=i.stale===!0,p=c?`${d.detail} (as of ${bt(i.ageMs)!==void 0?e6(bt(i.ageMs)):"a while ago"}; nothing has re-checked since)`:d.detail,m={...r,producer:a,state:d.state,...d.count===void 0?{}:{count:d.count},...c?{stale:!0}:{},detail:p,reads:t.reads(d.state)};if(t.items&&(d.state==="warning"||d.state==="failed"))try{let f=t.items(i);f.length&&Y3.set(m,f)}catch{}return m}s(Q3,"qT"),o(Q3,"readSignal");function e6(e){return e<6e4?`${Math.max(1,Math.round(e/1e3))}s ago`:e<36e5?`${Math.round(e/6e4)}m ago`:`${Math.round(e/36e5)}h ago`}s(e6,"VT"),o(e6,"describeAge");async function Fd(e){return Promise.all(ns.map(t=>Q3(e,t)))}s(Fd,"Qs"),o(Fd,"readSignals");var Jr=o(e=>ns.find(t=>t.resource===e.resource)??ns.find(t=>t.kind===e.kind),"specFor");function t6(e){return{source:Jr(e).source,severity:e.state==="failed"?"error":"warning",title:e.detail,fingerprint:`agent-status:${e.kind}:${e.state}`,resource:e.reads[0]??e.resource}}s(t6,"GT"),o(t6,"toItem");function u6(e){let t={failed:3,warning:2,unknown:1,passed:0},r=o(n=>{let a=e.filter(l=>l.kind===n);return a.length===0?"unknown":a.reduce((l,d)=>t[d.state]>t[l]?d.state:l,a[0].state)},"pick"),i=o(n=>n==="failed"?"failed":n==="passed"||n==="warning"?"passed":"unknown","tri"),u=o(n=>n,"quad");return{typecheck:i(r("typecheck")),lint:i(r("lint")),build:i(r("build")),runtime:u(r("runtime")),visual:u(r("visual")),memory:u(r("memory"))}}s(u6,"JT"),o(u6,"toChecks");function r6(e){let t=e.filter(p=>p.state==="failed"),r=e.filter(p=>p.state==="warning"),i=e.filter(p=>p.state==="passed"),u=o(p=>Y3.get(p)??[t6(p)],"itemsOf"),n=t.filter(p=>Jr(p).blocking).flatMap(u),a=[...t.filter(p=>!Jr(p).blocking),...r].flatMap(u),l=n.length>0?"failing":a.length>0?"warning":i.length>0?"clean":"starting",d=[...t.filter(p=>Jr(p).blocking).flatMap(p=>p.reads),...t.filter(p=>!Jr(p).blocking).flatMap(p=>p.reads),...r.flatMap(p=>p.reads)],c=[...new Set(d)];return c.length===0&&c.push("events://recent"),{status:l,blocking:n,warnings:a,suggestedReads:c,checks:u6(e)}}s(r6,"X$"),o(r6,"deriveVerdict");function i6(e=process.env){let t=e.LENSMCP_TRANSPORT==="http"||e.LENSMCP_TRANSPORT==="socket",r=e.LENSMCP_PORT;return{mode:t?"shared":"embedded",pid:process.pid,startedAt:new Date(Date.now()-Math.round(process.uptime()*1e3)).toISOString(),...t&&r?{url:`http://127.0.0.1:${r}/mcp`}:{}}}s(i6,"WT"),o(i6,"readServerInfo");async function ss(e){let t=await Fd(e.resources),r=r6(t);return{schemaVersion:1,revision:e.revision,updatedAt:new Date().toISOString(),sessionId:e.sessionId,server:i6(),status:r.status,blocking:r.blocking,warnings:r.warnings,suggestedReads:r.suggestedReads,checks:r.checks,signals:t}}s(ss,"ar"),o(ss,"aggregateStatus");var jd="agent://current-status",zd=class extends z${static{s(this,"qm")}static{o(this,"AgentCurrentStatusResource")}async execute(){let e=this.get(Z);try{return await e.read(jd)}catch{}let t=this.get(Pr);return ss({resources:e,sessionId:t.id,revision:e.revision(jd)??0})}};zd=F([j$({name:"agent-current-status",uri:jd,mimeType:"application/json",description:'Workspace health in one read: status (clean/warning/failing/starting), what is BLOCKING (typecheck/lint/build errors, browser runtime errors, wedged or crash-looping services), warnings, and the exact resources to read next. Signals with no producer report `producer: "none"` \u2014 unmonitored, not healthy.'})],zd);var G$=zd;import{Resource as K$,ResourceContext as H$}from"@frontmcp/sdk";var Nd=class extends H${static{s(this,"Gm")}static{o(this,"ProcessClusterResource")}async execute(){return this.get(Z).read("process://cluster")}};Nd=F([K$({name:"process-cluster",uri:"process://cluster",mimeType:"application/json",description:"Dev-cluster service health: which services are up / down / wedged / crash-looping, which fail to build, restart counts, and the error lines services printed (ERROR in, EADDRINUSE, and error TS\u2026 for a project no typecheck producer reports for \u2014 otherwise type errors are in typecheck://errors). Read this when a request 502s or a dev server stopped responding."})],Nd);var X$=Nd;import{Resource as Y$,ResourceContext as Q$}from"@frontmcp/sdk";var Md=class extends Q${static{s(this,"Wm")}static{o(this,"PerfRulesResource")}async execute(){return this.get(Z).read("perf://rules")}};Md=F([Y$({name:"perf-rules",uri:"perf://rules",mimeType:"application/json",description:"Performance problems the lens detected by rule, each with a stable rule id, the measured evidence, the estimated cost (modules / MB / compile ms), the FIX steps and a VERIFY step: bundle/heavy-barrel-import (a service compiles most of a shared library through its root barrel while using a few symbols), pod/heap-budget (a dev pod's live heap after GC is over its budget), pod/retained-generation (a hot-swapped app copy is still in memory). A finding is retracted when the next build or memory report no longer shows it \u2014 that is how to prove a fix."})],Md);var eB=Md;import{Tool as tB,ToolContext as uB}from"@frontmcp/sdk";var n6=["typecheck","lint","build","runtime","cluster"],rB=[...n6,"all"],iB={typecheck:[{signal:"typecheck://current",resource:"typecheck://errors",keys:["errors"],hint:"TypeScript diagnostics from the watching tsc. Already computed \u2014 no need to run `nx typecheck`."}],lint:[{signal:"lint://current",resource:"lint://errors",keys:["errors"],hint:"ESLint errors from the watching lint pass. Already computed \u2014 no need to run `nx lint`."}],build:[{signal:"build://current",resource:"build://failures",keys:["failures"],hint:"Bundler/compile failures. The dev server is serving a stale or broken bundle until these clear."}],runtime:[{signal:"runtime://browser/errors",resource:"runtime://browser/errors",keys:["entries"],hint:"Uncaught errors from the browser. Pair with flow_list_recent to see what the user did first."},{signal:"runtime://errors",resource:"runtime://errors",keys:["entries"],hint:"Errors a dev service raised while handling a request (a 500 from a curl, an e2e runner or the page) \u2014 route, status, request id and stack. No browser is involved."}],cluster:[{signal:"process://cluster",resource:"process://cluster",keys:["errors"],hint:"Error lines printed by dev services (ERROR in / EADDRINUSE; error TS only for a project no typecheck producer reports for). A wedged or crash-looping service 502s every request routed to it."}]},nB=o(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,"asRecord");async function s6(e,t){let r;try{r=nB(await e.read(t.resource))}catch{return[]}if(!r)return[];for(let i of t.keys){let u=r[i];if(Array.isArray(u))return u}return[]}s(s6,"nA"),o(s6,"readItems");async function a6(e){let t=e.kind==="all"?n6:[e.kind],r=await Fd(e.resources),i=new Map(r.map(n=>[n.resource,n])),u=[];for(let n of t)for(let a of iB[n]){let l=i.get(a.signal),d=l?.producer??"none",c=l?.state??"unknown",p=d==="none"?[]:await s6(e.resources,a);u.push({kind:n,resource:a.resource,producer:d,state:c,count:p.length,returned:Math.min(p.length,e.limit),items:p.slice(0,e.limit),detail:l?.detail??`no producer for ${a.resource} \u2014 unmonitored, not healthy`,hint:a.hint})}return{kind:e.kind,totalErrors:u.reduce((n,a)=>n+a.count,0),unmonitored:[...new Set(u.filter(n=>n.producer==="none").map(n=>n.kind))],groups:u}}s(a6,"Ym"),o(a6,"collectErrors");var o6={name:"observe.current_status",description:'Workspace health in one call: whether anything is BLOCKING right now (typecheck errors, lint errors, build failures, browser runtime errors, wedged or crash-looping dev services), plus warnings and the exact resources to read next. Warnings include PERFORMANCE problems found by rule (a service compiling a whole shared library through its root barrel, a dev pod over its heap budget, a hot-swapped app copy still in memory), each with its rule id, a fix and how to verify it. Call this FIRST when a build, dev server, or page looks broken \u2014 and before running `nx typecheck` / `nx lint` for a project the dev cluster already watches, because those results are already computed here. Signals reporting `producer: "none"` are UNMONITORED, not healthy. Use observe.errors for the individual error items.'},Vt={name:"observe.errors",description:"The actual error items the lens already computed: TypeScript diagnostics, ESLint errors, build failures, uncaught browser errors, server-side request errors (a dev service's 500: route, status, stack), and error lines printed by dev services (ERROR in\u2026, error TS\u2026, EADDRINUSE). Filter with `kind`. Prefer this over running `nx typecheck` / `nx lint` or tailing a dev-server log for a project the dev cluster watches: the watching producers already have the answer, so this costs one call instead of a rebuild. Each group reports `producer` \u2014 `none` means nothing is feeding that check, so an empty list there is NOT proof it is clean.",kinds:rB,defaultKind:"all",defaultLimit:25,maxLimit:200},as={name:"observe.dismiss_errors",description:"Hide runtime errors that are already UNDERSTOOD and are not a problem to fix \u2014 a 401 your own signed-out test browser caused, a failure from a fixture that exists to throw \u2014 so they stop counting in observe.current_status and the Stop hook. Give the entry `ids` from observe.errors (kind `runtime`), or `all: true`, and a `reason`: it is recorded with the dismissal and shown to the person in the dashboard. This HIDES, it does not fix: each error shows again the next time it happens. It cannot dismiss a failing typecheck, lint, build or a broken service \u2014 those are current verdicts and clear only when the code is fixed. Never dismiss an error you have not explained; undo with observe.restore_errors.",maxIds:250,minReasonChars:8},Od={name:"observe.restore_errors",description:"Undo a dismissal, so the errors it hid are listed and counted again. Give the dismissal `ids` from runtime://dismissed (or the id of an entry it hid), or `all: true` for every dismissal in effect \u2014 including ones a person made in the dashboard.",maxIds:250},l6="agent://current-status",Rd=class extends uB{static{s(this,"eh")}static{o(this,"ObserveCurrentStatusTool")}async execute(){let e=this.get(Z);try{return await e.read(l6)}catch{}let t=this.get(Pr);return ss({resources:e,sessionId:t.id,revision:e.revision(l6)??0})}};Rd=F([tB({name:o6.name,description:o6.description,inputSchema:{}})],Rd);var sB=Rd;import{Tool as aB,ToolContext as oB,z as d6}from"@frontmcp/sdk";var Td=class extends oB{static{s(this,"rh")}static{o(this,"ObserveErrorsTool")}async execute(e){let t=this.get(Z);return a6({resources:t,kind:e.kind,limit:e.limit})}};Td=F([aB({name:Vt.name,description:Vt.description,inputSchema:{kind:d6.enum(Vt.kinds).default(Vt.defaultKind).describe("Which failures to return. 'runtime' = browser errors AND a service's own request errors (the 500 case); 'cluster' = dev-service/pod errors (the 502 case). Default 'all'."),limit:d6.number().int().positive().max(Vt.maxLimit).default(Vt.defaultLimit).describe(`Max items per kind (default ${Vt.defaultLimit}). \`count\` still reports the true total.`)}})],Td);var lB=Td;import{Tool as dB,ToolContext as cB,z as Wr}from"@frontmcp/sdk";import{appendFileSync as pB,closeSync as mB,mkdirSync as fB,openSync as hB,renameSync as gB,statSync as vB,unlinkSync as yB}from"node:fs";import{dirname as EB,join as bB}from"node:path";function c6(e,t){let{fs:r,maxBytes:i,maxFiles:u}=t,n=`${e}.rotate.lock`,a=t.staleLockMs??3e4,l;for(let d=0;d<2&&l===void 0;d++)try{l=r.openSync(n,"wx")}catch{try{if(Date.now()-r.statSync(n).mtimeMs<=a)return"busy";r.unlinkSync(n)}catch{}}if(l===void 0)return"busy";try{try{if(r.statSync(e).size<=i)return"not-needed"}catch{return"not-needed"}try{r.unlinkSync(`${e}.${u}`)}catch{}for(let d=u-1;d>=1;d--)try{r.renameSync(`${e}.${d}`,`${e}.${d+1}`)}catch{}try{r.renameSync(e,`${e}.1`)}catch{}return"rotated"}finally{try{r.closeSync(l)}catch{}try{r.unlinkSync(n)}catch{}}}s(c6,"Q$"),o(c6,"rotateBusFile");function p6(e=process.env,t=process.cwd()){return e.LENSMCP_EVENT_FILE??bB(t,".lensmcp","events.jsonl")}s(p6,"t_"),o(p6,"lensEventFile");var m6=o((e,t,r,i,u)=>({id:lt(),sessionId:e,timestamp:t,source:e3,category:"runtime",severity:"info",context:{sessionId:e},fingerprint:r,title:i,raw:u}),"lensEvent");function Pd(e,t){return m6(t,e.until,`${wu}:${e.groupId}`,`error dismissed: ${e.title??e.groupId}`,{kind:wu,groupId:e.groupId,until:e.until,eventIds:e.eventIds,...e.by?{by:e.by}:{},...e.reason?{reason:e.reason}:{},...e.title?{title:e.title}:{}})}s(Pd,"ta"),o(Pd,"dismissalEvent");function Ud(e,t,r){return m6(t,r,`${Wn}:${e}`,"error restored",{kind:Wn,groupId:e})}s(Ud,"ra"),o(Ud,"restoralEvent");var f6=o((e,t,r)=>{let i=Number(process.env[e]);return Number.isFinite(i)&&r(i)?i:t},"envNumber");function os(e,t){t.length!==0&&(fB(EB(e),{recursive:!0}),c6(e,{maxBytes:f6("LENSMCP_EVENT_MAX_BYTES",50*1024*1024,r=>r>0),maxFiles:f6("LENSMCP_EVENT_MAX_FILES",5,r=>r>=1&&r<=20),fs:{statSync:vB,renameSync:gB,unlinkSync:yB,openSync:hB,closeSync:mB}}),pB(e,t.map(r=>JSON.stringify(r)+`
|
|
69
|
+
`).join("")))}s(os,"an"),o(os,"appendBusEvents");var wB=["runtime://errors","runtime://browser/errors","runtime://browser/failed-requests"],DB="runtime://dismissed";async function h6(e,t){let r;try{r=await e.read(t)}catch{return[]}let i=r?.entries;return Array.isArray(i)?i.flatMap(u=>{let n=u;if(!n||typeof n.id!="string"||!n.id)return[];let a=typeof n.title=="string"&&n.title?n.title:typeof n.message=="string"?n.message:n.id;return[{id:n.id,title:a,timestamp:typeof n.timestamp=="number"?n.timestamp:0}]}):[]}s(h6,"wA"),o(h6,"entriesOf");async function g6(e,t,r=Date.now()){let i=new Set(t.ids??[]),u=[],n=r;for(let c of wB)for(let p of await h6(e,c))!t.all&&!i.has(p.id)||u.some(m=>m.id===p.id)||(u.push({id:p.id,title:p.title,resource:c}),n=Math.max(n,p.timestamp));let a=new Set(u.map(c=>c.id)),l=t.reason.trim().slice(0,500),d=[];for(let c=0;c<u.length;c+=200){let p=u.slice(c,c+200),m=p[0]?.title??"";d.push({groupId:`events:${lt()}`,until:n,eventIds:p.map(f=>f.id),by:t.by??"agent",reason:l,title:p.length===1?m:`${p.length} errors \u2014 ${m}`})}return{drafts:d,items:u,notFound:[...i].filter(c=>!a.has(c))}}s(g6,"n_"),o(g6,"planDismissal");async function v6(e,t){let r;try{r=await e.read(DB)}catch{r=void 0}let i=r?.dismissals,u=(Array.isArray(i)?i:[]).flatMap(d=>{let c=d;return c&&typeof c.id=="string"?[{id:c.id,eventIds:Array.isArray(c.eventIds)?c.eventIds.filter(p=>typeof p=="string"):[]}]:[]});if(t.all)return{keys:u.map(d=>d.id),notFound:[]};let n=[...new Set(t.ids??[])],a=new Set,l=[];for(let d of n){let c=u.filter(p=>p.id===d||p.eventIds.includes(d));c.length===0&&l.push(d);for(let p of c)a.add(p.id)}return{keys:[...a],notFound:l}}s(v6,"o_"),o(v6,"planRestore");var $B="Hidden, not fixed. Each of these shows again the next time it happens, and runtime://dismissed lists what is hidden, by whom and why.",qd=class extends cB{static{s(this,"oh")}static{o(this,"ObserveDismissErrorsTool")}async execute(e){if(!e.all&&!e.ids?.length)return{dismissed:0,items:[],notFound:[],note:"Nothing named: pass `ids` (from observe.errors, kind runtime) or `all: true`."};let t=this.get(Z),r=this.get(Pr),i=await g6(t,e),u=i.drafts.map(a=>Pd(a,r.id)),n=process.env.LENSMCP_EVENT_FILE;if(n)os(n,u);else for(let a of u)this.get(Ur).publish(a);return{dismissed:i.items.length,items:i.items,notFound:i.notFound,note:i.items.length?$B:"Nothing was dismissed: none of those ids is in a runtime error list right now."}}};qd=F([dB({name:as.name,description:as.description,inputSchema:{ids:Wr.array(Wr.string().min(1)).max(as.maxIds).optional().describe("Entry ids to dismiss \u2014 the `id` of items observe.errors returns for kind `runtime`."),all:Wr.boolean().optional().describe("Dismiss every runtime error currently listed (server-side, browser, failed requests)."),reason:Wr.string().min(as.minReasonChars).describe("Why these are not a problem to fix. Recorded with the dismissal and shown to the person in the dashboard."),by:Wr.enum(["agent","cli"]).default("agent").describe("Who is dismissing. Leave as 'agent'; the lensmcp CLI passes 'cli'.")}})],qd);var BB=qd;import{Tool as xB,ToolContext as CB,z as Zd}from"@frontmcp/sdk";var Ld=class extends CB{static{s(this,"ah")}static{o(this,"ObserveRestoreErrorsTool")}async execute(e){if(!e.all&&!e.ids?.length)return{restored:0,notFound:[],note:"Nothing named: pass dismissal `ids` (from runtime://dismissed) or `all: true`."};let t=this.get(Z),r=this.get(Pr),i=await v6(t,e),u=Date.now(),n=i.keys.map(l=>Ud(l,r.id,u)),a=process.env.LENSMCP_EVENT_FILE;if(a)os(a,n);else for(let l of n)this.get(Ur).publish(l);return{restored:i.keys.length,notFound:i.notFound,note:i.keys.length?"Restored: what those dismissals hid is listed and counted again.":"Nothing was restored: no dismissal matches."}}};Ld=F([xB({name:Od.name,description:Od.description,inputSchema:{ids:Zd.array(Zd.string().min(1)).max(Od.maxIds).optional().describe("Dismissal ids from runtime://dismissed, or ids of entries a dismissal hid."),all:Zd.boolean().optional().describe("Undo every dismissal in effect.")}})],Ld);var kB=Ld;import{spawn as AB}from"node:child_process";import{existsSync as Vd,readFileSync as IB}from"node:fs";import{join as y6}from"node:path";import{Job as _B,JobContext as SB,z as Ie}from"@frontmcp/sdk";import{existsSync as FB}from"node:fs";import{dirname as jB,join as zB,relative as NB,resolve as Jt,isAbsolute as MB}from"node:path";var OB=6;function E6(e=process.env,t=process.cwd()){return Jt(e.LENSMCP_WORKSPACE_ROOT??t)}s(E6,"s_"),o(E6,"resolveAllowedRoot");function ls(e,t){let r=NB(Jt(e),Jt(t));return r===""||!r.startsWith("..")&&!MB(r)}s(ls,"uh"),o(ls,"isWithinRoot");function b6(e,t){let r=Jt(e);if(t===void 0)return{ok:!0,cwd:r};let i=Jt(r,t);return ls(r,i)?{ok:!0,cwd:i}:{ok:!1,reason:`cwd ${i} is outside this server's workspace (${r}). verify_fix runs a workspace-defined Nx target, so it only runs in the workspace this server was started for. Set LENSMCP_WORKSPACE_ROOT to serve a different one.`}}s(b6,"a_"),o(b6,"confineToWorkspace");function w6(e,t){let r=Jt(t),i=Jt(e);if(ls(r,i))for(let u=0;u<OB;u++){if(FB(zB(i,"nx.json")))return i;if(i===r)break;let n=jB(i);if(n===i||!ls(r,n))break;i=n}}s(w6,"c_"),o(w6,"findNxWorkspaceRootWithin");var RB=/^[@A-Za-z0-9][\w./-]*$/;function D6(e){return e.length<=214&&RB.test(e)}s(D6,"u_"),o(D6,"isValidProjectName");var Jd=class extends SB{static{s(this,"dh")}static{o(this,"VerifyFixJob")}async execute(e){let t=Date.now(),r=e.project??process.env.LENSMCP_VERIFY_PROJECT??"example-web",i=E6(),u=b6(i,e.cwd);if(!u.ok)return this.log(`[verify_fix] refused: ${u.reason}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let n=u.cwd;if(!D6(r))return this.log(`[verify_fix] refused: ${r} is not a valid Nx project name`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let a=w6(n,i);if(!a)return this.log(`No nx.json found between ${n} and ${i}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};let l=$6("nx",[a]);if(!l)return this.log(`Could not find node_modules/.bin/nx under ${a}`),{status:"errored",project:r,durationMs:Date.now()-t,stages:[],reportPath:null};this.log(`[verify_fix] nx run ${r}:agent-verify (cwd=${a})`);let d=AB(l,["run",`${r}:agent-verify`],{cwd:a,env:{...process.env},stdio:["ignore","pipe","pipe"]}),c=[],p=o(x=>{let $=/\[agent-verify\] ([a-z]+): (passed|failed|skipped|errored)/.exec(x);$&&$[1]&&$[2]&&(c.push({name:$[1],result:$[2],durationMs:0}),this.log(` ${$[1]}: ${$[2]}`))},"captureLine");Wd(d.stdout,p),Wd(d.stderr,p);let m=!1,f=setTimeout(()=>{m=!0;try{d.kill("SIGTERM")}catch{}},e.timeoutMs),h=await new Promise(x=>{d.on("exit",$=>x($??1))});if(clearTimeout(f),m)return{status:"timeout",project:r,durationMs:Date.now()-t,stages:c,reportPath:null};let g=y6(a,".lensmcp","verifications","latest.json"),b;if(Vd(g))try{b=JSON.parse(IB(g,"utf-8"))}catch{b=void 0}return{status:b?.status??(h===0?"passed":"failed"),project:r,durationMs:b?.durationMs??Date.now()-t,stages:b?.stages??c,reportPath:Vd(g)?g:null}}};Jd=F([_B({name:"observe.verify_fix",description:"Run the deterministic verification loop (typecheck \u2192 lint \u2192 build) for a host project. Returns a per-stage report; suggested next read on failure is the relevant *://errors resource.",inputSchema:{project:Ie.string().describe('Nx project name in the host workspace to verify. Defaults to LENSMCP_VERIFY_PROJECT or "example-web".').optional(),cwd:Ie.string().describe("Directory to verify from. MUST be inside the workspace this server was started for (LENSMCP_WORKSPACE_ROOT, else the server's cwd); a path outside it is refused. Defaults to that workspace root.").optional(),timeoutMs:Ie.number().int().positive().default(5*6e4).describe("How long to wait for the verify pipeline before declaring it stuck.")},outputSchema:{status:Ie.enum(["passed","failed","errored","timeout"]),project:Ie.string().nullable(),durationMs:Ie.number(),stages:Ie.array(Ie.object({name:Ie.string(),result:Ie.enum(["passed","failed","skipped","errored"]),durationMs:Ie.number(),exitCode:Ie.number().optional(),summary:Ie.string().optional()})),reportPath:Ie.string().nullable()}})],Jd);var TB=Jd;function $6(e,t){for(let r of t){let i=y6(r,"node_modules",".bin",e);if(Vd(i))return i}}s($6,"PA"),o($6,"locateBin");function Wd(e,t){if(!e)return;let r="";e.setEncoding("utf-8"),e.on("data",i=>{r+=typeof i=="string"?i:i.toString("utf-8");let u;for(;(u=r.indexOf(`
|
|
70
|
+
`))!==-1;){let n=r.slice(0,u);r=r.slice(u+1),t(n)}}),e.on("end",()=>{r.length&&t(r)})}s(Wd,"l_"),o(Wd,"bufferLines");var B6=class{static{s(this,"fh")}static{o(this,"AgentApp")}};B6=F([F$({id:"agent",name:"Agent",description:"Agent-facing summary, suggested reads, verification.",resources:[G$,X$,eB],tools:[sB,lB,BB,kB],jobs:[TB]})],B6);var PB={"service-starting":"starting","service-respawn":"starting","lens-app-up":"starting","service-up":"up","cold-start":"up","service-down":"down","idle-kill":"idle","service-recycle":"wedged","pod-recycle":"wedged","service-crash-loop":"crash-looping","lens-handoff-complete":"up","gateway-up":"up","gateway-down":"down","lens-child-starting":"starting","lens-child-up":"up","lens-child-exit":"down"},UB=new Set(["service-respawn","service-recycle","pod-recycle","lens-handoff-complete"]),x6=new Set(["build","types","process"]),C6=o(e=>x6.has(e)?e:"unknown","faultOf"),qB=class{static{s(this,"$o")}static{o(this,"ClusterHealth")}constructor(){this.services=new Map,this.errors=[],this.typechecked=new Set}ingest(e){if(e.category==="typecheck")return this.noteTypecheck(e);if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw??{},r=typeof t.kind=="string"?t.kind:void 0;if(!r)return!1;let i=typeof t.project=="string"?t.project:void 0;if(!i)return!1;if(r==="service-error"){let a=C6(t.fault),l=this.touch(i,e.timestamp);if(l.faults.add(a),l.lastTitle=e.title,a==="types"&&this.typechecked.has(i))return!0;let d=typeof t.line=="string"?t.line:e.message??e.title;return this.errors.push({project:i,timestamp:e.timestamp,line:d,fingerprint:e.fingerprint,fault:a}),this.errors.length>50&&this.errors.splice(0,this.errors.length-50),!0}if(r==="service-fault-closed"){let a=this.services.get(i),l=Array.isArray(t.closed)?t.closed.filter(d=>x6.has(d)).map(C6):[];return!a||l.length===0?!1:(a.lastSeenAt=e.timestamp,a.lastTitle=e.title,this.resolve(a,l),!0)}if(r==="service-recovered"){let a=this.services.get(i);return a?(a.lastSeenAt=e.timestamp,this.resolve(a),a.lastTitle=e.title,!0):!1}if(r==="lens-handoff-start"){let a=this.touch(i,e.timestamp);return t.oldServing!==!0&&(a.state="starting"),a.lastTitle=e.title,!0}if(r==="lens-handoff-failed"){let a=this.touch(i,e.timestamp);return t.oldKept!==!0&&(a.state="down"),a.lastTitle=e.title,!0}let u=PB[r];if(!u)return!1;let n=this.touch(i,e.timestamp);return n.state=u,n.lastTitle=e.title,UB.has(r)&&(n.restarts+=1),u==="up"&&this.resolve(n),!0}resolve(e,t){if(t)for(let i of t)e.faults.delete(i);else e.faults.clear();let r=o(i=>i.project===e.project&&(!t||t.includes(i.fault)),"gone");this.errors.splice(0,this.errors.length,...this.errors.filter(i=>!r(i)))}noteTypecheck(e){let t=e.raw??{};if(t.kind!=="typecheck-run"||t.phase!=="end"||typeof t.project!="string")return!1;let r=t.project,i=t.status==="clean"||t.status==="failing";return i===this.typechecked.has(r)?!1:(i?(this.typechecked.size>=100&&this.typechecked.delete(this.typechecked.values().next().value),this.typechecked.add(r),this.errors.splice(0,this.errors.length,...this.errors.filter(u=>!(u.project===r&&u.fault==="types")))):this.typechecked.delete(r),this.services.get(r)?.faults.has("types")??!1)}snapshot(){let e=[...this.services.values()].sort((r,i)=>r.project.localeCompare(i.project)).map(({faults:r,...i})=>({...i,buildFailed:r.has("build")||r.has("process")||r.has("unknown"),typeErrors:r.has("types")&&!this.typechecked.has(i.project)})),t=o(r=>e.filter(i=>i.state===r).map(i=>i.project),"byState");return{services:e,up:t("up"),down:t("down"),wedged:t("wedged"),crashLooping:t("crash-looping"),idle:t("idle"),buildFailed:e.filter(r=>r.buildFailed).map(r=>r.project),typeErrors:e.filter(r=>r.typeErrors).map(r=>r.project),restarts:e.reduce((r,i)=>r+i.restarts,0),errors:this.errors.slice()}}touch(e,t){let r=this.services.get(e);if(!r){if(this.services.size>=100){let i;for(let u of this.services.values())(!i||u.lastSeenAt<i.lastSeenAt)&&(i=u);i&&this.services.delete(i.project)}r={project:e,state:"starting",restarts:0,faults:new Set,lastTitle:"",lastSeenAt:t},this.services.set(e,r)}return r.lastSeenAt=t,r}},ds="agent://current-status",cs="process://cluster",ZB=250,LB=new Set(["build","lint","typecheck","runtime","cluster","memory","visual","performance"]);function k6(e){let t=new qB,r=e.sessionId??"pending",i=new W$({thresholds:e.podRules??G3(),sessionId:r,publish:o(d=>e.bus.publish(d),"publish")}),u,n=o(()=>{u||(u=setTimeout(()=>{u=void 0,e.resources.markDirty(ds)},ZB),u.unref?.())},"scheduleStatusRefresh"),a=o(d=>{let c=t.ingest(d);c&&e.resources.markDirty(cs);let p=i.ingest(d);p&&e.resources.markDirty(Le),(c||p||LB.has(d.category))&&n()},"handler"),l=e.bus.subscribe(a);return e.resources.register(cs,()=>({schemaVersion:1,revision:e.resources.revision(cs)??0,updatedAt:new Date().toISOString(),...t.snapshot()})),e.resources.register(Le,()=>i.report(e.resources.revision(Le)??0)),e.resources.register(ds,()=>ss({resources:e.resources,sessionId:r,revision:e.resources.revision(ds)??0})),{unsubscribe:o(()=>{l(),u&&(clearTimeout(u),u=void 0)},"unsubscribe"),uris:[ds,cs,Le]}}s(k6,"mh"),o(k6,"installAgentReducer");import{App as VB}from"@frontmcp/sdk";import{Resource as JB,ResourceContext as WB}from"@frontmcp/sdk";var Gd=class extends WB{static{s(this,"hh")}static{o(this,"FlowRecentResource")}async execute(){return this.get(Z).read("flow://recent")}};Gd=F([JB({name:"flow-recent",uri:"flow://recent",mimeType:"application/json",description:"Last 50 flows seen this session, most recent first."})],Gd);var GB=Gd;import{Resource as KB,ResourceContext as HB}from"@frontmcp/sdk";var Kd=class extends HB{static{s(this,"vh")}static{o(this,"FlowCurrentResource")}async execute(){return this.get(Z).read("flow://current")}};Kd=F([KB({name:"flow-current",uri:"flow://current",mimeType:"application/json",description:"The most recently active flow (origin + event count + headline)."})],Kd);var XB=Kd;import{Resource as YB,ResourceContext as QB}from"@frontmcp/sdk";var Hd=class extends QB{static{s(this,"bh")}static{o(this,"FlowOriginsRecentResource")}async execute(){return this.get(Z).read("flow://origins/recent")}};Hd=F([YB({name:"flow-origins-recent",uri:"flow://origins/recent",mimeType:"application/json",description:"Last 50 flow-origin events (one per detected flow start)."})],Hd);var e2=Hd;import{Tool as t2,ToolContext as u2,z as ps}from"@frontmcp/sdk";var A6;function Xd(e){A6=e}s(Xd,"sa"),o(Xd,"setActiveFlowLookups");function Qe(){return A6}s(Qe,"ke"),o(Qe,"activeFlowLookups");var I6;function Yd(e){I6=e}s(Yd,"aa"),o(Yd,"setFlowRecoverySource");function Qd(){return I6}s(Qd,"_o"),o(Qd,"flowRecoverySource");import{existsSync as r2}from"node:fs";import{open as i2}from"node:fs/promises";import{basename as n2}from"node:path";var ms="flow://recent",fs="flow://current",hs="flow://origins/recent",xu=50,_6=50,ec=2e3,s2=4*1024*1024,tc=32*1024*1024,a2=xu+10;function uc(e){let t={flows:new Map,origins:[],recentOrder:[],retainedEvents:0,retainedBytes:0,evictedEvents:0,evictedForBytes:0,evictedFlows:0},r=e.register??!0,i=o((m,f,h,g=!0)=>{let b=Math.min(f,m.events.length);if(b<=0)return;if(g&&b>0&&(m.events[0]?.raw??{}).kind==="flow-origin"&&m.events.length>1){let $=m.eventBytes[1]??0;if(m.events.splice(1,1),m.eventBytes.splice(1,1),m.retainedBytes=Math.max(0,m.retainedBytes-$),t.retainedEvents=Math.max(0,t.retainedEvents-1),t.retainedBytes=Math.max(0,t.retainedBytes-$),t.evictedEvents+=1,h&&(t.evictedForBytes+=1),b-=1,b<=0)return}let x=0;for(let $=0;$<b;$+=1)x+=m.eventBytes[$]??0;m.events.splice(0,b),m.eventBytes.splice(0,b),m.retainedBytes=Math.max(0,m.retainedBytes-x),t.retainedEvents=Math.max(0,t.retainedEvents-b),t.retainedBytes=Math.max(0,t.retainedBytes-x),t.evictedEvents+=b,h&&(t.evictedForBytes+=b)},"evictPrefix"),u=o(m=>{let f=0,h=m.retainedBytes;for(;h>s2&&f<m.eventBytes.length;)h-=m.eventBytes[f]??0,f+=1;i(m,f,!0)},"enforceEntryByteCap"),n=o(()=>{for(let m=t.recentOrder.length-1;t.retainedBytes>tc&&m>=0;m-=1){let f=t.flows.get(t.recentOrder[m]);if(!f)continue;let h=0,g=t.retainedBytes;for(;g>tc&&h<f.eventBytes.length;)g-=f.eventBytes[h]??0,h+=1;i(f,h,!0)}},"enforceGlobalByteCap"),a=o(m=>{let f=m.context.flowId;if(!f)return;let h=(m.raw??{}).kind;if(h==="subscription-added"||h==="subscription-removed"||h==="hook-run"||h==="store-created"||h==="singleton-instance"||h==="visual-frame")return;let g=h==="flow-origin";(t.seenSince===void 0||m.timestamp<t.seenSince)&&(t.seenSince=m.timestamp);let b=t.flows.get(f);if(!b){b={summary:{flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,startedAt:m.timestamp,lastSeenAt:m.timestamp,eventCount:0,headline:m.title},events:[],eventBytes:[],retainedBytes:0,hasOrigin:!1},t.flows.set(f,b);let w={flowId:f,originType:m.context.originType,originNodeId:m.context.originNodeId,at:m.timestamp,label:m.title,eventId:m.id};t.origins.push(w),t.origins.length>_6&&t.origins.splice(0,t.origins.length-_6),e.resources.markDirty(hs)}g&&!b.hasOrigin&&(b.hasOrigin=!0,b.summary.headline=m.title,m.context.originType&&(b.summary.originType=m.context.originType),m.context.originNodeId&&(b.summary.originNodeId=m.context.originNodeId)),m.timestamp<b.summary.startedAt&&(b.summary.startedAt=m.timestamp);let x=us(m);b.events.push(m),b.eventBytes.push(x),b.retainedBytes+=x,t.retainedEvents+=1,t.retainedBytes+=x,b.events.length>ec&&i(b,b.events.length-ec,!1),u(b),b.summary.eventCount+=1,b.summary.lastSeenAt=m.timestamp;let $=t.recentOrder.indexOf(f);if($>=0&&t.recentOrder.splice($,1),t.recentOrder.unshift(f),t.recentOrder.length>xu){let w=t.recentOrder.splice(xu);for(let k of w){let C=t.flows.get(k);C&&(t.evictedFlows+=1,t.evictedThrough=Math.max(t.evictedThrough??0,C.summary.lastSeenAt),i(C,C.events.length,!1,!1)),t.flows.delete(k)}}n(),t.currentFlowId!==f&&(t.currentFlowId=f,e.resources.markDirty(fs)),e.resources.markDirty(ms)},"handler"),l=e.bus.subscribe(a);e.resources.register(ms,()=>({schemaVersion:1,revision:e.resources.revision(ms)??0,updatedAt:new Date().toISOString(),flows:t.recentOrder.map(m=>t.flows.get(m)?.summary).filter(m=>!!m)})),e.resources.register(fs,()=>{let m=t.currentFlowId,f=m?t.flows.get(m):void 0;return{schemaVersion:1,revision:e.resources.revision(fs)??0,updatedAt:new Date().toISOString(),flow:f?.summary??null}}),e.resources.register(hs,()=>({schemaVersion:1,revision:e.resources.revision(hs)??0,updatedAt:new Date().toISOString(),origins:t.origins.slice().reverse()}));let d=e.flows??Et,c=new Map,p={getFlowEvents(m){return t.flows.get(m)?.events.slice().sort((f,h)=>f.timestamp-h.timestamp)},getFlowSummary(m){return t.flows.get(m)?.summary},recentFlowIds(){return t.recentOrder.slice()},findFlowsByOrigin(m){return[...t.flows.values()].filter(f=>f.summary.originNodeId===m).map(f=>f.summary)},flowsConfig:d,analyzeFlow(m){let f=t.flows.get(m);if(!f)return;let h=`${f.summary.eventCount}:${f.events.length}:${f.summary.lastSeenAt}`,g=c.get(m);if(g&&g.key===h)return c.delete(m),c.set(m,g),g.analysis;let b=ts(p.getFlowEvents(m)??[],d);for(c.delete(m),c.set(m,{key:h,analysis:b});c.size>a2;)c.delete(c.keys().next().value);return b},classifiedRecent(m=xu){let f=[];for(let h of t.recentOrder){if(f.length>=m)break;let g=t.flows.get(h)?.summary,b=p.analyzeFlow(h);!g||!b||f.push({summary:g,category:b.classification.category,decidedBy:b.classification.decidedBy,...b.classification.subject?{subject:b.classification.subject}:{},tags:b.classification.tags,segmentCount:b.segmentation.stats.segments,phaseCount:b.segmentation.stats.phases,signalCount:b.segmentation.stats.signal})}return f},window(){return{since:(t.evictedThrough!==void 0?Math.max(t.evictedThrough,t.seenSince??0):t.seenSince)??null,flows:t.flows.size,maxFlows:xu,evicted:t.evictedFlows}}};return r&&Xd(p),{unsubscribe:o(()=>{r&&Xd(void 0),l()},"unsubscribe"),uris:[ms,fs,hs],lookups:p,retentionStats:o(()=>({residentEvents:t.retainedEvents,residentBytes:t.retainedBytes,evictedEvents:t.evictedEvents,evictedForBytes:t.evictedForBytes,eventCap:xu*ec,byteCap:tc}),"retentionStats")}}s(uc,"ko"),o(uc,"installFlowReducer");var rc={maxBytes:320*1024*1024,maxMs:2e3};function S6(e=process.env){let t=Number(e.LENSMCP_FLOW_RECOVER_BYTES??""),r=Number(e.LENSMCP_FLOW_RECOVER_MS??""),i=o(u=>(e[u]??"").trim()!=="","set");return{maxBytes:i("LENSMCP_FLOW_RECOVER_BYTES")&&Number.isFinite(t)&&t>=0?t:rc.maxBytes,maxMs:i("LENSMCP_FLOW_RECOVER_MS")&&Number.isFinite(r)&&r>0?r:rc.maxMs}}s(S6,"Ih"),o(S6,"recoveryBudgetFromEnv");var F6=1024*1024,ic=10;function j6(e,t){let r=[e];for(let i=1;i<=t;i++)r.push(`${e}.${i}`);return r.filter(i=>r2(i))}s(j6,"QA"),o(j6,"busFiles");function z6(e,t){try{let r=JSON.parse(e);return!r||typeof r!="object"||!("id"in r)||!("source"in r)?void 0:r.context?.flowId===t?r:void 0}catch{return}}s(z6,"ej"),o(z6,"eventOf");function N6(e,t,r,i){let u=e.indexOf(t);for(;u!==-1;){let n=e.lastIndexOf(ic,u)+1,a=e.indexOf(ic,u),l=z6(e.toString("utf8",n,a),r);l&&i.push(l),u=e.indexOf(t,a+1)}}s(N6,"tj"),o(N6,"collect");async function M6(e,t,r,i,u){let n=[],a={file:n2(e),size:0,read:0,matched:0},l;try{l=await i2(e,"r")}catch{return{searched:a,events:n}}let d=o(c=>(a.matched=n.length,{searched:a,events:n,...c?{stoppedBy:c}:{}}),"done");try{a.size=(await l.stat()).size;let c=Buffer.allocUnsafe(F6),p=Buffer.alloc(0);for(;a.read<a.size;){if(a.read>=i)return d("bytes");if(Date.now()>=u)return d("time");let m=Math.min(F6,a.size-a.read,i-a.read),{bytesRead:f}=await l.read(c,0,m,a.read);if(f<=0)break;a.read+=f;let h=p.length>0?Buffer.concat([p,c.subarray(0,f)]):c.subarray(0,f),g=h.lastIndexOf(ic);g>=0&&N6(h.subarray(0,g+1),t,r,n),p=Buffer.from(h.subarray(g+1))}}finally{await l.close().catch(()=>{})}return d()}s(M6,"rj"),o(M6,"searchFile");async function O6(e,t,r){let i=Date.now(),u=i+r.maxMs,n=Buffer.from(JSON.stringify(t)),a=[],l=[],d=0,c;for(let p of j6(e.eventFile,e.maxGenerations??20)){let m=await M6(p,n,t,r.maxBytes-d,u);if(a.push(m.searched),d+=m.searched.read,l.push(m.events),m.stoppedBy){c=m.stoppedBy;break}let f=l.some(g=>g.length>0),h=m.events.some(g=>g.raw?.kind==="flow-origin");if(f&&(h||m.events.length===0))break}return{events:l.reverse().flat(),files:a,bytesRead:d,elapsedMs:Date.now()-i,...c?{stoppedBy:c}:{}}}s(O6,"nj"),o(O6,"findFlowOnBus");var o2=4,Gr=new Map,nc=new Map;function R6(e,t){let r=new Hm,i=uc({bus:r,resources:new e4,...t.flows?{flows:t.flows}:{},register:!1});for(let u of e)r.publish(t.prepare(u));return i.unsubscribe(),i.lookups}s(R6,"ij"),o(R6,"replay");var T6="There is no bus file to search (LENSMCP_EVENT_FILE is not set for this server).",l2="Searching the bus files is turned off (LENSMCP_FLOW_RECOVER_BYTES=0).";function sc(e,t,r,i=T6){let u=`This server holds the ${t.maxFlows} most recently active flows${t.since!==null?` (every flow active since ${new Date(t.since).toISOString()})`:""}, and on start replays only the recent tail of the bus \u2014 this id is not among them.`,n=r?`Its search of the bus files ran out of budget (${r.stoppedBy==="time"?`${r.budgetMs} ms`:`${r.budgetBytes} bytes`}) before finding the flow.`:i;return{found:!1,flowId:e,reason:"outside-window",window:t,...r?{searched:r}:{},hint:`${u} ${n} The flow may still exist further back: re-run it to capture it fresh, raise LENSMCP_FLOW_RECOVER_BYTES / LENSMCP_FLOW_RECOVER_MS, or search .lensmcp/events.jsonl* for the id.`}}s(sc,"b_"),o(sc,"outsideWindow");async function P6(e,t,r,i,u){let n=await O6(r,t,i);if(n.events.length>0){let a=R6(n.events,r);if(!a.getFlowSummary(t))return{found:!1,flowId:t};let l={lookups:a,recovered:{from:"bus",files:n.files.filter(d=>d.matched>0).map(d=>d.file),events:n.events.length,complete:n.stoppedBy===void 0}};for(Gr.set(u,l);Gr.size>o2;)Gr.delete(Gr.keys().next().value);return l}if(n.stoppedBy){let a={files:n.files,bytes:n.bytesRead,budgetBytes:i.maxBytes,budgetMs:i.maxMs,stoppedBy:n.stoppedBy};return sc(t,e.window(),a)}return{found:!1,flowId:t}}s(P6,"aj"),o(P6,"search");async function ac(e,t,r){if(e.getFlowSummary(t))return{lookups:e};let i=r?.budget??rc;if(!r||i.maxBytes<=0){let l=e.window();return l.evicted>0?sc(t,l,void 0,r?l2:T6):{found:!1,flowId:t}}let u=`${r.eventFile}\0${t}`,n=Gr.get(u);if(n)return n;let a=nc.get(u);return a||(a=P6(e,t,r,i,u).finally(()=>nc.delete(u)),nc.set(u,a)),a}s(ac,"Rh"),o(ac,"locateFlow");var d2=120;function oc(e,t,r){return{id:e.id,kind:e.kind,label:e.label,category:t,phase:e.phase,startOffsetMs:Math.max(0,e.start-r),durationMs:e.durationMs,events:e.counts.total,signal:e.counts.signal,errors:e.counts.errors,worstSeverity:e.worstSeverity,projects:e.projects,...e.route?{route:e.route}:{},...e.method?{method:e.method}:{},...e.part?{part:e.part}:{},...e.hot?{hot:e.hot}:{},...e.after?{after:e.after}:{},...e.sql?{sql:e.sql}:{}}}s(oc,"Eh"),o(oc,"segmentView");function lc(e,t={}){let{segmentation:r,classification:i,segmentCategories:u}=e,n=Math.max(1,t.maxSegments??d2),a=r.segments.reduce((c,p)=>Math.min(c,p.start),1/0),l=Number.isFinite(a)?a:0,d=r.segments;if(d.length>n){let c=o(m=>m.counts.errors*1e6+m.counts.signal,"rank"),p=new Set([...d].sort((m,f)=>c(f)-c(m)||(m.id<f.id?-1:1)).slice(0,n).map(m=>m.id));d=d.filter(m=>p.has(m.id))}return{flowId:r.flowId,category:i.category,decidedBy:i.decidedBy,...i.subject?{subject:i.subject}:{},tags:i.tags,origin:i.origin,stats:{events:r.stats.events,signal:r.stats.signal,bookkeeping:r.stats.bookkeeping,segments:r.stats.segments,phases:r.stats.phases},phases:r.phases.map(c=>({index:c.index,startOffsetMs:Math.max(0,c.start-l),endOffsetMs:Math.max(0,c.end-l),segmentIds:c.segmentIds})),segments:d.map(c=>oc(c,u[c.id]??"other",l)),segmentsTruncated:d.length<r.segments.length,...r.sql?{sql:r.sql}:{}}}s(lc,"Th"),o(lc,"overviewOf");function U6(e,t,r){let i=t.segmentation.segments.find(n=>n.id===r);if(!i)return;let u=new Set(i.eventIds);return e.filter(n=>u.has(n.id))}s(U6,"w_"),o(U6,"eventsOfSegment");function q6(e,t){return e.filter(r=>(t.category===void 0||r.category===t.category)&&(t.tag===void 0||r.tags.includes(t.tag))&&(t.subject===void 0||r.subject===t.subject))}s(q6,"x_"),o(q6,"filterClassified");function Z6(e){let t=e.map(r=>({category:r.category,...r.subject?{subject:r.subject}:{},id:r.summary.flowId}));return E3(t).map(r=>({category:r.category,count:r.count,subjects:r.subjects.map(i=>({...i.subject!==void 0?{subject:i.subject}:{},count:i.count,flowIds:i.items.map(u=>u.id)}))}))}s(Z6,"$_"),o(Z6,"groupClassified");function L6(e){let t={};for(let r of e)t[r.category]=(t[r.category]??0)+1;return t}s(L6,"__"),o(L6,"categoryCounts");async function V6(e,t,r){if(!e)return cc(e,t);let i=await ac(e,t.flowId,r);if(!("lookups"in i))return i;let u=cc(i.lookups,t);return i.recovered?{...u,recovered:i.recovered}:u}s(V6,"R_"),o(V6,"readFlowDetail");function dc(e,t){let r=new Map(t.map(i=>[i.id,i.raw]));return e.map(i=>"ai"in i||!r.has(i.id)?i:{...i,raw:r.get(i.id)})}s(dc,"k_"),o(dc,"withRaw");function cc(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.getFlowSummary(t.flowId),i=e.getFlowEvents(t.flowId);if(!r||!i)return{found:!1,flowId:t.flowId};let u=e.analyzeFlow(t.flowId);if(t.segmentId){let a=u?U6(i,u,t.segmentId):void 0,l=u?.segmentation.segments.find(p=>p.id===t.segmentId);if(!u||!a||!l)return{found:!1,flowId:t.flowId,segmentId:t.segmentId,reason:"unknown segment id for this flow (the flow may have changed \u2014 re-read overview.segments)",segmentIds:u?.segmentation.segments.map(p=>p.id)??[]};let d=u.segmentation.segments.reduce((p,m)=>Math.min(p,m.start),1/0),{events:c}=Hn(a,{includeRaw:t.includeRaw});return{found:!0,summary:r,segment:oc(l,u.segmentCategories[l.id]??"other",Number.isFinite(d)?d:l.start),truncated:c.length>t.limit,events:t.includeRaw?dc(c.slice(0,t.limit),a):c.slice(0,t.limit)}}let{events:n}=Hn(i,{includeRaw:t.includeRaw});if(t.expand){let a=n.find(c=>c.id===t.expand);if(!a)return{found:!1,flowId:t.flowId,expand:t.expand};let l=new Set(a.memberIds??[a.id]),d=i.filter(c=>l.has(c.id));return{found:!0,flowId:t.flowId,expanded:{id:a.id,title:a.title,count:d.length},events:d.map(c=>({id:c.id,timestamp:c.timestamp,source:c.source,category:c.category,severity:c.severity,title:c.title,message:c.message,...t.includeRaw?{raw:c.raw}:{}}))}}return{found:!0,summary:r,...u?{overview:lc(u)}:{},truncated:n.length>t.limit,events:t.includeRaw?dc(n.slice(0,t.limit),i):n.slice(0,t.limit)}}s(cc,"S_"),o(cc,"getFlowDetail");async function J6(e,t,r){if(e){let u=e.classifiedRecent(),n=q6(u,{...t.category?{category:t.category}:{},...t.tag?{tag:t.tag}:{}}),a=n.slice(0,t.limit);return{flows:a.map(l=>({...l.summary,category:l.category,decidedBy:l.decidedBy,...l.subject?{subject:l.subject}:{},tags:l.tags,segmentCount:l.segmentCount,phaseCount:l.phaseCount,signalCount:l.signalCount})),totalKnown:u.length,matching:n.length,categories:L6(u),...t.groupBy==="category"?{groups:Z6(a)}:{}}}let i=await r();return{flows:i.flows.slice(0,t.limit),totalKnown:i.flows.length}}s(J6,"E_"),o(J6,"listRecentFlows");async function W6(e,t,r){if(!e)return pc(e,t);let i=await ac(e,t.flowId,r);if(!("lookups"in i))return i;let u=pc(i.lookups,t);return i.recovered?{...u,recovered:i.recovered}:u}s(W6,"T_"),o(W6,"readFlowSegments");function pc(e,t){if(!e)return{found:!1,reason:"no active flow reducer"};let r=e.analyzeFlow(t.flowId);return r?{found:!0,...lc(r,{maxSegments:t.maxSegments})}:{found:!1,flowId:t.flowId}}s(pc,"I_"),o(pc,"getFlowSegments");var mc=class extends u2{static{s(this,"Ah")}static{o(this,"FlowListRecentTool")}async execute(e){return J6(Qe(),e,async()=>await this.get(Z).read("flow://recent"))}};mc=F([t2({name:"flow.list_recent",description:'Lists the last N flows with their origin + event count + headline, and what each one IS: `category` (page-load, user-action, api, ai, test, or one you defined in nx.json#lensmcp.flows), `subject` (the templated page, component or route), `tags` (fan-out, has-error, slow, storm\u2026), `segmentCount`/`phaseCount`. Filter with `category` / `tag`; pass `groupBy: "category"` to also get the flows grouped category \u2192 subject; `categories` always counts every known flow per category. Same data as flow://recent but with a tunable limit.',inputSchema:{limit:ps.number().int().positive().max(50).default(10).describe("How many flows to return (default 10, max 50)."),category:ps.string().optional().describe('Only flows in this category, e.g. "page-load" or "checkout".'),tag:ps.string().optional().describe('Only flows carrying this tag, e.g. "has-error" or "fan-out".'),groupBy:ps.enum(["none","category"]).default("none").describe('"category" adds `groups`: the returned flows grouped category \u2192 subject.')}})],mc);var c2=mc;import{Tool as p2,ToolContext as m2,z as Kr}from"@frontmcp/sdk";var fc=class extends m2{static{s(this,"zh")}static{o(this,"FlowGetTool")}async execute(e){return V6(Qe(),e,Qd())}};fc=F([p2({name:"flow.get",description:'Returns one flow as the ordered, parented mechanism tree the dashboard renders: each node has `parent`, `area`, `start`, `durationMs`, and repeated work is collapsed (`count`, `memberIds`). Pass `expand: "<node id>"` to list the individual events a collapsed node stands for, or `includeRaw: true` to add each event\'s full `raw` payload (an AI turn\'s is its `ai` field; a collapsed node carries its first member\'s \u2014 `expand` lists every member\'s). The response also carries `overview`: the flow cut into segments (one backend request each, UI bursts, the origin) grouped into phases, with its category, subject and tags \u2014 for a big flow read that first, then pass `segmentId: "<segment id>"` to get just that unit as a mechanism tree. Before summing SQL counts or time, read `overview.sql`: db-query events are flood-guarded per query shape, so only `status: "complete"` means they are every statement; `gaps` names the requests that fall short and by how much. Each request\'s verdict carries `basis`: `end` (accounted when the request ended) or `settled` (a quiet-period snapshot that later SQL in the same context could still change); `overview.sql.settled` counts the verdicts resting on one. A flow this server no longer holds in memory (it keeps the 50 most recently active, and replays only the recent tail of the bus on start) is read back from the bus files on demand: the same answer, plus `recovered` (`files`, `events`, and `complete: false` when older events may be missing). `found: false` alone means no event of this id is retained anywhere the server can read; `reason: "outside-window"` means it may exist further back than the server can see (`window`, `searched`, `hint`) \u2014 re-run the flow rather than concluding it never happened.',inputSchema:{flowId:Kr.string().describe("Flow id from flow://recent."),includeRaw:Kr.boolean().default(!1),limit:Kr.number().int().positive().max(500).default(200),expand:Kr.string().optional().describe("A node id from a previous call: returns the individual events it collapsed."),segmentId:Kr.string().optional().describe("A segment id from `overview.segments` (or flow.segments): returns only that unit of the flow, shaped like the whole.")}})],fc);var f2=fc;import{Tool as h2,ToolContext as g2,z as v2}from"@frontmcp/sdk";var hc=class extends g2{static{s(this,"Mh")}static{o(this,"FlowFindByOriginTool")}async execute(e){let t=Qe();if(!t)return{found:!1,reason:"no active flow reducer"};let r=t.findFlowsByOrigin(e.originNodeId);return{found:r.length>0,count:r.length,flows:r}}};hc=F([h2({name:"flow.find_by_origin",description:"Returns all flows whose origin node id matches `originNodeId` (e.g. a data-agent-component target).",inputSchema:{originNodeId:v2.string().describe("Origin node id \u2014 usually the value of data-agent-component on the originating element.")}})],hc);var y2=hc;import{Tool as E2,ToolContext as b2,z as w2}from"@frontmcp/sdk";import*as D2 from"node:fs";import{dirname as $2,join as G6}from"node:path";var B2="ai",x2=/^ai_[0-9a-z]{8,40}$/,gs=o(e=>typeof e=="string"&&x2.test(e),"isAiCallId");function K6(e){return G6($2(e),B2)}s(K6,"bj"),o(K6,"aiContentDir");function H6(e,t){if(!gs(t))throw new Error("invalid ai call id");return G6(K6(e),`${t}.json`)}s(H6,"wj"),o(H6,"aiContentFile");function gc(e,t){if(gs(t))try{let r=JSON.parse(D2.readFileSync(H6(e,t),"utf8"));return r&&r.schemaVersion===1&&r.id===t?r:void 0}catch{return}}s(gc,"pa"),o(gc,"readAiContent");var vc=class extends b2{static{s(this,"Ph")}static{o(this,"AiGetCallTool")}async execute(e){if(!gs(e.callId))return{found:!1,reason:"invalid call id"};let t=gc(process.env.LENSMCP_EVENT_FILE??`${process.cwd()}/.lensmcp/events.jsonl`,e.callId);return t?{found:!0,call:t}:{found:!1,callId:e.callId,reason:"no captured content for this call \u2014 it was not captured (LENSMCP_AI_CAPTURE=content), or it has been rotated away"}}};vc=F([E2({name:"ai.get_call",description:"Returns the prompt and completion of ONE AI call (OpenAI, Anthropic, \u2026) captured by the node tap: system prompt, messages, tools offered, completion, tool calls, usage. `callId` is the `ai.contentRef` of a flow node whose kind is `ai-call` (see flow.get). Only exists when the service ran with LENSMCP_AI_CAPTURE=content; the text was redacted and size-capped when it was captured, and `truncated: true` says if anything was cut.",inputSchema:{callId:w2.string().describe('The contentRef of an ai-call flow node, e.g. "ai_0abc12345xyz78".')}})],vc);var C2=vc;import{Tool as k2,ToolContext as A2,z as X6}from"@frontmcp/sdk";var yc=class extends A2{static{s(this,"Dh")}static{o(this,"FlowSegmentsTool")}async execute(e){return W6(Qe(),e,Qd())}};yc=F([k2({name:"flow.segments",description:'Returns one flow cut into segments and phases \u2014 the right first read for a flow with hundreds or thousands of events. Each segment is a backend request (its browser fetch, every service hop, db/redis/ai work and any queue worker it enqueued), a UI burst (state updates and renders, named by what churned), the origin that started the flow, or background noise; with times relative to the flow start, event/error counts, and a category. Also returns the flow\'s category, subject and tags. Open one unit with flow.get { flowId, segmentId }. A flow no longer in memory is read back from the bus as in flow.get (`recovered`); `reason: "outside-window"` means it may exist further back than the server can see.',inputSchema:{flowId:X6.string().describe("Flow id from flow://recent or flow.list_recent."),maxSegments:X6.number().int().positive().max(500).default(120).describe("Cap on segments listed (failing and heaviest are kept first when it truncates).")}})],yc);var I2=yc,Y6=class{static{s(this,"Ch")}static{o(this,"FlowApp")}};Y6=F([VB({id:"flow",name:"Flow",description:"Causal-chain index: every event carries a flowId; the app surfaces recent flows + origin events. story.compile turns one of these into a phase summary.",resources:[GB,XB,e2],tools:[c2,f2,I2,y2,C2]})],Y6);import{App as _2}from"@frontmcp/sdk";import{Resource as S2,ResourceContext as F2}from"@frontmcp/sdk";var Ec=class extends F2{static{s(this,"Uh")}static{o(this,"StoryRecentResource")}async execute(){return this.get(Z).read("story://recent")}};Ec=F([S2({name:"story-recent",uri:"story://recent",mimeType:"application/json",description:"Last 50 compiled stories (one per flow), most recent first."})],Ec);var j2=Ec;import{Resource as z2,ResourceContext as N2}from"@frontmcp/sdk";var bc=class extends N2{static{s(this,"Fh")}static{o(this,"StoryLastResource")}async execute(){return this.get(Z).read("story://last")}};bc=F([z2({name:"story-last",uri:"story://last",mimeType:"application/json",description:"The most recently compiled story (full phase list)."})],bc);var M2=bc;import{Tool as O2,ToolContext as R2,z as T2}from"@frontmcp/sdk";var vs="story://recent",ys="story://last",Pe={byFlowId:new Map,order:[]},Q6=!1;function ey(e){return Q6||(e.resources.register(vs,()=>({schemaVersion:1,revision:e.resources.revision(vs)??0,updatedAt:new Date().toISOString(),stories:Pe.order.map(t=>Pe.byFlowId.get(t)).filter(t=>!!t).map(t=>({flowId:t.flowId,origin:t.origin,phaseCount:t.phases.length,startedAt:t.startedAt,endedAt:t.endedAt,eventCount:t.eventCount,finalState:t.finalState}))})),e.resources.register(ys,()=>{let t=Pe.order[0],r=t?Pe.byFlowId.get(t):void 0;return{schemaVersion:1,revision:e.resources.revision(ys)??0,updatedAt:new Date().toISOString(),story:r??null}}),Q6=!0),ty(e.resources),{uris:[vs,ys]}}s(ey,"qh"),o(ey,"installStoryReducer");var wc;function ty(e){wc=o(t=>{e.markDirty(t)},"markDirty")}s(ty,"jj"),o(ty,"setMarkDirty");function Dc(e){Pe.byFlowId.set(e.flowId,e);let t=Pe.order.indexOf(e.flowId);if(t>=0&&Pe.order.splice(t,1),Pe.order.unshift(e.flowId),Pe.order.length>50){let r=Pe.order.splice(50);for(let i of r)Pe.byFlowId.delete(i)}wc?.(vs),wc?.(ys)}s(Dc,"Ro"),o(Dc,"recordCompiledStory");function uy(e){return Pe.byFlowId.get(e)}s(uy,"Vh"),o(uy,"getCompiledStory");var $c=class extends R2{static{s(this,"Gh")}static{o(this,"StoryCompileTool")}async execute(e){let t=Qe();if(!t)return{compiled:!1,reason:"no active flow reducer"};let r=t.getFlowEvents(e.flowId);if(!r)return{compiled:!1,flowId:e.flowId};let i=la(r,{flowId:e.flowId});return i?(Dc(i),{compiled:!0,story:i}):{compiled:!1,flowId:e.flowId}}};$c=F([O2({name:"story.compile",description:"Compile a flow into a `FlowStory` (origin, phases, finalState). Caches the result; subsequent story.get(flowId) calls return it directly.",inputSchema:{flowId:T2.string().describe("Flow id (from flow://recent).")}})],$c);var P2=$c;import{Tool as U2,ToolContext as q2,z as Z2}from"@frontmcp/sdk";var Bc=class extends q2{static{s(this,"Wh")}static{o(this,"StoryGetTool")}async execute(e){let t=uy(e.flowId);return t?{found:!0,story:t}:{found:!1,flowId:e.flowId}}};Bc=F([U2({name:"story.get",description:"Returns a previously compiled story. If the story has not been compiled yet, returns `found: false`; call story.compile first.",inputSchema:{flowId:Z2.string().describe("Flow id.")}})],Bc);var L2=Bc,ry=class{static{s(this,"Xh")}static{o(this,"StoryApp")}};ry=F([_2({id:"story",name:"Story",description:"Compiles flows into phase summaries (user-action / loading-ui / backend-request / state-update / final-render).",resources:[j2,M2],tools:[P2,L2]})],ry);import{App as V2}from"@frontmcp/sdk";import{Resource as J2,ResourceContext as W2}from"@frontmcp/sdk";var xc=class extends W2{static{s(this,"Hh")}static{o(this,"BuildCurrentResource")}async execute(){return this.get(Z).read("build://current")}};xc=F([J2({name:"build-current",uri:"build://current",mimeType:"application/json",description:"Current build status (clean / warning / failing), open failures and warnings."})],xc);var G2=xc;import{Resource as K2,ResourceContext as H2}from"@frontmcp/sdk";var Cc=class extends H2{static{s(this,"Qh")}static{o(this,"BuildFailuresResource")}async execute(){return this.get(Z).read("build://failures")}};Cc=F([K2({name:"build-failures",uri:"build://failures",mimeType:"application/json",description:"Currently-open build failures (deduped by fingerprint)."})],Cc);var X2=Cc;import{Resource as Y2,ResourceContext as Q2}from"@frontmcp/sdk";var kc=class extends Q2{static{s(this,"tg")}static{o(this,"BuildRecentResource")}async execute(){return this.get(Z).read("build://events/recent")}};kc=F([Y2({name:"build-events-recent",uri:"build://events/recent",mimeType:"application/json",description:"Last 50 build/lint/typecheck/HMR events in chronological order."})],kc);var ex=kc,iy=class{static{s(this,"ng")}static{o(this,"BuildApp")}};iy=F([V2({id:"build",name:"Build",description:"Vite / TS / lint / HMR state.",resources:[G2,X2,ex]})],iy);var Es="build://current",bs="build://failures",ws="build://events/recent",tx=new Set(["vite","rollup","typescript","eslint"]),ny=new Set(["build","typecheck","lint"]),sy=50,ux="Install the LensMCP Vite plugin (@lensmcp/vite-plugin) in the dev server, or run under the dev cluster, so build events reach this session.";function ay(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(ay,"Wj"),o(ay,"readRaw");function oy(e,t){return e==="typecheck"?"tsc":e==="lint"?"eslint":t}s(oy,"Kj"),o(oy,"defaultTool");function ly(e){let t={status:"unknown",recent:[],failures:new Map,warnings:new Map,hmrUpdates:0,producers:new Map,sawVerdict:!1},r=o((f,h)=>{let g=t.producers.get(f);t.producers.set(f,{id:f,tool:h.tool,...h.project?{project:h.project}:{},firstReportedAt:g?.firstReportedAt??h.at,lastReportedAt:Math.max(g?.lastReportedAt??0,h.at),lastRunStatus:h.runStatus,errorCount:h.errorCount??g?.errorCount??0,...h.warningCount!==void 0?{warningCount:h.warningCount}:g?.warningCount!==void 0?{warningCount:g.warningCount}:{},...h.durationMs!==void 0?{lastRunDurationMs:h.durationMs}:g?.lastRunDurationMs!==void 0?{lastRunDurationMs:g.lastRunDurationMs}:{},...h.error?{error:h.error}:{}}),qt(t.producers,qr)},"touchProducer"),i=o(f=>{for(let[h,g]of t.failures)f(g)&&t.failures.delete(h);for(let[h,g]of t.warnings)f(g)&&t.warnings.delete(h)},"drop"),u=o((f,h)=>{i(g=>g.domain===f&&(h===void 0||g.project===h))},"clearScope"),n=o((f,h)=>{if(h.length===0)return;let g=new Set(h);i(b=>b.domain===f&&b.file!==void 0&&g.has(b.file))},"clearFiles"),a=o(()=>{if(t.failures.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let f=[...t.producers.values()].some(h=>h.lastRunStatus==="error");t.status=f||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),l=o(()=>{e.resources.markDirty(Es),e.resources.markDirty(bs),e.resources.markDirty(ws)},"markDirty"),d=o(f=>{if([...t.failures.values()].some(h=>h.project===f)||[...t.warnings.values()].some(h=>h.project===f)||[...t.producers.values()].some(h=>h.project===f)){for(let h of ny)u(h,f);for(let[h,g]of t.producers)g.project===f&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),a(),l()}},"supersedeProject"),c=o(f=>{if(f.source==="gateway"&&f.category==="cluster"){let C=f.raw??null,M=C?.kind;(M==="service-starting"||M==="service-respawn")&&C?.project&&d(C.project);return}if(!tx.has(f.source)||!ny.has(f.category))return;let h=f.category,g=ay(f),b=g.project,x=g.tool??oy(h,f.source),$=`${x}:${b??"*"}`,w=typeof g.kind=="string"&&g.kind.endsWith("-run"),k={id:f.id,timestamp:f.timestamp,severity:f.severity,title:f.title,...f.message!==void 0?{message:f.message}:{},...f.location?.file?{file:f.location.file}:g.file?{file:g.file}:{},domain:h,...b?{project:b}:{},fingerprint:f.fingerprint};if(f.severity==="info"&&(w&&g.phase==="start"||f.title.startsWith("tsc clear")||f.title.startsWith("ESLint clear"))){u(h,b),t.lastRunAt=f.timestamp,Hr(t,k),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:"running"}),w||(t.sawVerdict=!0),a(),l();return}if(w&&g.phase==="end"){let C=g.status==="error"?"error":g.status==="failing"?"failing":"clean";C==="clean"&&u(h,b),C!=="error"&&(t.sawVerdict=!0),t.lastRunAt=f.timestamp,Hr(t,k),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:C,...g.durationMs!==void 0?{durationMs:g.durationMs}:{},...g.errorCount!==void 0?{errorCount:g.errorCount}:{},...g.warningCount!==void 0?{warningCount:g.warningCount}:{},...g.error?{error:g.error}:{}}),a(),l();return}if(g.kind==="hmr"||f.title.startsWith("HMR ")){t.hmrUpdates+=1;let C=[...k.file?[k.file]:[],...f.relatedFiles??[]];n("build",C),t.lastRunAt=f.timestamp,t.sawVerdict=!0,Hr(t,k),r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:"clean"}),a(),l();return}Hr(t,k),f.severity==="error"||f.severity==="fatal"?(t.failures.set(k.fingerprint,k),t.warnings.delete(k.fingerprint)):f.severity==="warning"?t.failures.has(k.fingerprint)||t.warnings.set(k.fingerprint,k):(t.failures.delete(k.fingerprint),t.warnings.delete(k.fingerprint)),t.lastRunAt=f.timestamp,t.sawVerdict=!0,r($,{tool:x,...b?{project:b}:{},at:f.timestamp,runStatus:t.failures.size>0?"failing":"clean"}),a(),l()},"handler"),p=e.bus.subscribe(c),m=o(()=>Vn({producers:[...t.producers.values()],domain:"build",noProducerHint:ux}),"health");return e.resources.register(Es,()=>({schemaVersion:1,revision:e.resources.revision(Es)??0,updatedAt:new Date().toISOString(),status:t.status,failures:[...t.failures.values()],warnings:[...t.warnings.values()],hmrUpdates:t.hmrUpdates,lastRunAt:t.lastRunAt,...m()})),e.resources.register(bs,()=>({schemaVersion:1,revision:e.resources.revision(bs)??0,updatedAt:new Date().toISOString(),failures:[...t.failures.values()],...m()})),e.resources.register(ws,()=>({schemaVersion:1,revision:e.resources.revision(ws)??0,updatedAt:new Date().toISOString(),events:t.recent.slice()})),{unsubscribe:p,uris:[Es,bs,ws]}}s(ly,"og"),o(ly,"installBuildReducer");function Hr(e,t){e.recent.push(t),e.recent.length>sy&&e.recent.splice(0,e.recent.length-sy)}s(Hr,"ya"),o(Hr,"pushRecent");import{App as rx}from"@frontmcp/sdk";import{Resource as ix,ResourceContext as nx}from"@frontmcp/sdk";var Ac=class extends nx{static{s(this,"ig")}static{o(this,"LintCurrentResource")}async execute(){return this.get(Z).read("lint://current")}};Ac=F([ix({name:"lint-current",uri:"lint://current",mimeType:"application/json",description:"Current lint status (clean / warning / failing) + counts."})],Ac);var sx=Ac;import{Resource as ax,ResourceContext as ox}from"@frontmcp/sdk";var Ic=class extends ox{static{s(this,"ag")}static{o(this,"LintErrorsResource")}async execute(){return this.get(Z).read("lint://errors")}};Ic=F([ax({name:"lint-errors",uri:"lint://errors",mimeType:"application/json",description:"Currently-open ESLint errors (deduped by fingerprint)."})],Ic);var lx=Ic;import{Resource as dx,ResourceContext as cx}from"@frontmcp/sdk";var _c=class extends cx{static{s(this,"ug")}static{o(this,"LintWarningsResource")}async execute(){return this.get(Z).read("lint://warnings")}};_c=F([dx({name:"lint-warnings",uri:"lint://warnings",mimeType:"application/json",description:"Currently-open ESLint warnings."})],_c);var px=_c,dy=class{static{s(this,"dg")}static{o(this,"LintApp")}};dy=F([rx({id:"lint",name:"Lint",description:"ESLint state.",resources:[sx,lx,px]})],dy);var Ds="lint://current",$s="lint://errors",Bs="lint://warnings",mx="Nothing runs ESLint in the dev loop, so this is expected. Run `lensmcp lint [paths\u2026]` to publish a run; until then treat lint as UNCHECKED, not passing.";function cy(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(cy,"oz"),o(cy,"readRaw");function py(e){let t={status:"unknown",errors:new Map,warnings:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p);t.producers.set(p,{id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.warningCount!==void 0?{warningCount:m.warningCount}:f?.warningCount!==void 0?{warningCount:f.warningCount}:{},...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.error?{error:m.error}:{}}),qt(t.producers,qr)},"touchProducer"),i=o((p,m)=>{let f=o((h,g)=>{for(let[b,x]of h)g(x)&&h.delete(b)},"drop");if(p){f(t.errors,h=>h.project===p),f(t.warnings,h=>h.project===p);return}if(m){f(t.errors,h=>h.file===m),f(t.warnings,h=>h.file===m);return}t.errors.clear(),t.warnings.clear()},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}if(t.warnings.size>0){t.status="warning";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),n=o(()=>{e.resources.markDirty(Ds),e.resources.markDirty($s),e.resources.markDirty(Bs)},"markDirty"),a=o(p=>{if([...t.errors.values()].some(m=>m.project===p)||[...t.warnings.values()].some(m=>m.project===p)||[...t.producers.values()].some(m=>m.project===p)){i(p,void 0);for(let[m,f]of t.producers)f.project===p&&t.producers.delete(m);t.sawVerdict=[...t.producers.values()].some(m=>m.lastRunStatus!=="error"),u(),n()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,k=w?.kind;(k==="service-starting"||k==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="eslint"||p.category!=="lint")return;let m=cy(p),f=m.project,h=m.tool??"eslint",g=`${h}:${f??"*"}`,b=m.kind==="lint-run";if(p.severity==="info"&&(b&&m.phase==="start"||p.title.startsWith("ESLint clear"))){i(f,p.location?.file),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),b||(t.sawVerdict=!0),u(),n();return}if(b&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),n();return}let x=p.title.match(/^\[([^\]]+)\]/),$={id:p.id,timestamp:p.timestamp,severity:p.severity,...m.rule?{rule:m.rule}:x?.[1]?{rule:x[1]}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};if(p.severity==="error"||p.severity==="fatal")t.errors.set($.fingerprint,$),t.warnings.delete($.fingerprint);else if(p.severity==="warning")t.errors.has($.fingerprint)||t.warnings.set($.fingerprint,$);else return;t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:t.errors.size>0?"failing":"clean"}),u(),n()},"handler"),d=e.bus.subscribe(l),c=o(()=>Vn({producers:[...t.producers.values()],domain:"lint",noProducerHint:mx}),"health");return e.resources.register(Ds,()=>({schemaVersion:1,revision:e.resources.revision(Ds)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,warningCount:t.warnings.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register($s,()=>({schemaVersion:1,revision:e.resources.revision($s)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),e.resources.register(Bs,()=>({schemaVersion:1,revision:e.resources.revision(Bs)??0,updatedAt:new Date().toISOString(),warnings:[...t.warnings.values()],...c()})),{unsubscribe:d,uris:[Ds,$s,Bs]}}s(py,"pg"),o(py,"installLintReducer");import{App as fx}from"@frontmcp/sdk";import{Resource as hx,ResourceContext as gx}from"@frontmcp/sdk";var Sc=class extends gx{static{s(this,"fg")}static{o(this,"TypecheckCurrentResource")}async execute(){return this.get(Z).read("typecheck://current")}};Sc=F([hx({name:"typecheck-current",uri:"typecheck://current",mimeType:"application/json",description:"Current TypeScript typecheck status + error count."})],Sc);var vx=Sc;import{Resource as yx,ResourceContext as Ex}from"@frontmcp/sdk";var Fc=class extends Ex{static{s(this,"hg")}static{o(this,"TypecheckErrorsResource")}async execute(){return this.get(Z).read("typecheck://errors")}};Fc=F([yx({name:"typecheck-errors",uri:"typecheck://errors",mimeType:"application/json",description:"Current TypeScript errors (deduped by fingerprint)."})],Fc);var bx=Fc,my=class{static{s(this,"vg")}static{o(this,"TypecheckApp")}};my=F([fx({id:"typecheck",name:"Typecheck",description:"TypeScript diagnostics from `tsc --watch`.",resources:[vx,bx]})],my);var xs="typecheck://current",Cs="typecheck://errors",wx="Wire one: the dev cluster publishes from `TsgoCheckPlugin` when `LENSMCP_TYPECHECK=tsgo` (@lensmcp/cluster), or call `startTscCollector()` from @lensmcp/session for a `tsc --watch` workspace.";function fy(e){let t=e.raw;return t&&typeof t=="object"?t:{}}s(fy,"dz"),o(fy,"readRaw");function hy(e){let t={status:"unknown",errors:new Map,producers:new Map,sawVerdict:!1},r=o((p,m)=>{let f=t.producers.get(p),h={id:p,tool:m.tool,...m.project?{project:m.project}:{},firstReportedAt:f?.firstReportedAt??m.at,lastReportedAt:Math.max(f?.lastReportedAt??0,m.at),lastRunStatus:m.runStatus,errorCount:m.errorCount??f?.errorCount??0,...m.durationMs!==void 0?{lastRunDurationMs:m.durationMs}:f?.lastRunDurationMs!==void 0?{lastRunDurationMs:f.lastRunDurationMs}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}};t.producers.set(p,h),qt(t.producers,qr)},"touchProducer"),i=o(p=>{if(!p){t.errors.clear();return}for(let[m,f]of t.errors)f.project===p&&t.errors.delete(m)},"clearScope"),u=o(()=>{if(t.errors.size>0){t.status="failing";return}let p=[...t.producers.values()].some(m=>m.lastRunStatus==="error");t.status=p||!t.sawVerdict?"unknown":"clean"},"recomputeStatus"),n=o(()=>{e.resources.markDirty(xs),e.resources.markDirty(Cs)},"markDirty"),a=o(p=>{let m=[...t.errors.values()].some(h=>h.project===p),f=[...t.producers.values()].some(h=>h.project===p);if(!(!m&&!f)){i(p);for(let[h,g]of t.producers)g.project===p&&t.producers.delete(h);t.sawVerdict=[...t.producers.values()].some(h=>h.lastRunStatus!=="error"),u(),n()}},"supersedeProject"),l=o(p=>{if(p.source==="gateway"&&p.category==="cluster"){let w=p.raw??null,k=w?.kind;(k==="service-starting"||k==="service-respawn")&&w?.project&&a(w.project);return}if(p.source!=="typescript"||p.category!=="typecheck")return;let m=fy(p),f=m.project,h=m.tool??"tsc",g=`${h}:${f??"*"}`,b=m.kind==="typecheck-run";if(p.severity==="info"&&(b&&m.phase==="start"||p.title.startsWith("tsc clear"))){i(f),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"running"}),b||(t.sawVerdict=!0),u(),n();return}if(b&&m.phase==="end"){let w=m.status==="error"?"error":m.status==="failing"?"failing":"clean";w!=="error"&&(t.sawVerdict=!0),t.lastRunAt=p.timestamp,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:w,...m.durationMs!==void 0?{durationMs:m.durationMs}:{},...m.errorCount!==void 0?{errorCount:m.errorCount}:{},...m.warningCount!==void 0?{warningCount:m.warningCount}:{},...m.error?{error:m.error}:{}}),u(),n();return}if(p.severity!=="error"&&p.severity!=="fatal")return;let x=p.title.match(/\bTS(\d+):/),$={id:p.id,timestamp:p.timestamp,...m.code?{code:m.code}:x?{code:`TS${x[1]}`}:{},message:p.message??p.title,...p.location?.file?{file:p.location.file}:{},...p.location?.line!==void 0?{line:p.location.line}:{},...p.location?.column!==void 0?{column:p.location.column}:{},...f?{project:f}:{},fingerprint:p.fingerprint};t.errors.set($.fingerprint,$),t.lastRunAt=p.timestamp,t.sawVerdict=!0,r(g,{tool:h,...f?{project:f}:{},at:p.timestamp,runStatus:"failing"}),u(),n()},"handler"),d=e.bus.subscribe(l),c=o(()=>Vn({producers:[...t.producers.values()],domain:"typecheck",noProducerHint:wx}),"health");return e.resources.register(xs,()=>({schemaVersion:1,revision:e.resources.revision(xs)??0,updatedAt:new Date().toISOString(),status:t.status,errorCount:t.errors.size,lastRunAt:t.lastRunAt,...c()})),e.resources.register(Cs,()=>({schemaVersion:1,revision:e.resources.revision(Cs)??0,updatedAt:new Date().toISOString(),errors:[...t.errors.values()],...c()})),{unsubscribe:d,uris:[xs,Cs]}}s(hy,"yg"),o(hy,"installTypecheckReducer");import{App as Dx}from"@frontmcp/sdk";import{Resource as $x,ResourceContext as Bx}from"@frontmcp/sdk";var jc=class extends Bx{static{s(this,"bg")}static{o(this,"BundleCurrentResource")}async execute(){return this.get(Z).read("bundle://current")}};jc=F([$x({name:"bundle-current",uri:"bundle://current",mimeType:"application/json",description:"Most recent Vite/Rollup bundle report (chunks + sizes)."})],jc);var xx=jc;import{Resource as Cx,ResourceContext as kx}from"@frontmcp/sdk";var zc=class extends kx{static{s(this,"xg")}static{o(this,"BundleChunksResource")}async execute(){return this.get(Z).read("bundle://chunks")}};zc=F([Cx({name:"bundle-chunks",uri:"bundle://chunks",mimeType:"application/json",description:"Per-chunk bundle sizes (most recent build)."})],zc);var Ax=zc;import{Resource as Ix,ResourceContext as _x}from"@frontmcp/sdk";var Nc=class extends _x{static{s(this,"_g")}static{o(this,"BundleModulesResource")}async execute(){return this.get(Z).read("bundle://modules")}};Nc=F([Ix({name:"bundle-modules",uri:"bundle://modules",mimeType:"application/json",description:"Flattened per-module bundle sizes (most recent build)."})],Nc);var Sx=Nc;import{Resource as Fx,ResourceContext as jx}from"@frontmcp/sdk";var Mc=class extends jx{static{s(this,"Sg")}static{o(this,"BundleRegressionsResource")}async execute(){return this.get(Z).read("bundle://regressions")}};Mc=F([Fx({name:"bundle-regressions",uri:"bundle://regressions",mimeType:"application/json",description:"Chunks/modules that grew, were added, or were removed vs the baseline."})],Mc);var zx=Mc;import{Resource as Nx,ResourceContext as Mx}from"@frontmcp/sdk";var Oc=class extends Mx{static{s(this,"Rg")}static{o(this,"BundleCompareResource")}async execute(){return this.get(Z).read("bundle://compare/latest")}};Oc=F([Nx({name:"bundle-compare-latest",uri:"bundle://compare/latest",mimeType:"application/json",description:"Most recent build vs baseline: totals + delta."})],Oc);var Ox=Oc,gy=class{static{s(this,"Tg")}static{o(this,"BundleApp")}};gy=F([Dx({id:"bundle",name:"Bundle",description:"Vite/Rollup bundle reports + regressions against baseline.",resources:[xx,Ax,Sx,zx,Ox]})],gy);function Rc(e,t){let r=[],i=new Map(e.chunks.map(n=>[n.name,n])),u=new Map(t.chunks.map(n=>[n.name,n]));for(let[n,a]of u){let l=i.get(n);if(!l){r.push({kind:"chunk-added",name:n,afterBytes:a.sizeBytes,deltaBytes:a.sizeBytes});continue}let d=a.sizeBytes-l.sizeBytes;d>256&&r.push({kind:"chunk-grew",name:n,beforeBytes:l.sizeBytes,afterBytes:a.sizeBytes,deltaBytes:d}),r.push(...vy(l,a))}for(let[n,a]of i)u.has(n)||r.push({kind:"chunk-removed",name:n,beforeBytes:a.sizeBytes,deltaBytes:-a.sizeBytes});return r.sort((n,a)=>Math.abs(a.deltaBytes)-Math.abs(n.deltaBytes))}s(Rc,"ka"),o(Rc,"compareReports");function vy(e,t){let r=[],i=new Map(e.modules.map(u=>[u.id,u.sizeBytes]));for(let u of t.modules){let n=i.get(u.id);if(n===void 0)u.sizeBytes>256&&r.push({kind:"module-added",name:`${t.name}::${u.id}`,afterBytes:u.sizeBytes,deltaBytes:u.sizeBytes});else{let a=u.sizeBytes-n;a>256&&r.push({kind:"module-grew",name:`${t.name}::${u.id}`,beforeBytes:n,afterBytes:u.sizeBytes,deltaBytes:a})}}return r}s(vy,"_z"),o(vy,"compareModules");var ks="bundle://current",As="bundle://chunks",Is="bundle://modules",Xr="bundle://regressions",Yr="bundle://compare/latest";function yy(e){let t={baseline:e.initialBaseline,regressions:[]},r=o(u=>{if(u.source!=="rollup"&&u.source!=="vite"||u.category!=="build")return;let n=u.raw;if(!n||typeof n!="object"||!("kind"in n)||n.kind!=="bundle-report")return;let a=n.report;!a||!Array.isArray(a.chunks)||(t.current=a,t.regressions=t.baseline?Rc(t.baseline,a):[],e.resources.markDirty(ks),e.resources.markDirty(As),e.resources.markDirty(Is),e.resources.markDirty(Xr),e.resources.markDirty(Yr))},"handler"),i=e.bus.subscribe(r);return e.resources.register(ks,()=>({schemaVersion:1,revision:e.resources.revision(ks)??0,updatedAt:new Date().toISOString(),report:t.current??null})),e.resources.register(As,()=>({schemaVersion:1,revision:e.resources.revision(As)??0,updatedAt:new Date().toISOString(),chunks:t.current?.chunks??[]})),e.resources.register(Is,()=>{let u=t.current?.chunks.flatMap(n=>n.modules.map(a=>({...a,chunk:n.name})))??[];return{schemaVersion:1,revision:e.resources.revision(Is)??0,updatedAt:new Date().toISOString(),modules:u}}),e.resources.register(Xr,()=>({schemaVersion:1,revision:e.resources.revision(Xr)??0,updatedAt:new Date().toISOString(),regressions:t.regressions.slice()})),e.resources.register(Yr,()=>({schemaVersion:1,revision:e.resources.revision(Yr)??0,updatedAt:new Date().toISOString(),baseline:t.baseline??null,current:t.current??null,deltaBytes:t.baseline&&t.current?t.current.totalBytes-t.baseline.totalBytes:0})),{unsubscribe:i,uris:[ks,As,Is,Xr,Yr],setBaseline:o(u=>{t.baseline=u,t.current&&(t.regressions=Rc(t.baseline,t.current)),e.resources.markDirty(Xr),e.resources.markDirty(Yr)},"setBaseline")}}s(yy,"Ag"),o(yy,"installBundleReducer");import{App as Rx}from"@frontmcp/sdk";import{Resource as Tx,ResourceContext as Px}from"@frontmcp/sdk";var Tc=class extends Px{static{s(this,"jg")}static{o(this,"RuntimeBrowserConsoleResource")}async execute(){return this.get(Z).read("runtime://browser/console")}};Tc=F([Tx({name:"runtime-browser-console",uri:"runtime://browser/console",mimeType:"application/json",description:"Most recent 200 console.* messages from any tab."})],Tc);var Ux=Tc;import{Resource as qx,ResourceContext as Zx}from"@frontmcp/sdk";var Pc=class extends Zx{static{s(this,"Og")}static{o(this,"RuntimeBrowserErrorsResource")}async execute(){return this.get(Z).read("runtime://browser/errors")}};Pc=F([qx({name:"runtime-browser-errors",uri:"runtime://browser/errors",mimeType:"application/json",description:"Uncaught browser errors + promise rejections, per tab, since that tab's current page load (a reload retracts the previous document's errors)."})],Pc);var Lx=Pc;import{Resource as Vx,ResourceContext as Jx}from"@frontmcp/sdk";var Uc=class extends Jx{static{s(this,"Ng")}static{o(this,"RuntimeServerErrorsResource")}async execute(){return this.get(Z).read("runtime://errors")}};Uc=F([Vx({name:"runtime-errors",uri:"runtime://errors",mimeType:"application/json",description:"Errors raised INSIDE a backend pod, with no browser involved \u2014 the 500s a curl, an e2e runner or a queue job produces. Each entry carries the route, the status, the request id the gateway stamped, and the stack. Use this when a server-side call failed and no browser flow exists to explain it; `runtime://browser/errors` is the browser-side counterpart."})],Uc);var Wx=Uc;import{Resource as Gx,ResourceContext as Kx}from"@frontmcp/sdk";var qc=class extends Kx{static{s(this,"Dg")}static{o(this,"RuntimeBrowserNetworkResource")}async execute(){return this.get(Z).read("runtime://browser/network")}};qc=F([Gx({name:"runtime-browser-network",uri:"runtime://browser/network",mimeType:"application/json",description:"Recent fetch / XHR / browser network activity."})],qc);var Hx=qc;import{Resource as Xx,ResourceContext as Yx}from"@frontmcp/sdk";var Zc=class extends Yx{static{s(this,"Ug")}static{o(this,"RuntimeBrowserFailedRequestsResource")}async execute(){return this.get(Z).read("runtime://browser/failed-requests")}};Zc=F([Xx({name:"runtime-browser-failed-requests",uri:"runtime://browser/failed-requests",mimeType:"application/json",description:"Recent failed network requests (status >= 400 or transport errors)."})],Zc);var Qx=Zc;import{Resource as eC,ResourceContext as tC}from"@frontmcp/sdk";var Lc=class extends tC{static{s(this,"Fg")}static{o(this,"RuntimeDismissedResource")}async execute(){return this.get(Z).read("runtime://dismissed")}};Lc=F([eC({name:"runtime-dismissed",uri:"runtime://dismissed",mimeType:"application/json",description:"Errors someone DISMISSED by hand \u2014 in the dashboard, at the CLI, or an agent through observe.dismiss_errors \u2014 with who did it and the reason they gave. A dismissed error is hidden from runtime://errors and the browser error lists, not fixed: it shows again the next time it happens. Read this when an error list is shorter than you expected."})],Lc);var uC=Lc,Ey=class{static{s(this,"Zg")}static{o(this,"RuntimeApp")}};Ey=F([Rx({id:"runtime",name:"Runtime",description:"Live browser/node runtime state (console, errors, network).",resources:[Ux,Lx,Wx,Hx,Qx,uC]})],Ey);var Cu="runtime://browser/console",wt="runtime://browser/errors",ku="runtime://browser/network",Dt="runtime://browser/failed-requests",$t="runtime://errors",Qr="runtime://dismissed",rC=200,by=100,iC=200,nC=50,sC=500,aC="default",oC=1e3,Vc=o(e=>e??aC,"tabOf");function wy(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(wy,"Zz"),o(wy,"isDocumentBoundary");function Dy(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(Dy,"qz"),o(Dy,"isTabGone");function $y(e){let t=(e.now??(()=>Date.now()))(),r={console:[],errors:[],network:[],failed:[],serverErrors:[],readyByTab:new Map,dismissed:new Map,changedAt:new Map},i=o((c,p)=>{r.changedAt.set(c,p),e.resources.markDirty(c)},"touch"),u=o((c,p,m)=>{let f=c.filter(h=>!(Vc(h.tabId)===p&&h.timestamp<m));f.length!==c.length&&(c.length=0,c.push(...f))},"retract"),n=o(c=>{let p=yd(c);if(p){let f=r.dismissed.get(p.groupId);r.dismissed.delete(p.groupId),p.kind===wu&&(r.dismissed.set(p.groupId,{eventIds:new Set(p.eventIds),at:c.timestamp,...p.by?{by:p.by}:{},...p.reason?{reason:p.reason}:{},...p.title?{title:p.title}:{}}),r.dismissed.size>sC&&r.dismissed.delete(r.dismissed.keys().next().value));let h=new Set([...f?.eventIds??[],...r.dismissed.get(p.groupId)?.eventIds??[]]);for(let[g,b]of[[$t,r.serverErrors],[wt,r.errors],[Dt,r.failed]])b.some(x=>h.has(x.id))&&i(g,c.timestamp);i(Qr,c.timestamp);return}if(By(c)){let f=c.raw?.project;if(f){let h=r.serverErrors.length;r.serverErrors=r.serverErrors.filter(g=>g.project!==f),r.serverErrors.length!==h&&i($t,c.timestamp)}return}if(xy(c)){r.lastServerEventAt=Math.max(r.lastServerEventAt??0,c.timestamp),Au(r.serverErrors,Cy(c),by),i($t,c.timestamp);return}if(!(c.source==="client-runtime"||c.source==="chrome")&&!(c.source==="react"&&c.category==="network"))return;if(r.lastEventAt=Math.max(r.lastEventAt??0,c.timestamp),Dy(c)){let f=Vc(c.context.tabId);u(r.errors,f,Number.POSITIVE_INFINITY),u(r.failed,f,Number.POSITIVE_INFINITY),r.readyByTab.delete(f);for(let h of[wt,Dt,Cu,ku])i(h,c.timestamp);return}if(wy(c)){let f=Vc(c.context.tabId);r.readyByTab.set(f,Math.max(r.readyByTab.get(f)??0,c.timestamp)),r.lastReadyAt=Math.max(r.lastReadyAt??0,c.timestamp);let h=c.timestamp-oC;u(r.errors,f,h),u(r.failed,f,h);for(let g of[wt,Dt,Cu,ku])i(g,c.timestamp);return}let m={id:c.id,timestamp:c.timestamp,severity:c.severity,title:c.title,message:c.message,source:c.source,fingerprint:c.fingerprint,tabId:c.context.tabId,url:c.context.url,raw:c.raw};if(c.category==="network"){Au(r.network,m,iC),i(ku,c.timestamp),c.severity==="error"&&(Au(r.failed,m,nC),i(Dt,c.timestamp));return}(c.severity==="error"||c.severity==="fatal")&&(Au(r.errors,m,by),i(wt,c.timestamp)),c.title?.startsWith("console.")&&(Au(r.console,m,rC),i(Cu,c.timestamp))},"handler"),a=e.bus.subscribe(n),l=new Set([$t,wt,Dt]),d=o((c,p)=>{if(!l.has(c)||r.dismissed.size===0)return Wc(e.resources,c,p,r,t,0);let m=new Set([...r.dismissed.values()].flatMap(h=>[...h.eventIds])),f=p.filter(h=>!m.has(h.id));return Wc(e.resources,c,f,r,t,p.length-f.length)},"snap");return e.resources.register($t,()=>d($t,r.serverErrors)),e.resources.register(Cu,()=>d(Cu,r.console)),e.resources.register(wt,()=>d(wt,r.errors)),e.resources.register(ku,()=>d(ku,r.network)),e.resources.register(Dt,()=>d(Dt,r.failed)),e.resources.register(Qr,()=>{let c=new Set([...r.serverErrors,...r.errors,...r.failed].map(m=>m.id)),p=[...r.dismissed].map(([m,f])=>({id:m,at:f.at,...f.by?{by:f.by}:{},...f.reason?{reason:f.reason}:{},...f.title?{title:f.title}:{},eventIds:[...f.eventIds],hiding:[...f.eventIds].filter(h=>c.has(h)).length}));return{schemaVersion:1,revision:e.resources.revision(Qr)??0,updatedAt:new Date(r.changedAt.get(Qr)??t).toISOString(),count:p.length,dismissals:p,detail:p.length?`${p.length} dismissal${p.length===1?"":"s"} in effect \u2014 hidden, not fixed. Each error shows again the next time it happens; undo one with observe.restore_errors.`:"Nothing has been dismissed."}}),{unsubscribe:a,uris:[Cu,wt,ku,Dt,$t,Qr]}}s($y,"Gg"),o($y,"installRuntimeReducer");function Jc(e){let t=e.raw??null,r=e.context;return t?.project??r.projectName}s(Jc,"U_"),o(Jc,"projectOf");function By(e){if(e.source!=="gateway"||e.category!=="cluster")return!1;let t=e.raw?.kind;return t==="service-starting"||t==="service-respawn"}s(By,"Vz"),o(By,"isGenerationBoundary");function xy(e){if(e.source!=="nestjs"||e.severity!=="error"&&e.severity!=="fatal")return!1;let t=e.raw??{};return t.kind==="server-request"||t.kind==="uncaught"?!0:t.kind!=="log"?!1:t.request?.error?!0:/\b[A-Za-z0-9_$]*(?:Error|Exception)\b|\b(?:ERROR|FATAL)\b/.test(e.title??"")}s(xy,"Gz"),o(xy,"isServerError");function Cy(e){let t=(e.raw??{}).request??{},r=t.error;return{id:e.id,timestamp:e.timestamp,severity:e.severity,title:e.title,message:e.message??r?.message,source:e.source,fingerprint:e.fingerprint,...e.context.requestId?{requestId:e.context.requestId}:{},...Jc(e)?{project:Jc(e)}:{},...typeof t.route=="string"?{route:t.route}:{},...typeof t.status=="number"?{status:t.status}:{},...typeof t.outcome=="string"?{outcome:t.outcome}:{},...r?.stack?{stack:r.stack}:{},raw:e.raw}}s(Cy,"Jz"),o(Cy,"serverEntry");function Wc(e,t,r,i,u,n){let a=t===$t,l=a?i.lastServerEventAt:i.lastEventAt,d=l!==void 0;return{schemaVersion:1,revision:e.revision(t)??0,updatedAt:new Date(i.changedAt.get(t)??u).toISOString(),count:r.length,entries:r.slice(),...n>0?{dismissedCount:n}:{},producer:d?"connected":"none",lastEventAt:l,lastReadyAt:i.lastReadyAt,detail:a?d?r.length===0?"No server-side errors held. Pods HAVE reported, but a new pod generation retracts the errors of the one it replaced \u2014 so this is NOT evidence the routes are healthy: nobody may have re-made the failing request since."+_s(n):`${r.length} server-side error${r.length===1?"":"s"} from ${new Set(r.map(c=>c.project??"unknown")).size} project${new Set(r.map(c=>c.project??"unknown")).size===1?"":"s"}`+_s(n):"No pod has ever reported into this session \u2014 this is NOT evidence the backend is healthy, nothing is watching. Run the backend under the dev cluster so pod errors reach this session.":d?`browser attached; ${r.length} entr${r.length===1?"y":"ies"} from ${i.readyByTab.size} open tab${i.readyByTab.size===1?"":"s"}`+(i.lastReadyAt===void 0?" (no page load observed yet)":"")+_s(n):"No browser has ever reported into this session \u2014 this is NOT evidence the app is healthy, nothing is watching. Open the app under the dev cluster (or the Vite dev server with @lensmcp/vite-plugin installed) so browser events reach this session."}}s(Wc,"L_"),o(Wc,"snapshot");function _s(e){return e>0?` \u2014 ${e} more dismissed by hand in the dashboard (hidden, not fixed)`:""}s(_s,"Vg"),o(_s,"dismissedNote");function Au(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(Au,"jo"),o(Au,"pushBounded");import{App as lC}from"@frontmcp/sdk";import{Resource as dC,ResourceContext as cC}from"@frontmcp/sdk";var Gc=class extends cC{static{s(this,"Jg")}static{o(this,"BrowserTabsResource")}async execute(){return this.get(Z).read("browser://tabs")}};Gc=F([dC({name:"browser-tabs",uri:"browser://tabs",mimeType:"application/json",description:"Open browser tabs with per-tab status, url, and event counts. `status` reflects the tab's CURRENT page load \u2014 a reload resets it."})],Gc);var pC=Gc;import{Resource as mC,ResourceContext as fC}from"@frontmcp/sdk";var Kc=class extends fC{static{s(this,"Kg")}static{o(this,"BrowserActiveTabResource")}async execute(){return this.get(Z).read("browser://active-tab")}};Kc=F([mC({name:"browser-active-tab",uri:"browser://active-tab",mimeType:"application/json",description:"The currently-focused browser tab."})],Kc);var hC=Kc,ky=class{static{s(this,"Hg")}static{o(this,"BrowserApp")}};ky=F([lC({id:"browser",name:"Browser",description:"Per-tab browser state (multi-tab refinement comes in Phase 6).",resources:[pC,hC]})],ky);var Bt="browser://tabs",xt="browser://active-tab";function Ay(e){if(e.category!=="runtime")return!1;let t=e.raw;return t&&typeof t=="object"&&t.kind==="ready"?!0:e.title==="Client runtime ready"}s(Ay,"Qz"),o(Ay,"isDocumentBoundary");function Iy(e){if(e.category!=="runtime")return!1;let t=e.raw;return!!(t&&typeof t=="object"&&t.kind==="gone")}s(Iy,"eO"),o(Iy,"isTabGone");function _y(e){let t=(e.now??(()=>Date.now()))(),r={tabs:new Map,changedAt:new Map},i=o(a=>{if(a.source!=="chrome"&&a.source!=="client-runtime")return;let l=a.context.tabId??"default";if(Iy(a)){if(r.tabs.delete(l),r.activePageId===l){let c=[...r.tabs.keys()];r.activePageId=c[c.length-1]}r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt);return}let d=r.tabs.get(l);if(d||(d={pageId:l,url:a.context.url??"",status:"unknown",unreadEvents:0,totalEvents:0,loads:0}),r.tabs.delete(l),r.tabs.set(l,d),r.tabs.size>100){let c=r.tabs.keys().next().value;c!==void 0&&c!==l&&r.tabs.delete(c)}a.context.url&&(d.url=a.context.url),d.totalEvents+=1,d.lastEventAt=a.timestamp,r.activePageId=l,r.lastEventAt=Math.max(r.lastEventAt??0,a.timestamp),Ay(a)?(d.status="clean",d.unreadEvents=0,d.loads+=1,d.lastReadyAt=a.timestamp):(d.unreadEvents+=1,a.severity==="error"||a.severity==="fatal"?d.status="failing":d.status!=="failing"&&a.severity==="warning"?d.status="warning":d.status==="unknown"&&(d.status="clean")),r.changedAt.set(Bt,a.timestamp),r.changedAt.set(xt,a.timestamp),e.resources.markDirty(Bt),e.resources.markDirty(xt)},"handler"),u=e.bus.subscribe(i),n=o(a=>new Date(r.changedAt.get(a)??t).toISOString(),"stamp");return e.resources.register(Bt,()=>({schemaVersion:1,revision:e.resources.revision(Bt)??0,updatedAt:n(Bt),activePageId:r.activePageId,tabs:[...r.tabs.values()],lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"})),e.resources.register(xt,()=>{let a=r.activePageId;return{schemaVersion:1,revision:e.resources.revision(xt)??0,updatedAt:n(xt),tab:a?r.tabs.get(a)??null:null,lastEventAt:r.lastEventAt,producer:r.lastEventAt===void 0?"none":"connected"}}),{unsubscribe:u,uris:[Bt,xt]}}s(_y,"Yg"),o(_y,"installBrowserReducer");import{App as gC}from"@frontmcp/sdk";import{Resource as vC,ResourceContext as yC}from"@frontmcp/sdk";var Hc=class extends yC{static{s(this,"Qg")}static{o(this,"NestProvidersResource")}async execute(){return this.get(Z).read("nest://providers")}};Hc=F([vC({name:"nest-providers",uri:"nest://providers",mimeType:"application/json",description:"All known NestJS singleton-instance generations (with lifecycle)."})],Hc);var EC=Hc;import{Resource as bC,ResourceContext as wC}from"@frontmcp/sdk";var Xc=class extends wC{static{s(this,"tv")}static{o(this,"NestRequestsResource")}async execute(){return this.get(Z).read("nest://requests/recent")}};Xc=F([bC({name:"nest-requests-recent",uri:"nest://requests/recent",mimeType:"application/json",description:"Last 50 NestJS server requests with status + duration."})],Xc);var DC=Xc,Sy=class{static{s(this,"nv")}static{o(this,"NestApp")}};Sy=F([gC({id:"nest",name:"Nest",description:"NestJS providers, request lifecycle, singleton generations.",resources:[EC,DC]})],Sy);var Ss="nest://providers",Fs="nest://requests/recent";function Fy(e){let t={providers:new Map,recentRequests:[]},r=o(u=>{if(u.source!=="nestjs")return;let n=u.raw??null;if(n?.kind==="singleton-instance"&&n.provider){let a=n.provider;if(t.providers.delete(a.instanceId),t.providers.set(a.instanceId,{...a}),t.providers.size>500){for(let l of t.providers.keys())if(t.providers.delete(l),t.providers.size<=500)break}e.resources.markDirty(Ss);return}if(n?.kind==="server-request"&&n.request){let a={...n.request,fingerprint:u.fingerprint,id:u.id};t.recentRequests.push(a),t.recentRequests.length>50&&t.recentRequests.splice(0,t.recentRequests.length-50),e.resources.markDirty(Fs);return}},"handler"),i=e.bus.subscribe(r);return e.resources.register(Ss,()=>({schemaVersion:1,revision:e.resources.revision(Ss)??0,updatedAt:new Date().toISOString(),providers:[...t.providers.values()]})),e.resources.register(Fs,()=>({schemaVersion:1,revision:e.resources.revision(Fs)??0,updatedAt:new Date().toISOString(),requests:t.recentRequests.slice()})),{unsubscribe:i,uris:[Ss,Fs]}}s(Fy,"ov"),o(Fy,"installNestReducer");import{App as $C}from"@frontmcp/sdk";import{Resource as BC,ResourceContext as xC}from"@frontmcp/sdk";var Yc=class extends xC{static{s(this,"iv")}static{o(this,"TraceRecentResource")}async execute(){return this.get(Z).read("trace://recent")}};Yc=F([BC({name:"trace-recent",uri:"trace://recent",mimeType:"application/json",description:"Last 100 trace spans (flattened)."})],Yc);var CC=Yc;import{Resource as kC,ResourceContext as AC}from"@frontmcp/sdk";var Qc=class extends AC{static{s(this,"av")}static{o(this,"TraceFailedResource")}async execute(){return this.get(Z).read("trace://failed")}};Qc=F([kC({name:"trace-failed",uri:"trace://failed",mimeType:"application/json",description:"Trace spans that ended with status=error."})],Qc);var IC=Qc,jy=class{static{s(this,"uv")}static{o(this,"TraceApp")}};jy=F([$C({id:"trace",name:"Trace",description:"Cross-process span timeline (Phase 3 \u2014 flat; Phase 7 promotes to multi-axis graph).",resources:[CC,IC]})],jy);var js="trace://recent",zs="trace://failed";function zy(e){let t={recent:[],failed:[]},r=o(u=>{let n=u.raw??null;if(!n||n.kind!=="span"||!n.span?.name)return;let a={id:u.id,traceId:n.span.traceId,parentSpanId:n.span.parentSpanId,flowId:n.span.flowId??u.context.flowId,requestId:n.span.requestId??u.context.requestId,name:n.span.name,source:u.source,startTime:n.span.startTime??u.timestamp,endTime:n.span.endTime,durationMs:n.span.durationMs,status:n.span.status??(u.severity==="error"?"error":"ok")};ep(t.recent,a,100),a.status==="error"&&ep(t.failed,a,50),e.resources.markDirty(js),a.status==="error"&&e.resources.markDirty(zs)},"handler"),i=e.bus.subscribe(r);return e.resources.register(js,()=>({schemaVersion:1,revision:e.resources.revision(js)??0,updatedAt:new Date().toISOString(),spans:t.recent.slice()})),e.resources.register(zs,()=>({schemaVersion:1,revision:e.resources.revision(zs)??0,updatedAt:new Date().toISOString(),spans:t.failed.slice()})),{unsubscribe:i,uris:[js,zs]}}s(zy,"lv"),o(zy,"installTraceReducer");function ep(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(ep,"F_"),o(ep,"pushBounded");import{App as _C}from"@frontmcp/sdk";import{Resource as SC,ResourceContext as FC}from"@frontmcp/sdk";var tp=class extends FC{static{s(this,"dv")}static{o(this,"PerfSlowRoutesResource")}async execute(){return this.get(Z).read("perf://slow-routes")}};tp=F([SC({name:"perf-slow-routes",uri:"perf://slow-routes",mimeType:"application/json",description:"Routes that are slow NOW (\u2265 threshold on their latest call, or repeatedly lately). A one-off spike is retracted once later calls prove the route recovered; worstEver keeps the history."})],tp);var jC=tp;import{Resource as zC,ResourceContext as NC}from"@frontmcp/sdk";var up=class extends NC{static{s(this,"fv")}static{o(this,"PerfDuplicateRequestsResource")}async execute(){return this.get(Z).read("perf://duplicate-requests")}};up=F([zC({name:"perf-duplicate-requests",uri:"perf://duplicate-requests",mimeType:"application/json",description:"Endpoints one page called SEVERAL TIMES CONCURRENTLY \u2014 the missing-dedupe signal (a hook fetching outside the shared resource cache, multiplied by however many components mount it). Concurrency, not count: sequential repeats are a caching question and are not reported. The threshold sits above 2 so React StrictMode\u2019s double-invoke never fires it. Two consecutive clean loads retract a finding, so a fix clears it without a restart."})],up);var MC=up,Ny=class{static{s(this,"hv")}static{o(this,"PerfApp")}};Ny=F([_C({id:"perf",name:"Perf",description:"Performance signals: slow server routes, and endpoints one page calls concurrently (the missing-dedupe signal).",resources:[jC,MC]})],Ny);var Ns="perf://slow-routes",Ms=20,My=2,OC=200;function Oy(e){let t=Ye(e.thresholds).slowRouteMs,r=(e.now??(()=>Date.now()))(),i={routes:new Map},u=o(d=>{let c=d.raw??null;if(c?.kind!=="server-request"||!c.request)return;let{method:p,route:m}=c.request,f=c.request.durationMs??0,h=`${p} ${m}`,g=i.routes.get(h);if(g||(g={method:p,route:m,recent:[],samples:0,slowSamples:0,lastDurationMs:f,lastSeenAt:d.timestamp,worstEverMs:0,worstEverAt:d.timestamp}),i.routes.delete(h),i.routes.set(h,g),g.recent.push(f),g.recent.length>Ms&&g.recent.splice(0,g.recent.length-Ms),g.samples+=1,f>=t&&(g.slowSamples+=1),g.lastDurationMs=f,g.lastSeenAt=d.timestamp,f>g.worstEverMs&&(g.worstEverMs=f,g.worstEverAt=d.timestamp),i.routes.size>OC){let b=i.routes.keys().next().value;b!==void 0&&i.routes.delete(b)}i.lastSampleAt=Math.max(i.lastSampleAt??0,d.timestamp),i.changedAt=d.timestamp,e.resources.markDirty(Ns)},"handler"),n=e.bus.subscribe(u),a=o(d=>d.recent.reduce((c,p)=>p>=t?c+1:c,0),"recentSlowCount"),l=o(d=>d.lastDurationMs>=t||a(d)>=My,"currentlySlow");return e.resources.register(Ns,()=>{let d=[...i.routes.values()].filter(l);return{schemaVersion:1,revision:e.resources.revision(Ns)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,routes:d.map(c=>({method:c.method,route:c.route,worstRecentMs:Math.max(...c.recent),lastDurationMs:c.lastDurationMs,lastSeenAt:c.lastSeenAt,samples:c.samples,slowSamples:c.slowSamples,recentSlowSamples:a(c),worstEverMs:c.worstEverMs,worstEverAt:c.worstEverAt})).sort((c,p)=>p.worstRecentMs-c.worstRecentMs),routesTracked:i.routes.size,recentSampleWindow:Ms,minRecentSlowToKeep:My,lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No server request has ever been observed \u2014 this is NOT evidence the backend is fast, nothing is watching. Run the backend under the dev cluster (or with @lensmcp/nest-instrumentation) so request timings reach this session.":`${i.routes.size} route${i.routes.size===1?"":"s"} observed; ${d.length} slow in the last ${Ms} calls each (\u2265${t}ms).`}}),{unsubscribe:n,uris:[Ns]}}s(Oy,"gv"),o(Oy,"installPerfReducer");var Os="perf://duplicate-requests",rp=10,Ry=2,RC=200,Ty=300,TC=new Set(["t","_","cacheBust","ts"]),PC=8,Py=2,UC="react";function Uy(e,t){return t.start<=e.end+Py&&t.end>=e.start-Py}s(Uy,"xO"),o(Uy,"sameRequest");function qy(e){try{let t=new URL(e,"http://lensmcp.invalid");for(let u of[...t.searchParams.keys()])TC.has(u)&&t.searchParams.delete(u);let r=t.searchParams.toString(),i=`${t.pathname}${r?`?${r}`:""}`;return t.host==="lensmcp.invalid"?i:`${t.origin}${i}`}catch{return e}}s(qy,"G_"),o(qy,"normalizeRequestUrl");function Zy(e){if(e.length===0)return 0;let t=[];for(let{start:u,end:n}of e)t.push({at:u,delta:1}),t.push({at:n+1,delta:-1});t.sort((u,n)=>u.at-n.at||u.delta-n.delta);let r=0,i=0;for(let{delta:u}of t)r+=u,r>i&&(i=r);return i}s(Zy,"J_"),o(Zy,"peakConcurrency");function Ly(e){let t=Ye(e.thresholds).duplicateRequestPeak,r=(e.now??(()=>Date.now()))(),i={endpoints:new Map},u=o((p,m,f)=>{p.open.delete(m),f.windows.length!==0&&(p.recentPeaks.push(f.peak),p.recentPeaks.length>rp&&p.recentPeaks.splice(0,p.recentPeaks.length-rp))},"closeFlow"),n=o(p=>{if(p.source!==UC||p.category!=="network")return;let m=p.raw??null;if(m?.kind!=="fetch-done"&&m?.kind!=="fetch-error"||!m.url||!m.method)return;let f=qy(m.url),h=m.method.toUpperCase();if(typeof m.startedAt!="number")return;let g=m.startedAt,b=g+(typeof m.durationMs=="number"?m.durationMs:0),x=p.context?.originNodeId??null,$=p.context?.flowId??null,w=p.context?.tabId??"-",k=m.requestId??p.context?.requestId,C=k?`${w}|${k}`:void 0,M=`${h} ${f} @ ${x??"-"}`,y=i.endpoints.get(M);y||(y={method:h,url:f,originNodeId:x,open:new Map,recentPeaks:[],totalRequests:0,repeatedReceipts:0,lastSeenAt:p.timestamp,worstEverPeak:0,worstEverAt:p.timestamp}),i.endpoints.delete(M),i.endpoints.set(M,y);let D=y.open.get(w);if(D&&D.flowId!==$&&(u(y,w,D),D=void 0),D||(D={flowId:$,windows:[],byIdentity:new Map,peak:0}),y.open.delete(w),y.open.set(w,D),y.open.size>PC){let[N,K]=y.open.entries().next().value;u(y,N,K)}let A={start:g,end:b},j=C?D.byIdentity.get(C):void 0;if(j&&Uy(j,A))j.start=Math.min(j.start,g),j.end=Math.max(j.end,b),y.repeatedReceipts+=1;else{let N=C?{...A,identity:C}:A;if(D.windows.push(N),C&&D.byIdentity.set(C,N),D.windows.length>Ty)for(let K of D.windows.splice(0,D.windows.length-Ty))K.identity&&D.byIdentity.get(K.identity)===K&&D.byIdentity.delete(K.identity);y.totalRequests+=1}if(D.peak=Zy(D.windows),y.lastSeenAt=p.timestamp,D.peak>y.worstEverPeak&&(y.worstEverPeak=D.peak,y.worstEverAt=p.timestamp),i.endpoints.size>RC){let N=i.endpoints.keys().next().value;N!==void 0&&i.endpoints.delete(N)}i.lastSampleAt=Math.max(i.lastSampleAt??0,p.timestamp),i.changedAt=p.timestamp,e.resources.markDirty(Os)},"handler"),a=e.bus.subscribe(n),l=o(p=>[...p.open.values()].filter(m=>m.windows.length>0).map(m=>m.peak),"openPeaks"),d=o(p=>{let m=[...p.recentPeaks,...l(p)],f=0;for(let h=m.length-1;h>=0&&!((m[h]??0)>=t);h-=1)f+=1;return f},"consecutiveCleanFlows"),c=o(p=>p.worstEverPeak>=t&&d(p)<Ry,"currentlyDuplicated");return e.resources.register(Os,()=>{let p=[...i.endpoints.values()].filter(c);return{schemaVersion:1,revision:e.resources.revision(Os)??0,updatedAt:new Date(i.changedAt??r).toISOString(),peakThreshold:t,endpoints:p.map(m=>({method:m.method,url:m.url,originNodeId:m.originNodeId,peakConcurrent:l(m).at(-1)??0,cleanFlowsSince:d(m),flowsObserved:m.recentPeaks.length+l(m).length,totalRequests:m.totalRequests,repeatedReceipts:m.repeatedReceipts,worstEverPeak:m.worstEverPeak,worstEverAt:m.worstEverAt,lastSeenAt:m.lastSeenAt})).sort((m,f)=>f.peakConcurrent-m.peakConcurrent),endpointsTracked:i.endpoints.size,recentFlowWindow:rp,minCleanFlowsToRetract:Ry,lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No browser fetch has ever been observed \u2014 this is NOT evidence the app fetches cleanly, nothing is watching. Load a page under the dev cluster so flow-fetch events reach this session.":p.length===0?`${i.endpoints.size} endpoint${i.endpoints.size===1?"":"s"} observed; none exceeded ${t} concurrent identical calls.`:`${p.length} endpoint${p.length===1?"":"s"} called \u2265${t}\xD7 concurrently \u2014 usually a hook fetching outside the shared resource cache, multiplied by however many components mount it.`}}),{unsubscribe:a,uris:[Os]}}s(Ly,"yv"),o(Ly,"installDuplicateRequestsReducer");import{App as qC}from"@frontmcp/sdk";import{Resource as ZC,ResourceContext as LC}from"@frontmcp/sdk";var ip=class extends LC{static{s(this,"bv")}static{o(this,"DbSlowQueriesResource")}async execute(){return this.get(Z).read("db://slow-queries")}};ip=F([ZC({name:"db-slow-queries",uri:"db://slow-queries",mimeType:"application/json",description:"Query shapes (project\xB7op\xB7table) whose worst observed duration crosses the slowQueryMs threshold, aggregated live from the pg instrumentation. counts are an undercount for hot shapes (the emitter flood-guards per shape); suppressedEvents carries the drop count."})],ip);var VC=ip;import{Resource as JC,ResourceContext as WC}from"@frontmcp/sdk";var np=class extends WC{static{s(this,"xv")}static{o(this,"DbAnalysisResource")}async execute(){return this.get(Z).read("db://analysis")}};np=F([JC({name:"db-analysis",uri:"db://analysis",mimeType:"application/json",description:"The latest DB analyzer run per project (missing indexes, seq-scan hot spots, unused indexes, migration-parity drift, slow statements) \u2014 ingested from the workspace analyzer's `db-analyze-run` events on the lens bus file."})],np);var GC=np,Vy=class{static{s(this,"_v")}static{o(this,"DbApp")}};Vy=F([qC({id:"db",name:"Db",description:"Database signals: slow query shapes observed live from the pg instrumentation, and the latest externally-ingested analyzer run (missing indexes, migration parity, unused indexes).",resources:[VC,GC]})],Vy);var ei="db://slow-queries",Rs="db://analysis",Jy=50,KC=20,HC=200,XC=1e3,YC=["statements","failed","workMs","recorded","suppressed","unwritten"];function Wy(e){let t=e[gd];if(!t)return;let r=Array.isArray(t.paths)?t.paths:[];for(let i of r){let u=typeof i=="string"?/^findings\[\] \(\+(\d+) items dropped\)$/.exec(i):null;if(u)return Number(u[1])}return r.some(i=>typeof i=="string"&&i.startsWith("findings"))?0:void 0}s(Wy,"jO"),o(Wy,"findingsDroppedByClamp");function Gy(e){let t=Ye(e.thresholds).slowQueryMs,r=(e.now??(()=>Date.now()))(),i={shapes:new Map,analyzeRuns:new Map,accounts:new Map,accountsSeen:0,census:{statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0}},u=o(l=>{let d=l.raw??null;if(d){if(d.kind==="db-query"){let c=d.project??"unknown",p=d.op??"query",m=d.table??"query",f=d.durationMs??0,h=`${c}|${p}|${m}`,g=i.shapes.get(h);if(g||(g={project:c,op:p,table:m,count:0,errorCount:0,totalMs:0,maxMs:0,maxAt:l.timestamp,recent:[],rowsTotal:0,lastSql:"",lastDurationMs:0,lastSeenAt:l.timestamp,suppressed:0}),i.shapes.delete(h),i.shapes.set(h,g),g.count+=1,d.error!==void 0&&(g.errorCount+=1),g.totalMs+=f,f>g.maxMs&&(g.maxMs=f,g.maxAt=l.timestamp),g.recent.push(f),g.recent.length>Jy&&g.recent.splice(0,g.recent.length-Jy),g.rowsTotal+=d.rows??0,d.query&&(g.lastSql=d.query),g.lastDurationMs=f,g.lastSeenAt=l.timestamp,g.suppressed+=d.floodSuppressed??0,i.shapes.size>HC){let b=i.shapes.keys().next().value;b!==void 0&&i.shapes.delete(b)}i.lastQueryAt=Math.max(i.lastQueryAt??0,l.timestamp),i.changedAt=l.timestamp,e.resources.markDirty(ei);return}if(d.kind==="db-request-account"){let c=d,p=typeof c.accountId=="string"?c.accountId:l.id,m=typeof c.seq=="number"?c.seq:0,f=i.accounts.get(p);if(f&&f.seq>=m)return;let h={seq:m,statements:0,failed:0,workMs:0,recorded:0,suppressed:0,unwritten:0};for(let g of YC){let b=c[g];h[g]=typeof b=="number"&&Number.isFinite(b)?b:0,i.census[g]+=h[g]-(f?.[g]??0)}if(f||(i.accountsSeen+=1),i.accounts.delete(p),i.accounts.set(p,h),i.accounts.size>XC){let g=i.accounts.keys().next().value;g!==void 0&&i.accounts.delete(g)}i.changedAt=l.timestamp,e.resources.markDirty(ei);return}if(d.kind==="db-analyze-run"){let c=d.project??"unknown",p=Wy(d);i.analyzeRuns.set(c,{project:c,runAt:d.runAt??l.timestamp,tool:d.tool??"unknown",findings:Array.isArray(d.findings)?d.findings:[],...p!==void 0?{droppedFindings:p}:{}}),qt(i.analyzeRuns,qr),i.lastAnalyzeAt=Math.max(i.lastAnalyzeAt??0,l.timestamp),i.changedAt=l.timestamp,e.resources.markDirty(Rs)}}},"handler"),n=e.bus.subscribe(u),a=o(l=>{if(l.length===0)return 0;let d=[...l].sort((c,p)=>c-p);return d[Math.min(d.length-1,Math.floor(d.length*.95))]??0},"p95");return e.resources.register(ei,()=>{let l=[...i.shapes.values()].filter(d=>d.maxMs>=t);return{schemaVersion:1,revision:e.resources.revision(ei)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,queries:l.map(d=>({project:d.project,op:d.op,table:d.table,count:d.count,errorCount:d.errorCount,maxMs:d.maxMs,maxAt:d.maxAt,avgMs:Math.round(d.totalMs/Math.max(d.count,1)*10)/10,p95Ms:a(d.recent),rowsTotal:d.rowsTotal,lastDurationMs:d.lastDurationMs,lastSeenAt:d.lastSeenAt,lastSql:d.lastSql,suppressedEvents:d.suppressed})).sort((d,c)=>c.maxMs-d.maxMs).slice(0,KC),shapesTracked:i.shapes.size,...i.accountsSeen>0?{requestAccounting:{requests:i.accountsSeen,...i.census}}:{},note:"count/avg are an UNDERCOUNT for hot shapes: the emitter flood-guards each query-shape fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events, reported by the next admitted event of the shape \u2014 drops with none after them are missing from it. requestAccounting, when present, is the requests' own census (statements run vs recorded on the bus), exact including those; per flow, read flow.get's overview.sql.",lastSampleAt:i.lastQueryAt,producer:i.lastQueryAt===void 0?"none":"connected",detail:i.lastQueryAt===void 0?"No db-query event has ever been observed \u2014 this is NOT evidence queries are fast, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps pg) so query timings reach this session.":`${i.shapes.size} query shape${i.shapes.size===1?"":"s"} observed; ${l.length} with a worst duration \u2265${t}ms.`}}),e.resources.register(Rs,()=>{let l=[...i.analyzeRuns.values()].sort((x,$)=>$.runAt-x.runAt),d=l.flatMap(x=>x.findings),c=d.length,p=d.filter(x=>x.severity==="error").length,m=d.filter(x=>x.severity==="warning").length,f=c-p-m,h=l.filter(x=>x.droppedFindings!==void 0),g=h.reduce((x,$)=>x+($.droppedFindings??0),0),b=h.length>0;return{schemaVersion:1,revision:e.resources.revision(Rs)??0,updatedAt:new Date(i.changedAt??r).toISOString(),runs:l,findingCount:c,errorCount:p,warningCount:m,infoCount:f,...b?{incomplete:!0,droppedFindings:g}:{},lastSampleAt:i.lastAnalyzeAt,producer:i.lastAnalyzeAt===void 0?"none":"connected",detail:i.lastAnalyzeAt===void 0?"No db-analyze run has ever been ingested \u2014 this is NOT evidence the schema is healthy, nothing has analyzed it. Run the workspace's DB analyzer (it appends a `db-analyze-run` event to the lens bus file) to populate this.":`${l.length} analyze run${l.length===1?"":"s"} held (latest per project); ${c} finding${c===1?"":"s"} (${p} error, ${m} warning, ${f} info).`+(b?` INCOMPLETE: ${g>0?`${g} more findings were`:"part of a run was"} cut by the bus payload bound before reaching the lens (an event over 32 KiB keeps only the first 64 items of a list), and the cut takes whatever came last. The analyzer must keep one run under that bound, most severe first.`:"")}}),{unsubscribe:n,uris:[ei,Rs]}}s(Gy,"kv"),o(Gy,"installDbReducer");import{App as QC}from"@frontmcp/sdk";import{Resource as ek,ResourceContext as tk}from"@frontmcp/sdk";var sp=class extends tk{static{s(this,"Sv")}static{o(this,"NetEgressHostsResource")}async execute(){return this.get(Z).read("net://egress/hosts")}};sp=F([ek({name:"net-egress-hosts",uri:"net://egress/hosts",mimeType:"application/json",description:"External hosts this backend called (pod \u2192 third party), rolled up per project\xB7host with count, error/4xx/5xx counters, p95 and worst duration, plus the top endpoints under each. `slow` and `failing` are retracted by later healthy responses, so a one-off blip does not warn all day."})],sp);var uk=sp;import{Resource as rk,ResourceContext as ik}from"@frontmcp/sdk";var ap=class extends ik{static{s(this,"Rv")}static{o(this,"NetEgressRecentResource")}async execute(){return this.get(Z).read("net://egress/recent")}};ap=F([rk({name:"net-egress-recent",uri:"net://egress/recent",mimeType:"application/json",description:"The last 200 outbound calls with their RAW path and the flowId that caused them \u2014 the evidence behind net://egress/hosts. Query strings are never captured; treat this as the sensitive view, since a path segment can itself be a secret."})],ap);var nk=ap;import{Resource as sk,ResourceContext as ak}from"@frontmcp/sdk";var op=class extends ak{static{s(this,"Tv")}static{o(this,"NetEgressFailuresResource")}async execute(){return this.get(Z).read("net://egress/failures")}};op=F([sk({name:"net-egress-failures",uri:"net://egress/failures",mimeType:"application/json",description:"Outbound calls that failed \u2014 transport errors and any status \u2265 400 \u2014 kept in their own ring so a high-volume host cannot evict the one failure you need. Empty is NOT proof nothing failed: check `producer`."})],op);var ok=op,Ky=class{static{s(this,"jv")}static{o(this,"NetApp")}};Ky=F([QC({id:"net",name:"Net",description:"Outbound (egress) HTTP the backend makes to THIRD PARTIES \u2014 which external services, how often, how slow, and whether they failed. The server-side twin of runtime://browser/network. Internal service-to-service traffic is deliberately absent: the gateway already attributes it.",resources:[uk,nk,ok]})],Ky);var Ts="net://egress/hosts",Ps="net://egress/recent",Us="net://egress/failures",Iu=20,lk=25,dk=200,ck=20,pk=5,Hy=200,Xy=50,Yy=2;function Qy(e){return e.length===0?!1:!!(/^\d{2,}$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[A-Z][A-Z0-9]*-\d+$/.test(e)||e.length>=16&&/^[A-Za-z0-9_-]+$/.test(e)&&/\d/.test(e))}s(Qy,"ZO"),o(Qy,"isIdSegment");function eE(e){let[t="/"]=e.split("?"),r=t.split("/"),i=[];for(let n of r){if(i.length>12){i.push("\u2026");break}i.push(Qy(n)?":id":n)}let u=i.join("/");return u.length===0?"/":u}s(eE,"Y_"),o(eE,"templatisePath");function tE(e){let t=Ye(e.thresholds).slowEgressMs,r=(e.now??(()=>Date.now()))(),i={hosts:new Map,recent:[],failures:[]},u=o(p=>{let m=p.raw??null;if(!m||m.kind!=="egress")return;let f=m.project??"unknown",h=m.host??"unknown",g=(m.method??"GET").toUpperCase(),b=m.durationMs??0,x=typeof m.status=="number"?m.status:void 0,$=m.error===void 0?void 0:String(m.error),w=$!==void 0||x!==void 0&&x>=400,k=m.path??"(path not captured \u2014 upgrade @lensmcp/node-instrumentation)",C=`${f}|${h}`,M=i.hosts.get(C);M||(M={project:f,host:h,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,maxAt:p.timestamp,recent:[],outcomes:[],firstSeenAt:p.timestamp,lastSeenAt:p.timestamp,lastDurationMs:0,lastBad:!1,suppressed:0,endpoints:new Map}),i.hosts.delete(C),i.hosts.set(C,M),M.count+=1,$!==void 0&&(M.errorCount+=1),x!==void 0&&x>=400&&x<500&&(M.status4xx+=1),x!==void 0&&x>=500&&(M.status5xx+=1),M.totalMs+=b,b>M.maxMs&&(M.maxMs=b,M.maxAt=p.timestamp),M.recent.push(b),M.recent.length>Iu&&M.recent.splice(0,M.recent.length-Iu),M.outcomes.push(w),M.outcomes.length>Iu&&M.outcomes.splice(0,M.outcomes.length-Iu),M.lastDurationMs=b,M.lastBad=w,M.lastSeenAt=p.timestamp,M.suppressed+=m.floodSuppressed??0;let y=eE(k),D=`${g} ${y}`,A=M.endpoints.get(D);if(A||(A={method:g,path:y,count:0,errorCount:0,status4xx:0,status5xx:0,totalMs:0,maxMs:0,recent:[],lastDurationMs:0,lastSeenAt:p.timestamp}),M.endpoints.delete(D),M.endpoints.set(D,A),A.count+=1,$!==void 0&&(A.errorCount+=1,A.lastError=$),x!==void 0&&x>=400&&x<500&&(A.status4xx+=1),x!==void 0&&x>=500&&(A.status5xx+=1),A.totalMs+=b,b>A.maxMs&&(A.maxMs=b),A.recent.push(b),A.recent.length>Iu&&A.recent.splice(0,A.recent.length-Iu),A.lastStatus=x,A.lastDurationMs=b,A.lastSeenAt=p.timestamp,M.endpoints.size>ck){let K=M.endpoints.keys().next().value;K!==void 0&&M.endpoints.delete(K)}if(i.hosts.size>dk){let K=i.hosts.keys().next().value;K!==void 0&&i.hosts.delete(K)}let j=p.context??{},N={id:p.id,timestamp:p.timestamp,project:f,method:g,host:h,path:k,...x!==void 0?{status:x}:{},...$!==void 0?{error:$}:{},durationMs:b,...j.flowId?{flowId:j.flowId}:{},...j.requestId?{requestId:j.requestId}:{}};i.recent.push(N),i.recent.length>Hy&&i.recent.splice(0,i.recent.length-Hy),w&&(i.failures.push(N),i.failures.length>Xy&&i.failures.splice(0,i.failures.length-Xy),e.resources.markDirty(Us)),i.lastSampleAt=Math.max(i.lastSampleAt??0,p.timestamp),i.changedAt=p.timestamp,e.resources.markDirty(Ts),e.resources.markDirty(Ps)},"handler"),n=e.bus.subscribe(u),a=o(p=>{if(p.length===0)return 0;let m=[...p].sort((f,h)=>f-h);return m[Math.min(m.length-1,Math.floor(m.length*.95))]??0},"p95"),l=o(p=>p.lastDurationMs>=t||p.recent.filter(m=>m>=t).length>=Yy,"isSlow"),d=o(p=>p.lastBad||p.outcomes.filter(Boolean).length>=Yy,"isFailing"),c=o(p=>{let m=p.outcomes.filter(Boolean).length;return d(p)?`${m} of the last ${p.outcomes.length} call${p.outcomes.length===1?"":"s"} failed`:l(p)?`${p.recent.filter(f=>f>=t).length} of the last ${p.recent.length} call${p.recent.length===1?"":"s"} took \u2265${t}ms`:"healthy"},"describe");return e.resources.register(Ts,()=>{let p=[...i.hosts.values()],m=p.filter(d),f=p.filter(h=>!d(h)&&l(h));return{schemaVersion:1,revision:e.resources.revision(Ts)??0,updatedAt:new Date(i.changedAt??r).toISOString(),thresholdMs:t,hosts:p.map(h=>({project:h.project,host:h.host,count:h.count,errorCount:h.errorCount,status4xx:h.status4xx,status5xx:h.status5xx,avgMs:Math.round(h.totalMs/Math.max(h.count,1)*10)/10,p95Ms:a(h.recent),maxMs:h.maxMs,maxAt:h.maxAt,lastDurationMs:h.lastDurationMs,firstSeenAt:h.firstSeenAt,lastSeenAt:h.lastSeenAt,slow:l(h),failing:d(h),detail:c(h),suppressedEvents:h.suppressed,endpoints:[...h.endpoints.values()].map(g=>({method:g.method,path:g.path,count:g.count,errorCount:g.errorCount,status4xx:g.status4xx,status5xx:g.status5xx,avgMs:Math.round(g.totalMs/Math.max(g.count,1)*10)/10,p95Ms:a(g.recent),maxMs:g.maxMs,...g.lastStatus!==void 0?{lastStatus:g.lastStatus}:{},...g.lastError!==void 0?{lastError:g.lastError}:{},lastSeenAt:g.lastSeenAt})).sort((g,b)=>b.maxMs-g.maxMs).slice(0,pk)})).sort((h,g)=>h.failing!==g.failing?h.failing?-1:1:g.maxMs-h.maxMs).slice(0,lk),hostsTracked:i.hosts.size,failingHosts:m.length,slowHosts:f.length,note:"count/avg are an UNDERCOUNT for hot hosts: the emitter flood-guards each host fingerprint at 30 burst / 5 events/s; suppressedEvents is the emitter's own count of dropped events. Query strings are not captured; endpoint paths are templatised (\u2026/:id).",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching. Run the backend under the dev cluster (the @lensmcp/cluster serve preload taps fetch and http/https) so outbound calls reach this session. Internal destinations (*.local, loopback, RFC1918) are skipped by design \u2014 the gateway already attributes service-to-service traffic.":`${i.hosts.size} external host${i.hosts.size===1?"":"s"} observed; ${m.length} failing, ${f.length} slower than ${t}ms.`}}),e.resources.register(Ps,()=>({schemaVersion:1,revision:e.resources.revision(Ps)??0,updatedAt:new Date(i.changedAt??r).toISOString(),entries:[...i.recent],count:i.recent.length,note:"Raw paths, as requested. flowId joins an outbound call back to the click that caused it. Treat this as the sensitive view: a path segment can itself be a secret (a presigned key, a reset token), which the templatised rollup collapses but this does not.",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 this is NOT evidence the app makes no external calls, nothing is watching.":`${i.recent.length} recent outbound call${i.recent.length===1?"":"s"}.`})),e.resources.register(Us,()=>({schemaVersion:1,revision:e.resources.revision(Us)??0,updatedAt:new Date(i.changedAt??r).toISOString(),entries:[...i.failures],count:i.failures.length,note:"A separate ring from net://egress/recent on purpose: a host called 200\xD7/min would otherwise evict the one 503 you need.",lastSampleAt:i.lastSampleAt,producer:i.lastSampleAt===void 0?"none":"connected",detail:i.lastSampleAt===void 0?"No egress event has ever been observed \u2014 an empty list here is NOT evidence that nothing failed, nothing is watching.":`${i.failures.length} failed outbound call${i.failures.length===1?"":"s"} held.`})),{unsubscribe:n,uris:[Ts,Ps,Us]}}s(tE,"zv"),o(tE,"installNetReducer");import{App as mk}from"@frontmcp/sdk";import{Resource as fk,ResourceContext as hk}from"@frontmcp/sdk";var lp=class extends hk{static{s(this,"Ov")}static{o(this,"VisualCurrentResource")}async execute(){return this.get(Z).read("visual://current")}};lp=F([fk({name:"visual-current",uri:"visual://current",mimeType:"application/json",description:"Most recent visual-frame (causedBy, changedNodes, stable)."})],lp);var gk=lp;import{Resource as vk,ResourceContext as yk}from"@frontmcp/sdk";var dp=class extends yk{static{s(this,"Nv")}static{o(this,"VisualViolationsCurrentResource")}async execute(){return this.get(Z).read("visual://violations/current")}};dp=F([vk({name:"visual-violations-current",uri:"visual://violations/current",mimeType:"application/json",description:"Violations of the CURRENT frame, regardless of timing mode. Every rule re-runs per frame, so a fixed violation simply stops being reported."})],dp);var Ek=dp;import{Resource as bk,ResourceContext as wk}from"@frontmcp/sdk";var cp=class extends wk{static{s(this,"Dv")}static{o(this,"VisualViolationsStableResource")}async execute(){return this.get(Z).read("visual://violations/stable")}};cp=F([bk({name:"visual-violations-stable",uri:"visual://violations/stable",mimeType:"application/json",description:'Violations from rules with timing "after-animation" | "stable-only" | "always".'})],cp);var Dk=cp;import{Resource as $k,ResourceContext as Bk}from"@frontmcp/sdk";var pp=class extends Bk{static{s(this,"Uv")}static{o(this,"VisualViolationsDuringAnimationResource")}async execute(){return this.get(Z).read("visual://violations/during-animation")}};pp=F([$k({name:"visual-violations-during-animation",uri:"visual://violations/during-animation",mimeType:"application/json",description:"Violations seen on midpoint (during-animation) samples only."})],pp);var xk=pp;import{Resource as Ck,ResourceContext as kk}from"@frontmcp/sdk";var mp=class extends kk{static{s(this,"Fv")}static{o(this,"VisualRulesResource")}async execute(){return this.get(Z).read("visual://rules")}};mp=F([Ck({name:"visual-rules",uri:"visual://rules",mimeType:"application/json",description:"All registered visual rules (builtins + lensmcp.rules.json + visual.register_rule)."})],mp);var Ak=mp;import{Resource as Ik,ResourceContext as _k}from"@frontmcp/sdk";var fp=class extends _k{static{s(this,"Zv")}static{o(this,"VisualTokensResource")}async execute(){return this.get(Z).read("visual://tokens")}};fp=F([Ik({name:"visual-tokens",uri:"visual://tokens",mimeType:"application/json",description:"Resolved design tokens from lensmcp.tokens.json."})],fp);var Sk=fp;import{Tool as Fk,ToolContext as jk,z as uE}from"@frontmcp/sdk";import{existsSync as zk,mkdirSync as Nk,readFileSync as Mk,writeFileSync as Ok}from"node:fs";import{dirname as Rk,join as hp}from"node:path";function gp(e=process.env,t=process.cwd()){let r=e.LENSMCP_EVENT_FILE;return r?Rk(r):hp(t,".lensmcp")}s(gp,"Ua"),o(gp,"captureDir");function rE(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(rE,"aM"),o(rE,"pidAlive");function vp(e,t=rE){let r=hp(e,UD);try{if(!zk(r))return;let i=JSON.parse(Mk(r,"utf8"));return typeof i?.pid!="number"||!Number.isFinite(i.pid)?void 0:t(i.pid)?i:void 0}catch{return}}s(vp,"La"),o(vp,"liveRunner");function iE(e,t){try{return Nk(e,{recursive:!0}),Ok(hp(e,PD),JSON.stringify(t)),!0}catch{return!1}}s(iE,"Q_"),o(iE,"publishCaptureRequest");var yp;async function nE(e,t){let r=yp;if(r)return{fresh:await r.promise,coalesced:!0,requestId:r.requestId};let i=t().finally(()=>{yp=void 0});return yp={promise:i,requestId:e},{fresh:await i,coalesced:!1,requestId:e}}s(nE,"ek"),o(nE,"captureSingleFlight");async function sE(e){let t=e.now??(()=>Date.now()),r=e.sleep??(a=>new Promise(l=>setTimeout(l,a))),i=e.budgetMs??8e3,u=e.pollMs??100,n=t()+i;for(;t()<n;){await r(u);let a=await e.readFrameId();if(a!==void 0&&a!==e.before)return!0}return!1}s(sE,"tk"),o(sE,"waitForFreshFrame");var Ep=class extends jk{static{s(this,"Jv")}static{o(this,"VisualCaptureFrameTool")}async execute(e){let t=this.get(Ur),r=this.get(Z),i=o(async()=>(await r.read("visual://current"))?.frame?.id,"readFrameId"),u=await i(),n=lt(),a=Date.now();t.publish({id:lt(),sessionId:"visual.capture_frame",timestamp:a,source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.capture_frame"},fingerprint:`visual-capture-request:${e.cause}`,title:`visual.capture_frame(${e.cause})`,raw:{kind:"visual-capture-request",cause:e.cause,stable:e.stable,requestId:n}});let l=gp(),d=vp(l),c=!1,p=await nE(n,async()=>(c=iE(l,{requestedAt:a,cause:e.cause,stable:e.stable,requestId:n}),c&&d?await sE({readFrameId:i,before:u}):!1));return{requested:p.coalesced?!0:c,cause:e.cause,stable:e.stable,fresh:p.fresh,coalesced:p.coalesced,requestId:p.requestId,waitedMs:Date.now()-a,runner:d?{pid:d.pid,url:d.url}:void 0,latest:await r.read("visual://current")}}};Ep=F([Fk({name:"visual.capture_frame",description:"Capture a fresh visual frame. Signals the host capture runner (which launches a headless browser on demand), waits for the new frame, and returns it. Frames are captured per request \u2014 no browser is held open between calls.",inputSchema:{cause:uE.enum(["page-load","route-change","user-action","react-commit","state-update","api-response","hmr-update","animation-tick"]).default("user-action").describe("Hint why this frame is being requested."),stable:uE.boolean().default(!0).describe("Whether to treat the captured frame as the stable final state.")}})],Ep);var Tk=Ep;import{Tool as Pk,ToolContext as Uk,z as qk}from"@frontmcp/sdk";var bp=class extends Uk{static{s(this,"Kv")}static{o(this,"VisualInspectNodeTool")}async execute(e){let t=await this.get(Z).read("visual://current");if(!t.frame)return{found:!1,uid:e.uid};let r=t.frame.changedNodes.filter(i=>i.uid===e.uid);return{found:r.length>0,uid:e.uid,frameId:t.frame.id,changes:r}}};bp=F([Pk({name:"visual.inspect_node",description:"Returns the changedNodes entry for `uid` from visual://current \u2014 the per-property before/after used to compute the latest frame.",inputSchema:{uid:qk.string().describe('Node uid as it appeared in visual://current.changedNodes (e.g. "hero-card" or "bid:42").')}})],bp);var Zk=bp;import{Tool as Lk,ToolContext as Vk,z as Jk}from"@frontmcp/sdk";var wp=class extends Vk{static{s(this,"Hv")}static{o(this,"VisualCompareFramesTool")}async execute(e){let t=await this.get(Z).read("visual://current");return t.frame?e.frameId&&e.frameId!==t.frame.id?{found:!1,reason:"Only the latest frame is retained in Phase 4."}:{found:!0,frameId:t.frame.id,causedBy:t.frame.causedBy,changedCount:t.frame.changedNodes.length,appeared:t.frame.appearedNodes.length,disappeared:t.frame.disappearedNodes.length,changedNodes:t.frame.changedNodes.slice(0,50)}:{found:!1}}};wp=F([Lk({name:"visual.compare_frames",description:"Summarises the last visual-frame. Phase 4 ships a single-frame view (Phase 6 adds story-relative deltas).",inputSchema:{frameId:Jk.string().optional().describe("Optional frame id; defaults to the latest.")}})],wp);var Wk=wp;import{Tool as Gk,ToolContext as Kk,z as Hk}from"@frontmcp/sdk";var Dp=class extends Kk{static{s(this,"Qv")}static{o(this,"VisualExplainViolationTool")}async execute(e){let t=(await this.get(Z).read("visual://violations/current")).violations.find(r=>r.id===e.violationId);return t?{found:!0,violation:t,explanation:aE(t)}:{found:!1,violationId:e.violationId}}};Dp=F([Gk({name:"visual.explain_violation",description:"Returns the full violation record (rule id + expected/actual + evidence.cssCause / trace / screenshot crop URIs) for a given violationId.",inputSchema:{violationId:Hk.string().describe("Id of the violation as seen in visual://violations/current.")}})],Dp);var Xk=Dp;function aE(e){let t=[`Rule ${e.ruleId} (${e.ruleType}) at ${e.element.component??e.element.uid}.`,`Expected: ${JSON.stringify(e.expected)}`,`Actual: ${JSON.stringify(e.actual)}`];return e.evidence.cssCause&&t.push(`CSS cause: ${e.evidence.cssCause.selector} { ${e.evidence.cssCause.declaration??"?"} }`+(e.evidence.cssCause.file?` @ ${e.evidence.cssCause.file}:${e.evidence.cssCause.line??"?"}`:"")),e.evidence.trace&&t.push(`Trace: ${e.evidence.trace}`),e.evidence.screenshotCrop&&t.push(`Crop: ${e.evidence.screenshotCrop}`),t.join(`
|
|
71
|
+
`)}s(aE,"bM"),o(aE,"buildExplanation");import{Tool as Yk,ToolContext as Qk,z as Me}from"@frontmcp/sdk";import{mkdirSync as e7,readFileSync as t7,renameSync as u7,writeFileSync as r7}from"node:fs";import{join as i7}from"node:path";var n7=500;function oE(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(oE,"IM"),o(oE,"pidAlive");function lE(e){try{let t=JSON.parse(t7(e,"utf8"));return Array.isArray(t?.rules)?t.rules:[]}catch{return[]}}s(lE,"RM"),o(lE,"readEntries");function dE(e,t,r={}){let i=r.pid??process.pid,u=r.isAlive??oE,n=i7(e,qD),a=[...lE(n).filter(d=>typeof d?.registeredBy=="number"&&typeof d?.rule?.id=="string"&&d.rule.id!==t.id&&(d.registeredBy===i||u(d.registeredBy))),{rule:t,registeredBy:i,registeredAt:(r.now??Date.now)()}].slice(-n7);e7(e,{recursive:!0});let l=`${n}.${i}.tmp`;return r7(l,JSON.stringify({schemaVersion:1,rules:a})),u7(l,n),a}s(dE,"nk"),o(dE,"registerSessionRule");var $p=class extends Qk{static{s(this,"ty")}static{o(this,"VisualRegisterRuleTool")}async execute(e){let t=this.get(Ur),r=this.get(Z),i={id:e.id,type:e.type,target:e.target,severity:e.severity,timing:e.timing,expected:e.expected,breakpoints:e.breakpoints};t.publish({id:lt(),sessionId:"visual.register_rule",timestamp:Date.now(),source:"visual",category:"visual",severity:"info",context:{sessionId:"visual.register_rule"},fingerprint:`visual-rule-registered:${e.id}`,title:`visual.register_rule(${e.id})`,raw:{kind:"visual-rule-registered",rule:i}});let u=gp(),n=!1,a;try{dE(u,i),n=vp(u)!==void 0,a=n?"The capture runner evaluates this rule on the next captured frame (visual.capture_frame).":"No capture runner is listening, so nothing will evaluate this rule until one starts (the dev cluster gateway or agent-dev). It is listed, not enforced."}catch(l){a=`Could not hand the rule to the capture runner (${l.message}). It is listed, but will NOT be evaluated.`}return{registered:!0,evaluated:n,note:a,rule:{id:e.id,type:e.type,target:e.target},rules:await r.read("visual://rules")}}};$p=F([Yk({name:"visual.register_rule",description:"Register (or replace) a visual rule. It is handed to the capture runner, which evaluates it on every frame captured from now on, for as long as this lens server runs. The result says whether a runner is listening; if `evaluated` is false the rule is only listed, and no violation can come of it.",inputSchema:{id:Me.string().describe("Stable rule id; replaces a prior rule with the same id."),type:Me.enum(["grid-spacing","alignment","overflow","text-clipping","color-contrast","token-usage","z-index","responsive","custom"]).describe("Built-in rule type to evaluate."),target:Me.string().optional().describe('CSS-like selector / role:label / [data-agent-component="\u2026"]; default = every node.'),severity:Me.enum(["info","warning","error"]).default("warning"),timing:Me.enum(["always","after-animation","stable-only","during-animation"]).default("always"),expected:Me.record(Me.string(),Me.unknown()).default({}).describe('Rule-type-specific expectations (e.g. { gap: "spacing.6" }).'),breakpoints:Me.record(Me.string(),Me.record(Me.string(),Me.unknown())).optional().describe("Per-breakpoint expectation overrides for the responsive rule type.")}})],$p);var s7=$p,cE=class{static{s(this,"ny")}static{o(this,"VisualApp")}};cE=F([mk({id:"visual",name:"Visual",description:"Visual rule engine: DOMSnapshot/LayerTree diffs, grid/alignment/overflow/contrast/z-index rules, design tokens.",resources:[gk,Ek,Dk,xk,Ak,Sk],tools:[Tk,Zk,Wk,Xk,s7]})],cE);var ti="visual://current",ui="visual://violations/current",ri="visual://violations/stable",ii="visual://violations/during-animation",ni="visual://rules",si="visual://tokens";function pE(e){let t=(e.now??(()=>Date.now()))(),r={violations:[],rules:[],framesSeen:0,changedAt:new Map},i=o((f,h)=>{r.changedAt.set(f,h),e.resources.markDirty(f)},"touch"),u=o(f=>{i(ui,f),i(ri,f),i(ii,f)},"touchViolationViews"),n=o(f=>{let h=f.raw??null;if(h?.kind)switch(h.kind){case"visual-frame":{let g=h.frame;if(!g)return;r.currentFrame=g,r.lastFrameAt=f.timestamp,r.framesSeen+=1,r.rulesEvaluated=typeof h.rulesEvaluated=="number"?h.rulesEvaluated:void 0,i(ti,f.timestamp);let b=r.violations.length;r.violations=r.violations.filter(x=>x.frameId===g.id),b!==r.violations.length&&u(f.timestamp);return}case"visual-violation":if(!h.violation)return;r.violations.push(h.violation),r.violations.length>50&&r.violations.splice(0,r.violations.length-50),u(f.timestamp);return;case"visual-rule-registered":{let g=h.rule;if(!g)return;let b=r.rules.findIndex(x=>x.id===g.id);b>=0&&r.rules.splice(b,1),r.rules.push(g),r.rules.length>500&&r.rules.splice(0,r.rules.length-500),i(ni,f.timestamp);return}case"visual-tokens-loaded":if(!h.tokens)return;r.tokens=h.tokens,i(si,f.timestamp);return;default:return}},"handler"),a=e.bus.subscribe(n),l=o(f=>new Date(r.changedAt.get(f)??t).toISOString(),"stamp"),d="No visual frame has ever been captured \u2014 an empty violation list is NOT evidence the UI is correct, nothing is looking. Drive a capture (visual_capture_frame) or run the browser-capture loop so frames reach this session.",c=o(()=>`${r.framesSeen} frame${r.framesSeen===1?"":"s"} captured`,"frameCount"),p=o(()=>({framesSeen:r.framesSeen,lastFrameAt:r.lastFrameAt,currentFrameId:r.currentFrame?.id,...r.rulesEvaluated!==void 0?{rulesEvaluated:r.rulesEvaluated}:{},producer:r.framesSeen===0?"none":"connected",detail:r.framesSeen===0?d:r.rulesEvaluated===void 0?`${c()}; ${r.rules.length} rule${r.rules.length===1?"":"s"} registered.`:`${c()}; ${r.rulesEvaluated} rule${r.rulesEvaluated===1?"":"s"} evaluated on the current one.`}),"frameHealth"),m=o(()=>{let f=p();return r.framesSeen===0||r.rulesEvaluated===void 0?r.framesSeen===0?f:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}:r.rulesEvaluated===0?{...f,producer:"none",detail:`${c()}, but NO rule was evaluated on the current one \u2014 an empty violation list is NOT evidence the UI is correct, nothing is being checked. Add rules to \`lensmcp.rules.json\` at the workspace root, or register one with visual.register_rule.`}:{...f,detail:`${f.detail} Violations are those of the CURRENT frame \u2014 every rule is re-run per frame, so anything fixed simply stops being reported.`}},"violationHealth");return e.resources.register(ti,()=>({schemaVersion:1,revision:e.resources.revision(ti)??0,updatedAt:l(ti),frame:r.currentFrame??null,...p()})),e.resources.register(ui,()=>({schemaVersion:1,revision:e.resources.revision(ui)??0,updatedAt:l(ui),violations:r.violations.slice(),...m()})),e.resources.register(ri,()=>({schemaVersion:1,revision:e.resources.revision(ri)??0,updatedAt:l(ri),violations:r.violations.filter(f=>f.timing==="after-animation"||f.timing==="stable-only"||f.timing==="always"),...m()})),e.resources.register(ii,()=>({schemaVersion:1,revision:e.resources.revision(ii)??0,updatedAt:l(ii),violations:r.violations.filter(f=>f.timing==="during-animation"),...m()})),e.resources.register(ni,()=>({schemaVersion:1,revision:e.resources.revision(ni)??0,updatedAt:l(ni),rules:r.rules.slice()})),e.resources.register(si,()=>({schemaVersion:1,revision:e.resources.revision(si)??0,updatedAt:l(si),tokens:r.tokens??null})),{unsubscribe:a,uris:[ti,ui,ri,ii,ni,si]}}s(pE,"oy"),o(pE,"installVisualReducer");import{App as a7}from"@frontmcp/sdk";import{Resource as o7,ResourceContext as l7}from"@frontmcp/sdk";var Bp=class extends l7{static{s(this,"iy")}static{o(this,"ReactPagesCurrentResource")}async execute(){return this.get(Z).read("react://pages/current")}};Bp=F([o7({name:"react-pages-current",uri:"react://pages/current",mimeType:"application/json",description:"The most recently active React page (from <LensmcpRoot>)."})],Bp);var d7=Bp;import{Resource as c7,ResourceContext as p7}from"@frontmcp/sdk";var xp=class extends p7{static{s(this,"ay")}static{o(this,"ReactComponentsHotResource")}async execute(){return this.get(Z).read("react://components/hot")}};xp=F([c7({name:"react-components-hot",uri:"react://components/hot",mimeType:"application/json",description:"Components ranked by render count this session."})],xp);var m7=xp;import{Resource as f7,ResourceContext as h7}from"@frontmcp/sdk";var Cp=class extends h7{static{s(this,"uy")}static{o(this,"ReactRendersSlowResource")}async execute(){return this.get(Z).read("react://renders/slow")}};Cp=F([f7({name:"react-renders-slow",uri:"react://renders/slow",mimeType:"application/json",description:"Renders with actualDurationMs >= threshold (default 16ms)."})],Cp);var g7=Cp;import{Resource as v7,ResourceContext as y7}from"@frontmcp/sdk";var kp=class extends y7{static{s(this,"dy")}static{o(this,"ReactRendersRecentResource")}async execute(){return this.get(Z).read("react://renders/recent")}};kp=F([v7({name:"react-renders-recent",uri:"react://renders/recent",mimeType:"application/json",description:"Last 100 render commits with attribution (why)."})],kp);var E7=kp;import{Resource as b7,ResourceContext as w7}from"@frontmcp/sdk";var Ap=class extends w7{static{s(this,"fy")}static{o(this,"ReactEffectsRecentResource")}async execute(){return this.get(Z).read("react://effects/recent")}};Ap=F([b7({name:"react-effects-recent",uri:"react://effects/recent",mimeType:"application/json",description:"Last 100 useEffect runs/cleanups from tracedUseEffect."})],Ap);var D7=Ap;import{Resource as $7,ResourceContext as B7}from"@frontmcp/sdk";var Ip=class extends B7{static{s(this,"hy")}static{o(this,"ReactMemosRecomputedResource")}async execute(){return this.get(Z).read("react://memos/recomputed")}};Ip=F([$7({name:"react-memos-recomputed",uri:"react://memos/recomputed",mimeType:"application/json",description:"Recent useMemo recomputations (depsHash changed)."})],Ip);var x7=Ip;import{Resource as C7,ResourceContext as k7}from"@frontmcp/sdk";var _p=class extends k7{static{s(this,"vy")}static{o(this,"ReactHooksRecentResource")}async execute(){return this.get(Z).read("react://hooks/recent")}};_p=F([C7({name:"react-hooks-recent",uri:"react://hooks/recent",mimeType:"application/json",description:"Recent hook-run events (useMemo / useCallback)."})],_p);var A7=_p;import{Tool as I7,ToolContext as _7,z as Sp}from"@frontmcp/sdk";var Fp=class extends _7{static{s(this,"wy")}static{o(this,"GraphExplainRerenderTool")}async execute(e){let t=await this.get(Z).read("react://renders/recent"),r;if(e.renderNodeId)r=t.renders.find(u=>u.id===e.renderNodeId);else if(e.componentInstanceId)for(let u=t.renders.length-1;u>=0;u--){let n=t.renders[u];if(n&&n.componentInstanceId===e.componentInstanceId){r=n;break}}else if(e.componentLogicalId)for(let u=t.renders.length-1;u>=0;u--){let n=t.renders[u];if(n&&n.componentLogicalId===e.componentLogicalId){r=n;break}}if(!r)return{found:!1,searched:e};let i=(r.why??[]).map(u=>({...u,summary:mE(u)}));return{found:!0,renderNodeId:r.id,componentInstanceId:r.componentInstanceId,componentLogicalId:r.componentLogicalId,componentName:r.componentName,page:r.page,route:r.route,phase:r.phase,actualDurationMs:r.actualDurationMs,why:i,parentRenderId:r.parentRenderId}}};Fp=F([I7({name:"graph.explain_rerender",description:"Returns the most recent render record for a component (by `renderNodeId`, `componentInstanceId`, or `componentLogicalId`), with its `why` causal list (valtio-path / parent-render / hook-dep-changed / props / context / react-state / force).",inputSchema:{renderNodeId:Sp.string().optional().describe("Exact render commit id from react://renders/recent."),componentInstanceId:Sp.string().optional().describe("Component instance id; resolves to that instance\u2019s last render."),componentLogicalId:Sp.string().optional().describe("Component logical id (e.g. react:component:src/App.tsx:CardGrid); resolves to its most recent render across HMR generations.")}})],Fp);var S7=Fp;function mE(e){switch(e.type){case"valtio-path":return`valtio path ${String(e.path)} changed (${e.changedKeys?.join(",")??""})`;case"react-state":return`useState hook #${String(e.hookIndex)} changed`;case"context":return`context ${String(e.contextName)} changed`;case"props":return`prop(s) changed: ${e.changedKeys?.join(",")??""}`;case"parent-render":return`parent render ${String(e.parentRenderId)} triggered this`;case"hook-dep-changed":return`hook ${String(e.hookInstanceId)} deps changed`;case"force":return`forced render: ${String(e.reason)}`;default:return`unknown cause: ${JSON.stringify(e)}`}}s(mE,"JM"),o(mE,"summariseWhy");var fE=class{static{s(this,"$y")}static{o(this,"ReactApp")}};fE=F([a7({id:"react",name:"React",description:"React render attribution: pages, hot components, slow renders, hook + effect + memo events. Hosts graph.explain_rerender.",resources:[d7,m7,g7,E7,D7,x7,A7],tools:[S7]})],fE);var ai="react://pages/current",qs="react://components/hot",Zs="react://renders/slow",Ls="react://renders/recent",Vs="react://effects/recent",Js="react://memos/recomputed",Ws="react://hooks/recent",Gs=100,jp=50,hE=500;function gE(e){let t=Ye(e.thresholds).slowRenderMs,r={rendersRecent:[],rendersSlow:[],effectsRecent:[],hooksRecent:[],memosRecomputed:[],rendersByInstance:new Map,hotByLogical:new Map},i=o(n=>{if(n.source!=="react")return;let a=n.raw??null;if(a?.kind)switch(a.kind){case"render":{let l=a.render;if(!l)return;if(_u(r.rendersRecent,l,Gs),r.rendersByInstance.delete(l.componentInstanceId),r.rendersByInstance.set(l.componentInstanceId,l),r.rendersByInstance.size>hE){for(let c of r.rendersByInstance.keys())if(r.rendersByInstance.delete(c),r.rendersByInstance.size<=hE)break}l.actualDurationMs>=t&&(_u(r.rendersSlow,l,jp),r.rendersSlow.sort((c,p)=>p.actualDurationMs-c.actualDurationMs),r.rendersSlow.length>jp&&(r.rendersSlow.length=jp));let d=r.hotByLogical.get(l.componentLogicalId);d?(d.renderCount+=1,d.totalActualMs+=l.actualDurationMs,d.lastRenderId=l.id):r.hotByLogical.set(l.componentLogicalId,{componentLogicalId:l.componentLogicalId,componentName:l.componentName,renderCount:1,totalActualMs:l.actualDurationMs,lastRenderId:l.id}),(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:n.timestamp},e.resources.markDirty(ai)),e.resources.markDirty(Ls),e.resources.markDirty(qs),l.actualDurationMs>=t&&e.resources.markDirty(Zs);return}case"effect-run":{let l=a.effect;if(!l)return;_u(r.effectsRecent,l,Gs),e.resources.markDirty(Vs);return}case"hook-run":{let l=a.hook;if(!l)return;_u(r.hooksRecent,l,Gs),e.resources.markDirty(Ws),l.recomputed&&l.hookType==="useMemo"&&(_u(r.memosRecomputed,l,Gs),e.resources.markDirty(Js));return}case"component-mount":case"component-unmount":{let l=a.component;if(!l)return;(l.page||l.route)&&(r.currentPage={page:l.page??"(unknown)",route:l.route,updatedAt:n.timestamp},e.resources.markDirty(ai));return}default:return}},"handler"),u=e.bus.subscribe(i);return e.resources.register(ai,()=>({schemaVersion:1,revision:e.resources.revision(ai)??0,updatedAt:new Date().toISOString(),page:r.currentPage??null})),e.resources.register(qs,()=>({schemaVersion:1,revision:e.resources.revision(qs)??0,updatedAt:new Date().toISOString(),components:[...r.hotByLogical.values()].sort((n,a)=>a.renderCount-n.renderCount)})),e.resources.register(Zs,()=>({schemaVersion:1,revision:e.resources.revision(Zs)??0,updatedAt:new Date().toISOString(),thresholdMs:t,renders:r.rendersSlow.slice()})),e.resources.register(Ls,()=>({schemaVersion:1,revision:e.resources.revision(Ls)??0,updatedAt:new Date().toISOString(),renders:r.rendersRecent.slice()})),e.resources.register(Vs,()=>({schemaVersion:1,revision:e.resources.revision(Vs)??0,updatedAt:new Date().toISOString(),effects:r.effectsRecent.slice()})),e.resources.register(Js,()=>({schemaVersion:1,revision:e.resources.revision(Js)??0,updatedAt:new Date().toISOString(),memos:r.memosRecomputed.slice()})),e.resources.register(Ws,()=>({schemaVersion:1,revision:e.resources.revision(Ws)??0,updatedAt:new Date().toISOString(),hooks:r.hooksRecent.slice()})),{unsubscribe:u,uris:[ai,qs,Zs,Ls,Vs,Js,Ws],lookups:{latestRenderFor(n){return r.rendersByInstance.get(n)},latestRenderForLogical(n){if(r.hotByLogical.get(n))for(let a=r.rendersRecent.length-1;a>=0;a--){let l=r.rendersRecent[a];if(l&&l.componentLogicalId===n)return l}}}}}s(gE,"ky"),o(gE,"installReactReducer");function _u(e,t,r){e.push(t),e.length>r&&e.splice(0,e.length-r)}s(_u,"Lo"),o(_u,"pushBounded");import{App as F7}from"@frontmcp/sdk";import{Resource as j7,ResourceContext as z7}from"@frontmcp/sdk";var zp=class extends z7{static{s(this,"Sy")}static{o(this,"ValtioUpdatesRecentResource")}async execute(){return this.get(Z).read("valtio://updates/recent")}};zp=F([j7({name:"valtio-updates-recent",uri:"valtio://updates/recent",mimeType:"application/json",description:"Last 100 Valtio state-update events with path + changedKeys + subscribers."})],zp);var N7=zp;import{Resource as M7,ResourceContext as O7}from"@frontmcp/sdk";var Np=class extends O7{static{s(this,"Ry")}static{o(this,"ValtioStoresResource")}async execute(){return this.get(Z).read("valtio://stores")}};Np=F([M7({name:"valtio-stores",uri:"valtio://stores",mimeType:"application/json",description:"Registered Valtio stores (created via lensmcp-wrapped proxy())."})],Np);var R7=Np;import{Resource as T7,ResourceContext as P7}from"@frontmcp/sdk";var Mp=class extends P7{static{s(this,"Ty")}static{o(this,"ValtioSubscribersResource")}async execute(){return this.get(Z).read("valtio://subscribers")}};Mp=F([T7({name:"valtio-subscribers",uri:"valtio://subscribers",mimeType:"application/json",description:"Per-(storeId, path) list of component instance ids currently subscribed via tracked useSnapshot."})],Mp);var U7=Mp,vE=class{static{s(this,"jy")}static{o(this,"ValtioApp")}};vE=F([F7({id:"valtio",name:"Valtio",description:"Valtio store + subscription tracking. Phase 5 ships updates/stores/subscribers; per-path subscriber walks land via graph.explain_rerender.",resources:[N7,R7,U7]})],vE);var Ks="valtio://updates/recent",Hs="valtio://stores",oi="valtio://subscribers",yE=100,EE=1e3,q7=1e3,Z7=256,L7=256;function bE(e,t){if(e.size<=t)return;let r=e.values();for(;e.size>t;){let i=r.next();if(i.done)break;e.delete(i.value)}}s(bE,"iN"),o(bE,"capSet");function Op(e){let t=Array.isArray(e.paths)?e.paths.filter(r=>typeof r=="string"):void 0;return t&&t.length>0?t.slice(0,Z7):typeof e.path=="string"?[e.path]:[]}s(Op,"ak"),o(Op,"subscriptionPaths");function Rp(e){return e.componentLogicalId??e.componentInstanceId??"react:component:anonymous"}s(Rp,"ck"),o(Rp,"subscriberId");function wE(e){let t={updates:[],stores:new Map,subscribers:new Map,latestUpdateByPath:new Map},r=o(u=>{if(u.source!=="valtio")return;let n=u.raw??null;if(n?.kind)switch(n.kind){case"state-update":{let a=n.update;if(!a)return;let l={...a,emittedAt:u.timestamp};t.updates.push(l),t.updates.length>yE&&t.updates.splice(0,t.updates.length-yE);let d=`${a.storeId}::${a.path}`;if(t.latestUpdateByPath.delete(d),t.latestUpdateByPath.set(d,l),t.latestUpdateByPath.size>EE){for(let c of t.latestUpdateByPath.keys())if(t.latestUpdateByPath.delete(c),t.latestUpdateByPath.size<=EE)break}e.resources.markDirty(Ks);return}case"store-created":{let a=n.store;if(!a)return;t.stores.set(a.storeId,{...a,createdAt:u.timestamp}),e.resources.markDirty(Hs);return}case"subscription-added":{let a=n.subscription;if(!a||!a.componentInstanceId)return;let l=Rp(a);for(let d of Op(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);p||(p=new Map,t.subscribers.set(c,p));let m=p.get(l);m||(m=new Set,p.set(l,m)),m.add(a.componentInstanceId),qt(p,qr),bE(m,L7)}qt(t.subscribers,q7),e.resources.markDirty(oi);return}case"subscription-removed":{let a=n.subscription;if(!a||!a.componentInstanceId)return;let l=Rp(a);for(let d of Op(a)){let c=`${a.storeId}::${d}`,p=t.subscribers.get(c);if(!p)continue;let m=p.get(l);m&&(m.delete(a.componentInstanceId),m.size===0&&p.delete(l)),p.size===0&&t.subscribers.delete(c)}e.resources.markDirty(oi);return}default:return}},"handler"),i=e.bus.subscribe(r);return e.resources.register(Ks,()=>({schemaVersion:1,revision:e.resources.revision(Ks)??0,updatedAt:new Date().toISOString(),updates:t.updates.slice()})),e.resources.register(Hs,()=>({schemaVersion:1,revision:e.resources.revision(Hs)??0,updatedAt:new Date().toISOString(),stores:[...t.stores.values()]})),e.resources.register(oi,()=>({schemaVersion:1,revision:e.resources.revision(oi)??0,updatedAt:new Date().toISOString(),subscriptions:[...t.subscribers.entries()].map(([u,n])=>{let[a,l]=u.split("::");return{storeId:a,path:l,componentInstanceIds:[...n.keys()]}})})),{unsubscribe:i,uris:[Ks,Hs,oi],lookups:{latestUpdateForPath(u,n){return t.latestUpdateByPath.get(`${u}::${n}`)},subscribersFor(u,n){return[...t.subscribers.get(`${u}::${n}`)?.keys()??[]]}}}}s(wE,"zy"),o(wE,"installValtioReducer");import{App as V7}from"@frontmcp/sdk";import{Resource as J7,ResourceContext as W7}from"@frontmcp/sdk";var Tp=class extends W7{static{s(this,"Oy")}static{o(this,"GraphPatternsResource")}async execute(){return this.get(Z).read("graph://patterns")}};Tp=F([J7({name:"graph-patterns",uri:"graph://patterns",mimeType:"application/json",description:"Recent detected anti-patterns (db-in-loop, n+1-query, render-storm)."})],Tp);var G7=Tp;import{Resource as K7,ResourceContext as H7}from"@frontmcp/sdk";var Pp=class extends H7{static{s(this,"Ny")}static{o(this,"GraphEventLoopLagResource")}async execute(){return this.get(Z).read("graph://performance/event-loop-lag")}};Pp=F([K7({name:"graph-event-loop-lag",uri:"graph://performance/event-loop-lag",mimeType:"application/json",description:"Recent event-loop-lag samples + the max lag seen."})],Pp);var X7=Pp;import{Tool as Y7,ToolContext as Q7,z as eA}from"@frontmcp/sdk";var DE;function Up(e){DE=e}s(Up,"Xa"),o(Up,"setActiveGraphBuffer");function li(){return DE?.events??[]}s(li,"Gt"),o(li,"currentEvents");function Wt(){let e=new t4;return _3(e,li()),e}s(Wt,"Ve"),o(Wt,"buildGraph");var qp=class extends Q7{static{s(this,"Dy")}static{o(this,"GraphGetNodeTool")}async execute(e){let t=Wt().getNode(e.nodeId);return t?{found:!0,node:t}:{found:!1,nodeId:e.nodeId}}};qp=F([Y7({name:"graph.get_node",description:"Returns a single graph node by id (built from the current event window).",inputSchema:{nodeId:eA.string().describe("Node id (usually the originating event id).")}})],qp);var tA=qp;import{Tool as uA,ToolContext as rA,z as Su}from"@frontmcp/sdk";var iA=["ownership","caused","async","data","render","state","network","backend","db","visual","performance","memory","lifecycle"],Zp=class extends rA{static{s(this,"Uy")}static{o(this,"GraphTraverseTool")}async execute(e){let t=Wt().traverse({from:e.from,lens:e.lens,depth:e.depth,direction:e.direction,maxNodes:e.maxNodes});return{nodeCount:t.nodes.length,edgeCount:t.edges.length,nodes:t.nodes.map(r=>({id:r.id,type:r.type,name:r.name,durationMs:r.durationMs,flowId:r.context.flowId})),edges:t.edges.map(r=>({from:r.from,to:r.to,axis:r.axis,type:r.type}))}}};Zp=F([uA({name:"graph.traverse",description:'Walk the multi-axis trace graph from a node along one or more edge axes (the "lens"). Bounded by depth + node count.',inputSchema:{from:Su.string().describe("Start node id."),lens:Su.array(Su.enum(iA)).min(1).describe('Edge axes to follow (e.g. ["caused","backend"]).'),depth:Su.number().int().positive().max(12).default(4),direction:Su.enum(["out","in","both"]).default("both"),maxNodes:Su.number().int().positive().max(1e3).default(200)}})],Zp);var nA=Zp;import{Tool as sA,ToolContext as aA,z as oA}from"@frontmcp/sdk";var Lp=class extends aA{static{s(this,"Fy")}static{o(this,"GraphFindDbInLoopTool")}async execute(e){let t=xd(li(),{threshold:e.threshold});return{count:t.length,matches:t}}};Lp=F([sA({name:"graph.find_db_in_loop",description:"Scan the current event window for loops that issued more than `threshold` DB calls (N+1-ish backend anti-pattern).",inputSchema:{threshold:oA.number().int().positive().default(5)}})],Lp);var lA=Lp;import{Tool as dA,ToolContext as cA,z as pA}from"@frontmcp/sdk";var Vp=class extends cA{static{s(this,"Zy")}static{o(this,"GraphFindSlowPathTool")}async execute(e){let t=Wt(),r=new Map,i=li(),u=e.from?[e.from]:i.filter(l=>l.context.originNodeId===void 0&&l.context.flowId).map(l=>l.id);for(let l of i){let d=t.traverse({from:l.id,lens:["caused","async","backend"],depth:1,direction:"out",maxNodes:50});r.set(l.id,d.edges.filter(c=>c.from===l.id).map(c=>c.to))}let n=o(l=>t.getNode(l)?.durationMs??0,"durationOf"),a=k3(u.length?u:i.map(l=>l.id),r,n);return{totalDurationMs:a.totalDurationMs,path:a.path.map(l=>{let d=t.getNode(l);return{id:l,name:d?.name,type:d?.type,durationMs:d?.durationMs}})}}};Vp=F([dA({name:"graph.find_slow_path",description:"Find the slowest cumulative chain on the caused/async/backend axes starting from a node (or every flow origin if `from` is omitted).",inputSchema:{from:pA.string().optional().describe("Start node id; defaults to all flow origins.")}})],Vp);var mA=Vp;import{Tool as fA,ToolContext as hA,z as $E}from"@frontmcp/sdk";var Jp=class extends hA{static{s(this,"Vy")}static{o(this,"GraphTraceFromOriginTool")}async execute(e){let t=Wt(),r=e.originNodeId;if(!t.getNode(r)){let n=li().find(a=>a.context.originNodeId===e.originNodeId||a.raw?.origin?.nodeId===e.originNodeId);n&&(r=n.id)}let i=t.getNode(r);if(!i)return{found:!1,originNodeId:e.originNodeId};let u=t.traverse({from:r,lens:["caused","render","state","backend","async"],depth:e.depth,direction:"out",maxNodes:500});return{found:!0,origin:{id:r,name:i.name,type:i.type},nodeCount:u.nodes.length,nodes:u.nodes.map(n=>({id:n.id,type:n.type,name:n.name,durationMs:n.durationMs}))}}};Jp=F([fA({name:"graph.trace_from_origin",description:'Given an origin node id (e.g. a data-agent-component value or an event id), returns every node reachable on the caused/render/state/backend axes \u2014 "what did this cause?".',inputSchema:{originNodeId:$E.string().describe("Origin node id, logicalId, or originating event id."),depth:$E.number().int().positive().max(12).default(6)}})],Jp);var gA=Jp;import{Tool as vA,ToolContext as yA,z as BE}from"@frontmcp/sdk";var Wp=class extends yA{static{s(this,"Jy")}static{o(this,"GraphFindStateUpdatesCausedByTool")}async execute(e){let t=Wt();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","state"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(i=>i.type==="state-update");return{found:!0,count:r.length,stateUpdates:r.map(i=>({id:i.id,name:i.name,logicalId:i.logicalId}))}}};Wp=F([vA({name:"graph.find_state_updates_caused_by",description:'From an origin node, returns the state-update nodes reachable on the caused/state axes \u2014 "what state changed because of this?".',inputSchema:{from:BE.string().describe("Origin node id."),depth:BE.number().int().positive().max(12).default(6)}})],Wp);var EA=Wp;import{Tool as bA,ToolContext as wA,z as xE}from"@frontmcp/sdk";var Gp=class extends wA{static{s(this,"Ky")}static{o(this,"GraphFindBackendWorkCausedByClickTool")}async execute(e){let t=Wt();if(!t.getNode(e.from))return{found:!1,from:e.from};let r=t.traverse({from:e.from,lens:["caused","backend","async"],depth:e.depth,direction:"out",maxNodes:500}).nodes.filter(i=>i.type==="server-request");return{found:!0,count:r.length,requests:r.map(i=>({id:i.id,name:i.name,durationMs:i.durationMs}))}}};Gp=F([bA({name:"graph.find_backend_work_caused_by_click",description:'From a UI origin node, returns the server-request nodes reachable on the caused/backend/async axes \u2014 "what backend work did this click trigger?".',inputSchema:{from:xE.string().describe("UI origin node id (e.g. the user-action event id)."),depth:xE.number().int().positive().max(12).default(8)}})],Gp);var DA=Gp,CE=class{static{s(this,"Hy")}static{o(this,"GraphApp")}};CE=F([V7({id:"graph",name:"Graph",description:"Multi-axis causal graph: traverse by lens, trace from origin, find slow paths + db-in-loop / n+1 / render-storm patterns.",resources:[G7,X7],tools:[tA,nA,lA,mA,gA,EA,DA]})],CE);var Fu="graph://patterns",ju="graph://performance/event-loop-lag",Kp=2e3,kE=8*1024*1024,$A=100,AE=100;function IE(e){let t=Ye(e.thresholds),r=(e.now??(()=>Date.now()))(),i={events:[]},u=[],n=0,a=0,l=0,d=new Set,c=[],p=new Map,m,f=new Map,h=o(C=>{switch(C.kind){case"n+1-query":return`n+1:${String(C.details.signature??"")}`;case"render-storm":return`storm:${String(C.details.componentInstanceId??"")}`;case"db-in-loop":return`dbloop:${C.evidence[0]??""}`;default:return`${C.kind}:${C.evidence.join(",")}`}},"patternKey"),g=o(C=>{p.set(Fu,C),e.resources.markDirty(Fu)},"markPatterns"),b=o((C,M)=>{let y=h(C);if(f.delete(y),f.set(y,C),f.size>$A){let D=f.keys().next().value;D!==void 0&&f.delete(D)}g(M)},"pushPattern"),x=o(C=>{let M=!1;for(let[y,D]of f){if(D.evidence.length===0)continue;let A=D.evidence.filter(j=>d.has(j));if(A.length===0){f.delete(y),M=!0;continue}A.length!==D.evidence.length&&(D.evidence=A,M=!0)}M&&g(C)},"dropUnevidencedPatterns"),$=o(C=>{m=C.timestamp;let M=us(C);i.events.push(C),u.push(M),n+=M,d.add(C.id);let y=Math.max(0,i.events.length-Kp),D=n;for(let N=0;N<y;N+=1)D-=u[N]??0;let A=0;for(;D>kE&&y<u.length;)D-=u[y]??0,y+=1,A+=1;if(y>0){let N=i.events.splice(0,y);u.splice(0,y),n=Math.max(0,D),a+=N.length,l+=A;for(let K of N)d.delete(K.id);x(C.timestamp)}let j=C.raw??null;if(j?.kind==="loop")for(let N of xd(i.events,{threshold:t.dbInLoop}))b(N,C.timestamp);if(j?.kind==="db-query")for(let N of x3(i.events,{threshold:t.nPlusOne}))b(N,C.timestamp);if(C.source==="react"&&j?.kind==="render")for(let N of C3(i.events,{threshold:t.renderStorm}))b(N,C.timestamp);C.source==="perf"&&j?.kind==="event-loop-lag"&&typeof j.lagMs=="number"&&(c.push({at:C.timestamp,lagMs:j.lagMs,source:C.source}),c.length>AE&&c.splice(0,c.length-AE),p.set(ju,C.timestamp),e.resources.markDirty(ju))},"handler"),w=e.bus.subscribe($);Up(i);let k=o(C=>new Date(p.get(C)??r).toISOString(),"stamp");return e.resources.register(Fu,()=>({schemaVersion:1,revision:e.resources.revision(Fu)??0,updatedAt:k(Fu),patterns:[...f.values()],eventsBuffered:i.events.length,eventBufferCapacity:Kp,lastEventAt:m,producer:m===void 0?"none":"connected"})),e.resources.register(ju,()=>({schemaVersion:1,revision:e.resources.revision(ju)??0,updatedAt:k(ju),samples:c.slice(),maxLagMs:c.reduce((C,M)=>Math.max(C,M.lagMs),0),lastEventAt:m})),{unsubscribe:o(()=>{Up(void 0),w()},"unsubscribe"),uris:[Fu,ju],retentionStats:o(()=>({residentEvents:i.events.length,residentBytes:n,evictedEvents:a,evictedForBytes:l,eventCap:Kp,byteCap:kE}),"retentionStats")}}s(IE,"Qy"),o(IE,"installGraphReducer");import{App as BA}from"@frontmcp/sdk";import{Resource as xA,ResourceContext as CA}from"@frontmcp/sdk";var Hp=class extends CA{static{s(this,"eb")}static{o(this,"MemoryCurrentResource")}async execute(){return this.get(Z).read("memory://current")}};Hp=F([xA({name:"memory-current",uri:"memory://current",mimeType:"application/json",description:"Last process-memory sample (heapUsed / rss)."})],Hp);var kA=Hp;import{Resource as AA,ResourceContext as IA}from"@frontmcp/sdk";var Xp=class extends IA{static{s(this,"rb")}static{o(this,"MemoryOwnersResource")}async execute(){return this.get(Z).read("memory://owners")}};Xp=F([AA({name:"memory-owners",uri:"memory://owners",mimeType:"application/json",description:"All tracked container owners with current item count + byte estimate."})],Xp);var _A=Xp;import{Resource as SA,ResourceContext as FA}from"@frontmcp/sdk";var Yp=class extends FA{static{s(this,"ob")}static{o(this,"MemoryOwnersGrowingResource")}async execute(){return this.get(Z).read("memory://owners/growing")}};Yp=F([SA({name:"memory-owners-growing",uri:"memory://owners/growing",mimeType:"application/json",description:"Top 20 container owners by growth-since-start."})],Yp);var jA=Yp;import{Resource as zA,ResourceContext as NA}from"@frontmcp/sdk";var Qp=class extends NA{static{s(this,"sb")}static{o(this,"MemoryLeaksSuspectedResource")}async execute(){return this.get(Z).read("memory://leaks/suspected")}};Qp=F([zA({name:"memory-leaks-suspected",uri:"memory://leaks/suspected",mimeType:"application/json",description:"Suspected leaks: per-flow retentions + stale-generation singletons."})],Qp);var MA=Qp;import{Resource as OA,ResourceContext as RA}from"@frontmcp/sdk";var em=class extends RA{static{s(this,"cb")}static{o(this,"MemoryPodsResource")}async execute(){return this.get(Z).read("memory://pods")}};em=F([OA({name:"memory-pods",uri:"memory://pods",mimeType:"application/json",description:"Each dev-cluster pod's heap after a full GC (boot, after every hot swap, after bursts), a short per-service history, and closed generations proven still in memory."})],em);var TA=em;import{Tool as PA,ToolContext as UA,z as qA}from"@frontmcp/sdk";var _E;function tm(e){_E=e}s(tm,"Ha"),o(tm,"setActiveMemoryLookups");function zu(){return _E}s(zu,"nt"),o(zu,"activeMemoryLookups");var um=class extends UA{static{s(this,"lb")}static{o(this,"MemoryFindGrowthByFlowTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.growthByFlow(e.flowId);return{found:!0,flowId:e.flowId,owners:r}}};um=F([PA({name:"memory.find_growth_by_flow",description:'Returns the container owners mutated during a flow and how much each grew \u2014 "what did this flow allocate?".',inputSchema:{flowId:qA.string().describe("Flow id.")}})],um);var ZA=um;import{Tool as LA,ToolContext as VA,z as JA}from"@frontmcp/sdk";var rm=class extends VA{static{s(this,"pb")}static{o(this,"MemoryFindFlowsThatMutatedOwnerTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.flowsThatMutatedOwner(e.ownerId);return{found:!0,ownerId:e.ownerId,flowIds:r}}};rm=F([LA({name:"memory.find_flows_that_mutated_owner",description:"Returns the flow ids that mutated a given container owner.",inputSchema:{ownerId:JA.string().describe("Owner id (<ownerInstanceId>::<fieldName>).")}})],rm);var WA=rm;import{Tool as GA,ToolContext as KA,z as HA}from"@frontmcp/sdk";var im=class extends KA{static{s(this,"mb")}static{o(this,"MemoryExplainLeakTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.getLeak(e.leakIndex);if(!r)return{found:!1,leakIndex:e.leakIndex};let i,u;if(r.kind==="retention"){let n=r.detail;i=`Owner ${n.ownerId} grew by ${n.growth} items during flow ${n.flowId} and did not shrink after the flow settled.`,u="Add a TTL / max-size eviction policy to this container, or clear it when the owning scope is disposed. If it is a request-scoped cache, move it off the singleton."}else{let n=r.detail;i=`${r.service??r.project} pod #${r.pod} (pid ${r.pid}): hot-swap generation ${n.gen} is still in memory ${Math.round(n.ageMs/1e3)}s after its app was closed, through ${n.gcs} full GCs and ${n.swapsSinceClose} swap(s) \u2014 still alive: ${(n.alive??[]).join(", ")}. Not garbage: something still points into it.`,u=`Run \`lensmcp mem ${r.service??r.project} --snapshot --analyze\` for the shortest path from the GC roots to it. Usual retainers: a listener on a process-global emitter, a module-level cache or registry, a timer the old app's onModuleDestroy does not clear. memory.explain_pod reads the pod's whole picture.`}return{found:!0,leak:r,narrative:i,recommendation:u}}};im=F([GA({name:"memory.explain_leak",description:"Returns a narrative explanation of a suspected leak (by index in memory://leaks/suspected): which owner and flow grew, or which pod generation outlived its close \u2014 and a remediation hint.",inputSchema:{leakIndex:HA.number().int().nonnegative().describe("Index into memory://leaks/suspected.")}})],im);var XA=im;import{Tool as YA,ToolContext as QA,z as SE}from"@frontmcp/sdk";var FE=6,nm=class extends QA{static{s(this,"gb")}static{o(this,"MemoryPodsTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};if(e.service){let i=t.podsOf(e.service);return i?{found:!0,...i,history:i.history.slice(-(e.history??FE))}:{found:!1,service:e.service,known:t.pods().map(u=>u.service).slice(0,32),reason:"no pod of that service has reported \u2014 pods report at boot and after every hot swap"}}let r=t.pods().slice(0,32).map(i=>({project:i.project,service:i.service,lastSeenAt:i.lastSeenAt,pods:i.pods}));return{found:r.length>0,services:r}}};nm=F([YA({name:"memory.pods",description:"What each dev-cluster pod weighs: heap after a full GC, reserved heap, rss, boot baseline, swaps, and any closed hot-swap generation proven still in memory. Give `service` for that service's recent per-swap history.",inputSchema:{service:SE.string().optional().describe("Nx project or cluster service name. Omit for every service (latest reading per pod, no history)."),history:SE.number().int().min(0).max(12).optional().describe(`Recent readings to include for one service (default ${FE}).`)}})],nm);var eI=nm;import{Tool as tI,ToolContext as uI,z as jE}from"@frontmcp/sdk";var Xs=o(e=>e>=1073741824?`${(e/1073741824).toFixed(1)} GB`:`${Math.round(e/1048576)} MB`,"mb"),zE=o(e=>e<9e4?`${Math.round(e/1e3)}s`:`${Math.round(e/6e4)} min`,"age");function NE(e,t,r=Date.now()){let i=t.latest,u=[];if(!i)return{service:e.service,pod:t.pod,pid:t.pid,narrative:`${e.service} pod #${t.pod} (pid ${t.pid}) has not reported a reading yet.`,findings:u,recommendation:"It reports at boot and after every swap \u2014 check `lensmcp mem` once it has booted."};let n=i.baseline??(i.trigger==="boot"?i.live:void 0),a=n?i.live/n:void 0,l=`${e.service} pod #${t.pod} (pid ${t.pid}): ${Xs(i.live)} live after a full GC (${i.trigger}, ${zE(r-i.at)} ago), generation ${i.gen} after ${i.swaps} swap${i.swaps===1?"":"s"}`;n&&a!==void 0&&(l+=` \u2014 ${a.toFixed(1)}\xD7 the ${Xs(n)} it booted with`),l+=".",a!==void 0&&a>=2.5?u.push(`At ${a.toFixed(1)}\xD7 its boot heap it is near the recycle bound (3\xD7 by default): the pod will be replaced by a fresh process if it grows further.`):a!==void 0&&a>=1.4&&u.push(`More than one generation's worth of live heap (${a.toFixed(1)}\xD7): a generation still draining or pinned, or state the app accumulated since boot.`),i.used-i.live>=64*1048576&&u.push(`That collection gave back ${Xs(i.used-i.live)} of garbage \u2014 what an idle pod kept before it collected on its own.`),i.reserved-i.live>=128*1048576&&u.push(`V8 holds ${Xs(i.reserved-i.live)} reserved beyond the live heap; that is the allocator's slack, which a later GC shrinks \u2014 not a leak.`),i.previousAlive===!0?u.push(`Generation ${i.previousGen} \u2014 the one the last swap replaced \u2014 was still in memory at this reading.`):i.previousAlive===!1&&u.push(`Generation ${i.previousGen} \u2014 the one the last swap replaced \u2014 has been collected.`),i.containers!==void 0&&i.containers>1&&u.push(`${i.containers} Nest DI containers are alive: more than one app's worth.`);for(let c of t.retained){let p=c.counts&&Object.keys(c.counts).length?` Live then: ${Object.entries(c.counts).map(([m,f])=>`${m} ${f}`).join(", ")}.`:"";u.push(`RETAINED: generation ${c.gen} is still in memory ${zE(r-c.closedAt)} after its app was closed, through ${c.gcs} full GCs and ${c.swapsSinceClose} swap${c.swapsSinceClose===1?"":"s"} (still alive: ${c.alive.join(", ")}).${p}`)}i.sourceMaps&&u.push("The pod runs with source maps enabled: with an eval devtool the bundle is held as text several times (`lensmcp doctor` checks it).");let d=t.retained.length?`Something still points into the retained generation. \`lensmcp mem ${e.service} --snapshot --analyze\` prints the shortest path from the GC roots to it \u2014 usually a listener on a process-global emitter, a module-level cache or registry, or a timer an onModuleDestroy does not clear. Until it is fixed the pod is replaced once the generation has been retained for LENSMCP_SWAP_RECYCLE_RETAINED_MS (10 min by default).`:a!==void 0&&a>=2?`No closed generation is retained, so this is growth inside the serving app. Compare readings across swaps with \`lensmcp mem ${e.service}\`; \`lensmcp mem ${e.service} --snapshot --analyze\` lists the largest retainers by class and by package.`:"Nothing to act on: one generation in memory, and the previous one collected.";return{service:e.service,pod:t.pod,pid:t.pid,narrative:l,findings:u,recommendation:d}}s(NE,"yb"),o(NE,"explainPod");var sm=class extends uI{static{s(this,"bb")}static{o(this,"MemoryExplainPodTool")}async execute(e){let t=zu();if(!t)return{found:!1,reason:"no active memory reducer"};let r=t.podsOf(e.service);if(!r)return{found:!1,service:e.service,reason:"no pod of that service has reported"};let i=r.pods.filter(u=>e.pod===void 0||u.pod===e.pod).slice(0,8);return i.length===0?{found:!1,service:e.service,pods:r.pods.map(u=>u.pod),reason:`no pod #${e.pod}`}:{found:!0,explanations:i.map(u=>NE(r,u))}}};sm=F([tI({name:"memory.explain_pod",description:"Explains one dev-cluster pod's memory in a few sentences: how many app generations its live heap is, whether the last hot swap's copy was collected, reserved-heap slack, and any closed generation proven still in memory \u2014 with the next step (e.g. a heap snapshot).",inputSchema:{service:jE.string().describe("Nx project or cluster service name."),pod:jE.number().int().positive().optional().describe("Pod id (the N of Child#N). Omit for every pod of the service (at most 8).")}})],sm);var rI=sm,ME=class{static{s(this,"xb")}static{o(this,"MemoryApp")}};ME=F([BA({id:"memory",name:"Memory",description:"Container-owner growth tracking, suspect-leak detection, and dev-cluster pod heaps (post-GC readings, retained hot-swap generations). Hosts memory.explain_leak, memory.pods, memory.explain_pod.",resources:[kA,_A,jA,MA,TA],tools:[ZA,WA,XA,eI,rI]})],ME);var iI=64,nI=16,OE=12,sI=16,RE=24*36e5;function Gt(e,t,r,i){return`pod-retained:${e}:${t}:${r}:${i}`}s(Gt,"gn"),o(Gt,"retainedLeakKey");var aI=o((e,t)=>`${e}:${t}`,"podKey");function am(e,t){let r={};for(let[i,u]of Object.entries(e))t.includes(i)||(r[i]=u);return r}s(am,"$k"),o(am,"stripIdentity");var oI=class{static{s(this,"Qa")}static{o(this,"PodMemoryState")}constructor(){this.services=new Map}apply(e){if(e.source!=="memory")return;let t=Gn(e.raw);if(!t)return;let r=e.timestamp;this.lastEventAt=Math.max(this.lastEventAt??0,r);let i={pods:!0,retainedAdded:[],retainedRemoved:[]},u=this.service(t.project,t.service||t.project,r),n=aI(t.pod,t.pid);if(t.kind==="pod-memory-exited"){let l=u.pods.get(n);if(l)for(let d of l.retained.keys())i.retainedRemoved.push(Gt(t.project,t.pod,t.pid,d));return u.pods.delete(n),i}let a=u.pods.get(n);if(!a){if(t.kind==="pod-memory"&&t.trigger==="boot"){for(let[l,d]of u.pods)if(d.pod===t.pod){for(let c of d.retained.keys())i.retainedRemoved.push(Gt(t.project,d.pod,d.pid,c));u.pods.delete(l)}}if(a={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,lastSeenAt:r,retained:new Map},u.pods.set(n,a),u.pods.size>nI){let l=[...u.pods.entries()].sort((d,c)=>d[1].lastSeenAt-c[1].lastSeenAt)[0];if(l){for(let d of l[1].retained.keys())i.retainedRemoved.push(Gt(t.project,l[1].pod,l[1].pid,d));u.pods.delete(l[0])}}}if(a.lastSeenAt=r,t.kind==="pod-memory")a.latest=am(t,["project","service","pod","pid","podGeneration","floodSuppressed"]),u.history.push({at:t.at??r,pod:t.pod,pid:t.pid,trigger:t.trigger,gen:t.gen,swaps:t.swaps,live:t.live,used:t.used,reserved:t.reserved,rss:t.rss,...t.previousGen!==void 0?{previousGen:t.previousGen}:{},previousAlive:t.previousAlive??null,retained:t.retained??0}),u.history.length>OE&&u.history.splice(0,u.history.length-OE);else if(t.kind==="pod-memory-retained"){let l={...am(t,["project","service","floodSuppressed"]),at:r};a.retained.delete(t.gen),a.retained.set(t.gen,l),a.retained.size>sI&&a.retained.delete(a.retained.keys().next().value),i.retainedAdded.push({key:Gt(t.project,t.pod,t.pid,t.gen),project:t.project,service:u.service,pod:t.pod,pid:t.pid,generation:l})}else t.kind==="pod-memory-released"&&(a.retained.delete(t.gen),i.retainedRemoved.push(Gt(t.project,t.pod,t.pid,t.gen)));return this.sweep(r,i,t.project),i}views(){return[...this.services.values()].sort((e,t)=>e.project.localeCompare(t.project)).map(e=>this.view(e))}find(e){let t=this.services.get(e)??[...this.services.values()].find(r=>r.service===e);return t?this.view(t):void 0}view(e){return{project:e.project,service:e.service,lastSeenAt:e.lastSeenAt,pods:[...e.pods.values()].sort((t,r)=>t.pod-r.pod).map(t=>({pod:t.pod,pid:t.pid,podGeneration:t.podGeneration,lastSeenAt:t.lastSeenAt,...t.latest?{latest:t.latest}:{},retained:[...t.retained.values()]})),history:[...e.history]}}service(e,t,r){let i=this.services.get(e);if(!i&&(i={project:e,service:t,lastSeenAt:r,pods:new Map,history:[]},this.services.set(e,i),this.services.size>iI)){let u=[...this.services.values()].sort((n,a)=>n.lastSeenAt-a.lastSeenAt)[0];u&&u!==i&&this.services.delete(u.project)}return i.lastSeenAt=Math.max(i.lastSeenAt,r),i.service=t,i}sweep(e,t,r){for(let i of this.services.values()){for(let[u,n]of i.pods)if(!(e-n.lastSeenAt<=RE)){for(let a of n.retained.keys())t.retainedRemoved.push(Gt(i.project,n.pod,n.pid,a));i.pods.delete(u)}i.pods.size===0&&i.project!==r&&e-i.lastSeenAt>RE&&this.services.delete(i.project)}}},di="memory://current",ci="memory://owners",pi="memory://owners/growing",Kt="memory://leaks/suspected",mi="memory://pods",lI=200,TE=50,dI=500;function PE(e){let t=(e.now??(()=>Date.now()))(),r={owners:new Map,leaks:new Map,changedAt:new Map},i=new oI,u=o(($,w)=>{r.changedAt.set($,w),e.resources.markDirty($)},"touch"),n=o(($,w)=>{if(r.leaks.delete($),r.leaks.set($,w),r.leaks.size>lI){let k=r.leaks.keys().next().value;k!==void 0&&r.leaks.delete(k)}},"pushLeak"),a=new Map,l=o(($,w)=>{$!==w&&(a.delete($),a.set($,w),a.size>5e3&&a.delete(a.keys().next().value))},"noteRequestFlow"),d=o(($,w)=>{if($.flowIds.add(w),$.flowIds.size>TE){for(let k of $.flowIds)if($.flowIds.delete(k),$.flowIds.size<=TE)break}},"noteFlow"),c=o(($,w,k)=>{let C=r.owners.get($);if(C||(C={ownerId:$,itemCount:w,estimatedBytes:0,startCount:w,mutations:0,flowIds:new Set,lastMutatedAt:k}),r.owners.delete($),r.owners.set($,C),r.owners.size>dI){let M=r.owners.keys().next().value;M!==void 0&&M!==$&&r.owners.delete(M)}return C},"ensure"),p=o(($,w)=>{let k=!1;for(let[C,M]of r.leaks){if(M.kind!=="retention"||M.ownerId!==$)continue;let y=M.detail.startCount;typeof y=="number"&&w<=y&&(r.leaks.delete(C),k=!0)}return k},"retractReleasedRetentions"),m=o($=>{let w=i.apply($);if(!w)return!1;r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),u(mi,$.timestamp);let k=!1;for(let C of w.retainedRemoved)k=r.leaks.delete(C)||k;for(let C of w.retainedAdded)n(C.key,{kind:"retained-generation",project:C.project,service:C.service,pod:C.pod,pid:C.pid,generation:C.generation.gen,detail:{...C.generation},at:$.timestamp}),k=!0;return k&&u(Kt,$.timestamp),!0},"applyPodMemory"),f=o($=>{if($.source!=="memory"&&$.source!=="perf"||m($))return;let w=$.raw??null;if(w?.kind)switch(r.lastEventAt=Math.max(r.lastEventAt??0,$.timestamp),w.kind){case"memory-mutation":{if(!w.mutation)return;let k=w.mutation,C=c(k.ownerNodeId,k.beforeCount??k.afterCount,$.timestamp);C.itemCount=k.afterCount,C.estimatedBytes=k.afterCount*64,C.mutations+=1,C.lastMutatedAt=$.timestamp,$.context.flowId&&d(C,$.context.flowId),$.context.requestId&&$.context.flowId&&l($.context.requestId,$.context.flowId),u(ci,$.timestamp),u(pi,$.timestamp),p(k.ownerNodeId,k.afterCount)&&u(Kt,$.timestamp);return}case"memory-retention":{if(!w.retention)return;let k=w.retention,C=k.requestId?k.flowId:a.get(k.flowId)??k.flowId;n(`retention:${k.ownerId}:${C}`,{kind:"retention",ownerId:k.ownerId,flowId:C,detail:{...k,flowId:C},at:$.timestamp}),u(Kt,$.timestamp);return}case"process-memory":{if(!w.memory)return;r.current={...w.role?{role:w.role}:{},heapUsed:w.memory.heapUsed,heapTotal:w.memory.heapTotal,rss:w.memory.rss,external:w.memory.external,arrayBuffers:w.memory.arrayBuffers,at:$.timestamp},u(di,$.timestamp);return}default:return}},"handler"),h=e.bus.subscribe(f),g=o($=>new Date(r.changedAt.get($)??t).toISOString(),"stamp"),b=o(()=>({lastEventAt:r.lastEventAt,ownersTracked:r.owners.size,producer:r.lastEventAt===void 0?"none":"connected",detail:r.lastEventAt===void 0?"No memory event has ever been observed \u2014 an empty leak list is NOT evidence there is no leak, nothing is watching. Run under the dev cluster with @lensmcp/memory-tracker wired.":`${r.owners.size} owner${r.owners.size===1?"":"s"} tracked; ${r.leaks.size} suspected leak${r.leaks.size===1?"":"s"}.`}),"health");e.resources.register(di,()=>({schemaVersion:1,revision:e.resources.revision(di)??0,updatedAt:g(di),current:r.current??null})),e.resources.register(ci,()=>({schemaVersion:1,revision:e.resources.revision(ci)??0,updatedAt:g(ci),owners:[...r.owners.values()].map(om),...b()})),e.resources.register(pi,()=>({schemaVersion:1,revision:e.resources.revision(pi)??0,updatedAt:g(pi),owners:[...r.owners.values()].map(om).filter($=>$.growthSinceStart>0).sort(($,w)=>w.growthSinceStart-$.growthSinceStart).slice(0,20),...b()})),e.resources.register(Kt,()=>({schemaVersion:1,revision:e.resources.revision(Kt)??0,updatedAt:g(Kt),suspected:[...r.leaks.values()],...b()})),e.resources.register(mi,()=>({schemaVersion:1,revision:e.resources.revision(mi)??0,updatedAt:g(mi),services:i.views(),lastEventAt:i.lastEventAt,producer:i.lastEventAt===void 0?"none":"connected",detail:i.lastEventAt===void 0?"No pod has reported its heap \u2014 these readings come from the dev cluster (`@lensmcp/cluster` devserver pods, which report at boot and after every hot swap). An empty list is not evidence the pods are small.":"Bytes. `live` is the heap after a full GC; `used` the heap just before it; `reserved` what V8 keeps. A `retained` generation was closed and is PROVEN still in memory \u2014 see memory.explain_pod."}));let x={ownersMutatedByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($))},growthByFlow($){return[...r.owners.values()].filter(w=>w.flowIds.has($)).map(w=>({ownerId:w.ownerId,growth:w.itemCount-w.startCount}))},flowsThatMutatedOwner($){let w=r.owners.get($);return w?[...w.flowIds]:[]},getLeak($){return[...r.leaks.values()][$]},allLeaks(){return[...r.leaks.values()]},pods(){return i.views()},podsOf($){return i.find($)}};return tm(x),{unsubscribe:o(()=>{tm(void 0),h()},"unsubscribe"),uris:[di,ci,pi,Kt,mi],lookups:x}}s(PE,"$b"),o(PE,"installMemoryReducer");function om(e){return{ownerId:e.ownerId,itemCount:e.itemCount,estimatedBytes:e.estimatedBytes,mutations:e.mutations,startCount:e.startCount,growthSinceStart:e.itemCount-e.startCount,lastMutatedAt:e.lastMutatedAt,flowIds:[...e.flowIds]}}s(om,"kk"),o(om,"toOwnerView");function UE(){let{session:e,providers:t}=z3(),r=q3(),i=Z3();for(let x of i.problems)console.error(`[lensmcp] nx.json lensmcp.flows: ${x}`);ly({bus:e.bus,resources:e.resources}),py({bus:e.bus,resources:e.resources}),hy({bus:e.bus,resources:e.resources}),yy({bus:e.bus,resources:e.resources}),$y({bus:e.bus,resources:e.resources}),_y({bus:e.bus,resources:e.resources}),Fy({bus:e.bus,resources:e.resources}),zy({bus:e.bus,resources:e.resources}),Oy({bus:e.bus,resources:e.resources,thresholds:r}),Ly({bus:e.bus,resources:e.resources,thresholds:r}),Gy({bus:e.bus,resources:e.resources,thresholds:r}),tE({bus:e.bus,resources:e.resources,thresholds:r}),pE({bus:e.bus,resources:e.resources}),gE({bus:e.bus,resources:e.resources,thresholds:r}),wE({bus:e.bus,resources:e.resources});let u=uc({bus:e.bus,resources:e.resources,flows:i});e.registerReducerRetention("flow",u.retentionStats),ey({resources:e.resources});let n=IE({bus:e.bus,resources:e.resources,thresholds:r});e.registerReducerRetention("graph",n.retentionStats),PE({bus:e.bus,resources:e.resources}),k6({bus:e.bus,resources:e.resources,sessionId:e.id});let a=3e4,l=512*1024*1024,d=0,c=o(()=>{let x=process.memoryUsage(),$=Date.now(),w=x.rss>=l;w&&$-d>=5*6e4&&(d=$,console.warn(`[lensmcp] high process memory: rss=${Math.round(x.rss/1024/1024)}MB heap=${Math.round(x.heapUsed/1024/1024)}MB`)),e.bus.publish({id:lt(),sessionId:e.id,timestamp:$,source:"perf",category:"runtime",severity:w?"warning":"info",context:{sessionId:e.id},fingerprint:r4({kind:"process-memory",identity:process.env.LENSMCP_PROCESS_ROLE??"session"}),title:`LensMCP process memory (${process.env.LENSMCP_PROCESS_ROLE??"session"})`,raw:{kind:"process-memory",role:process.env.LENSMCP_PROCESS_ROLE??"session",memory:{rss:x.rss,heapUsed:x.heapUsed,heapTotal:x.heapTotal,external:x.external,arrayBuffers:x.arrayBuffers}}})},"publishProcessMemory");c();let p=setInterval(c,a);p.unref?.(),e.onShutdown({name:"process-memory",stop:o(()=>clearInterval(p),"stop")});let m=1200,f=new Map,h=e.bus.subscribe(x=>{let $=x.context.flowId;if(!$)return;let w=f.get($);w&&clearTimeout(w);let k=setTimeout(()=>{f.delete($);try{let C=Qe()?.getFlowEvents($);if(!C||C.length===0)return;let M=la(C,{flowId:$});M&&Dc(M)}catch{}},m);k.unref?.(),f.set($,k)});e.onShutdown({name:"story-autocompile",stop:o(()=>{h();for(let x of f.values())clearTimeout(x);f.clear()},"stop")});let g=P3({bus:e.bus,sessionId:e.id,onError:o(x=>console.error("[lensmcp] ingest error:",x),"onError")});g.mode!=="none"&&console.error(`[lensmcp] event ingest active (mode=${g.mode})`),e.onShutdown({name:"event-ingest",stop:o(()=>g.stop(),"stop")});let b=process.env.LENSMCP_EVENT_FILE;return b&&(Yd({eventFile:b,flows:i,budget:S6(),prepare:qE(e.id)}),e.onShutdown({name:"flow-recovery",stop:o(()=>Yd(void 0),"stop")})),{session:e,providers:t,ingest:g,flows:i}}s(UE,"Sk"),o(UE,"createLensSession");function qE(e){let t=Cd({}),r=oa({});return i=>(i.sessionId==="pending"&&(i.sessionId=e,i.context&&i.context.sessionId==="pending"&&(i.context.sessionId=e)),r.redact(t.clamp(i)))}s(qE,"sP"),o(qE,"ingestPreparation");var cI=new Set(["localhost","127.0.0.1","lensmcp.local"]);function ZE(e){if(!e)return!1;let t=e.trim().toLowerCase();if(t.startsWith("[")){let r=t.indexOf("]");return r!==-1&&t.slice(1,r)==="::1"}return t.indexOf(":")===t.lastIndexOf(":")&&(t=t.split(":")[0]??""),cI.has(t)}s(ZE,"cP"),o(ZE,"hostHeaderIsLocal");function LE(e,t){if(!e||ZE(t))return{ok:!0};let r=(t??"").replace(/[^\x20-\x7e]/g,"?").slice(0,80);return{ok:!1,status:403,error:"this dashboard answers only requests addressed to this machine (localhost, 127.0.0.1, [::1] or lensmcp.local)"+(r?`; this one was addressed to "${r}"`:"")}}s(LE,"Ik"),o(LE,"dashboardHostVerdict");import{createHmac as VE,randomBytes as JE,timingSafeEqual as pI}from"node:crypto";import{chmodSync as mI,mkdirSync as fI,readFileSync as hI,writeFileSync as WE}from"node:fs";import{dirname as gI,join as vI}from"node:path";var Ys="__lensmcp_token",lm="__lensmcp_login",GE=10*6e4,yI=720*60*60;function dm(e){return vI(e,".lensmcp","dashboard-token")}s(dm,"_b"),o(dm,"dashboardTokenPath");function KE(e,t,r={}){if(e.LENSMCP_ALLOW_INSECURE==="1")return{source:"disabled"};let i=e.LENSMCP_DASHBOARD_TOKEN?.trim();if(i)return{token:i,source:"env"};let u=r.read??(c=>hI(c,"utf8")),n=r.write??((c,p)=>WE(c,p,{mode:384,flag:"wx"})),a=r.ensureDir??(c=>{fI(c,{recursive:!0,mode:448})}),l=r.chmod??((c,p)=>mI(c,p)),d=dm(t);try{let c=u(d).trim();if(c){try{l(d,384)}catch{}return{token:c,source:"file"}}}catch{}try{a(gI(d));let c=JE(32).toString("hex");try{n(d,`${c}
|
|
72
|
+
`)}catch(p){if(p.code!=="EEXIST")throw p;let m=u(d).trim();if(m)return{token:m,source:"file"};WE(d,`${c}
|
|
73
|
+
`,{mode:384})}try{l(d,384)}catch{}return{token:c,source:"created"}}catch(c){return{source:"unavailable",reason:c instanceof Error?c.message:String(c)}}}s(KE,"jk"),o(KE,"resolveDashboardToken");function fi(e,t){let r=Buffer.from(e,"utf8"),i=Buffer.from(t,"utf8");return r.length!==i.length?!1:pI(r,i)}s(fi,"ec"),o(fi,"sameSecret");function cm(e,t,r,i){if(!e)return!0;let u=Array.isArray(t)?t[0]:t,n=/^Bearer\s+(.+)$/i.exec((u??"").trim())?.[1]?.trim();if(n&&fi(n,e))return!0;let a=r?.trim();if(a&&fi(a,e))return!0;let l=i?XE(i.header,i.name):void 0;return!!l&&fi(l,pm(e))}s(cm,"kb"),o(cm,"dashboardAuthorized");function HE(e){return`lensmcp_dash_${e.replace(/[^A-Za-z0-9_-]/g,"_")}`}s(HE,"zk"),o(HE,"sessionCookieName");function pm(e){return VE("sha256",e).update("lensmcp-dashboard-session-v1").digest("hex")}s(pm,"Sb"),o(pm,"sessionCookieValue");function XE(e,t){for(let r of(e??"").split(";")){let i=r.indexOf("=");if(i>0&&r.slice(0,i).trim()===t)return r.slice(i+1).trim()}}s(XE,"gP"),o(XE,"readCookie");function YE(e,t,r,i){return`${e}=${t}; Path=${r}; HttpOnly; SameSite=Strict; Max-Age=${yI}${i?"; Secure":""}`}s(YE,"Ok"),o(YE,"sessionCookieHeader");function mm(e,t,r){return VE("sha256",e).update(`lensmcp-dashboard-login
|
|
74
74
|
${t}
|
|
75
|
-
${r}`).digest("hex")}s(
|
|
76
|
-
`);return u>0&&l.shift(),l.slice(-r)}s(
|
|
77
|
-
`).map(n=>n.trim()).filter(n=>n&&!n.startsWith("#")).map(n=>n.split(/\s+/)),i=o((n,a)=>r.some(l=>l[0]===n&&l.slice(1).includes(a)),"has"),u=[];for(let n of e)n.host&&!n.host.includes("*")&&(u.push(n.host),n.service&&n.internalHost!==!1&&u.push(typeof n.internalHost=="string"?n.internalHost:`internal.${n.host}`));return[...new Set(u)].map(n=>({host:n,v4:i("127.0.0.1",n),v6:i("::1",n)}))}serviceKeyView(){let e;try{e=JSON.parse(Qs(`${this.opts.root}/${II}`,"utf8"))}catch{return{}}let t={};for(let[r,i]of Object.entries(e))typeof i!="string"||i===""||(t[r]={fingerprint:xI("sha256").update(i).digest("hex").slice(0,12)});return t}liveDecls(){let e=this.discoverDecls();for(let t of e)t.service&&(t.podNames=this.podNames(t.service));return e}legacyView(){let e=this.liveDecls();return{at:Date.now(),gateway:this.gateway,decls:e,hostsSetup:this.hostsSetup(e),trustCommand:this.trustCommand(),serviceKeys:this.serviceKeyView(),services:[...this.services.values()].sort((t,r)=>t.project.localeCompare(r.project)),edges:[...this.edges.values()].sort((t,r)=>r.lastSeenAt-t.lastSeenAt),dataNodes:[...this.dataNodes.values()].sort((t,r)=>r.count-t.count).slice(0,24),recent:this.recent.slice(-20).reverse()}}gatewayLiveness(e=Date.now()){let t=this.opts.env??process.env,r=(t.LENSMCP_GATEWAY_PORTS??"").split(",").map(d=>Number(d.trim())).filter(d=>Number.isInteger(d)&&d>0),i=this.gateway?.ports??[],u=r.length?r:i,n=Number(t.LENSMCP_PARENT_PID??0);if(n>0)return mm(n)?{state:"live",role:"gateway-child",ports:u,since:this.gateway?.at,evidence:`served by the gateway process (pid ${n})`}:{state:"down",role:"gateway-child",ports:u,evidence:`the gateway that started this dashboard (pid ${n}) is gone`};if(i.length>0)return{state:"live",role:"standalone",ports:u,since:this.gateway?.at,evidence:"gateway-up event on this workspace\u2019s bus"};let a=this.registeredGateway(e);if(a)return{state:"live",role:"standalone",ports:u,evidence:`registered with the gateway daemon (pid ${a})`};let l=this.gateway?.aliveAt??0;return l>e-3e4?{state:"live",role:"standalone",ports:u,since:l,evidence:`gateway traffic ${Math.round((e-l)/1e3)}s ago`}:this.gateway?{state:"down",role:"standalone",ports:u,evidence:"no gateway traffic in the last 30s"}:{state:"unknown",role:"standalone",ports:u,evidence:"no gateway events seen \u2014 is this dashboard running without the gateway?"}}registeredGateway(e){if(e-this.registryCache.at<15e3)return this.registryCache.pid;let t;try{let r=`${(this.opts.env??process.env).LENSMCP_HOME||CI()}/.lensmcp/workspaces.json`,i=JSON.parse(Qs(r,"utf8")),u=Array.isArray(i)?i.find(n=>n.root===this.opts.root):void 0;u&&typeof u.pid=="number"&&u.pid>0&&mm(u.pid)&&(!u.procStamp||sb(u.pid)===u.procStamp)&&(t=u.pid)}catch{}return this.registryCache={at:e,...t?{pid:t}:{}},t}view(e){let t=e.now??Date.now(),r=this.liveDecls(),i=this.hostsSetup(r),u=this.serviceKeyView(),n=new Map((e.processCluster?.services??[]).map(h=>[h.project,h])),a=new Map;for(let h of e.processCluster?.errors??[]){if(!h.project||!h.line)continue;let g=a.get(h.project)??[];g.push(h.line),a.set(h.project,g.slice(-6))}let l=[...this.edges.values()].filter(h=>!h.caller),d=r.map(h=>{let g=h.service?h.eager?"eager":"lazy":"web",b=this.services.get(h.project),x=n.get(h.project),$=(e.processCluster?.errors??[]).filter(H=>H.project===h.project&&H.fault!=="types"),w=x?.buildFailed===!0&&$.length>0&&$.every(H=>H.fault==="process"),{state:k,reason:C}=ab(g,b,x,h.podNames.length,w),M=l.filter(H=>H.project===h.project),y=M.reduce((H,ye)=>H+ye.count,0),D=M.reduce((H,ye)=>H+ye.errors,0),A=M.slice().sort((H,ye)=>ye.lastSeenAt-H.lastSeenAt)[0],j=e.kpis?.projectStats(h.project,t),N=h.service&&h.internalHost!==!1&&h.host?typeof h.internalHost=="string"?h.internalHost:`internal.${h.host}`:void 0,K=h.service?this.memoryOf(h.project,h.podNames,t):void 0;return{project:h.project,kind:g,state:k,...C?{stateReason:C}:{},...h.host?{host:h.host}:{},...h.path?{path:h.path}:{},...N?{internalHost:N}:{},...h.port!==void 0?{port:h.port}:{},...h.internalPort!==void 0?{internalPort:h.internalPort}:{},pods:{running:h.podNames.length,names:h.podNames,...h.minPods!==void 0?{min:h.minPods}:{},...h.maxPods!==void 0?{max:h.maxPods}:{}},workers:h.workers??[],...b?.lastColdStartMs!==void 0?{lastColdStartMs:b.lastColdStartMs}:{},restarts:x?.restarts??0,buildFailed:(x?.buildFailed??!1)&&!w,processError:w,typeErrors:x?.typeErrors??!1,errorLines:a.get(h.project)??[],...h.auth?{auth:{...h.auth.default?{default:h.auth.default}:{},overrides:h.auth.overrides?.length??0}}:{},traffic:{count:y,errors:D,avgMs:A?A.avgMs:null,...A?{lastSeenAt:A.lastSeenAt}:{}},...j?{window:j}:{},...u[h.project]?{keyFingerprint:u[h.project].fingerprint}:{},...K?{memory:K}:{},...b?{lastEvent:{at:b.lastEventAt,title:b.lastEvent}}:x?.lastTitle?{lastEvent:{at:x.lastSeenAt??0,title:x.lastTitle}}:{}}}).sort((h,g)=>nb[h.kind]-nb[g.kind]||h.project.localeCompare(g.project)),c=l.map(h=>({host:h.host,project:h.project,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count);for(let h of r)h.host&&!c.some(g=>g.host===h.host&&g.project===h.project)&&c.push({host:h.host,project:h.project,count:0,errors:0,avgMs:null});let p=[...this.edges.values()].filter(h=>!!h.caller).map(h=>({caller:h.caller,callee:h.project,host:h.host,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count),m=[...this.dataNodes.values()].filter(h=>h.kind!=="memory").map(h=>({id:h.id,kind:h.kind,name:h.name,usedBy:h.usedBy??(h.viaProject&&h.viaProject!=="unknown"?[h.viaProject]:[]),ops:h.count,lastSeenAt:h.lastSeenAt,...h.kind==="queue"&&(h.counts||h.recent)?{queue:{counts:h.counts??{},recent:(h.recent??[]).slice(0,8).map(g=>({id:String(g.id??""),...typeof g.name=="string"?{name:g.name}:{},...typeof g.state=="string"?{state:g.state}:typeof g.status=="string"?{state:g.status}:{},...typeof g.finishedOn=="number"?{at:g.finishedOn}:typeof g.timestamp=="number"?{at:g.timestamp}:{}}))}}:{}})).sort((h,g)=>g.ops-h.ops).slice(0,24),f=i.filter(h=>!h.v4||!h.v6);return{at:t,gateway:this.gatewayLiveness(t),services:d,routes:c,edges:p,backends:m,hosts:i,...f.length?{hostsFix:ob(f)}:{},trustCommand:this.trustCommand(),recent:this.recent.slice(-20).reverse()}}},nb={web:0,eager:1,lazy:2},II="node_modules/.cache/davnx-webpack/service-keys.json";function sb(e){if(process.platform==="win32")return"";try{return BI("ps",["-p",String(e),"-o","lstart="],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}s(sb,"IP"),o(sb,"processStamp");function mm(e){if(process.ppid===e)return!0;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(mm,"Fk"),o(mm,"pidAlive");function ab(e,t,r,i,u=!1){let n=r?.state;if(n==="crash-looping")return{state:"crash-looping",reason:"keeps exiting right after start"};if(n==="wedged")return{state:"wedged",reason:"running but not answering"};let a=n==="up"||t?.state==="up";return r?.buildFailed&&!a?{state:"down",reason:`${u?"a process error":"build failed"} \u2014 see the error lines`}:a?r?.buildFailed?{state:"up",reason:u?"reported a process error \u2014 see the error lines":"serving its last good build \u2014 the current build failed"}:{state:"up"}:n==="starting"||t?.state==="starting"?{state:"starting",reason:e==="lazy"?"cold start in progress":"starting"}:!n&&!t&&i>0?{state:"up",reason:`${i} pod socket${i===1?"":"s"} live`}:n==="idle"||t?.idle||e==="lazy"&&(n==="down"||t?.state==="down"||!t)?{state:"idle",reason:"scaled to zero \u2014 starts on the next request"}:n==="down"||t?.state==="down"?{state:"down",reason:"not running"}:{state:"unknown",reason:"no lifecycle events seen yet"}}s(ab,"RP"),o(ab,"serviceState");function ob(e){let t=e.filter(i=>!i.v4).map(i=>i.host),r=e.filter(i=>!i.v6).map(i=>i.host);return`printf '${[...t.length?[`127.0.0.1 ${t.join(" ")}`]:[],...r.length?[`::1 ${r.join(" ")}`]:[]].join("\\n")}\\n' | sudo tee -a /etc/hosts`}s(ob,"EP"),o(ob,"hostsFixCommand");var _I=class{static{s(this,"ic")}static{o(this,"LogRing")}constructor(e=5e3){this.cap=e,this.lines=[],this.seqN=0,this.sourceSet=new Set}get seq(){return this.seqN}get size(){return this.lines.length}sources(){return[...this.sourceSet].sort()}append(e){let t=lb(e,++this.seqN);return this.sourceSet.add(t.source),this.lines.push(t),this.lines.length>this.cap+Math.ceil(this.cap/10)&&this.lines.splice(0,this.lines.length-this.cap),t}since(e,t=this.cap){let r=this.indexAfter(e),i=this.lines.slice(r);return i.length>t?i.slice(i.length-t):i}recent(e){return this.lines.slice(Math.max(0,this.lines.length-e))}query(e){let t=e.limit??2e3,r=e.q?.toLowerCase(),i=e.since&&e.since>0?this.lines.slice(this.indexAfter(e.since)):this.lines,u=[];for(let n=i.length-1;n>=0&&u.length<t;n--){let a=i[n];e.flowId&&a.flowId!==e.flowId||e.from!==void 0&&a.at<e.from||e.to!==void 0&&a.at>e.to||r&&!`${a.title} ${a.message??""} ${a.source}`.toLowerCase().includes(r)||u.push(a)}return u.reverse()}indexAfter(e){let t=0,r=this.lines.length;for(;t<r;){let i=t+r>>>1;this.lines[i].seq<=e?t=i+1:r=i}return t}};function lb(e,t){let r=e.raw??{},i=e.context??{},u=typeof r.project=="string"&&r.project?r.project:e.source,n=typeof i.flowId=="string"?i.flowId:typeof i.traceId=="string"?i.traceId:void 0;return{seq:t,at:e.timestamp,source:u,category:e.category,severity:e.severity,title:e.title,...e.message?{message:e.message}:{},...n?{flowId:n}:{}}}s(lb,"TP"),o(lb,"logLineOf");var db=class{static{s(this,"Go")}static{o(this,"SeenIds")}constructor(e=5e4){this.cap=e,this.set=new Set,this.order=[]}firstTime(e){if(!e)return!0;if(this.set.has(e))return!1;if(this.set.add(e),this.order.push(e),this.order.length>this.cap)for(let t of this.order.splice(0,this.order.length-this.cap))this.set.delete(t);return!0}},cb=class{static{s(this,"sc")}static{o(this,"Series")}constructor(e){this.horizonSec=e,this.buckets=new Map}bucket(e){let t=this.buckets.get(e);return t||(t={sec:e,count:0,errors:0,lat:[],latReq:[]},this.buckets.set(e,t)),t}addTraffic(e,t,r){let i=this.bucket(e);i.count+=t,i.errors+=r}addLatency(e,t,r){let i=this.bucket(e),u=r?i.lat:i.latReq;u.length<256&&u.push(t)}prune(e){for(let t of this.buckets.keys())t<=e-this.horizonSec&&this.buckets.delete(t)}range(e,t){let r=[];for(let i of this.buckets.values())i.sec>e&&i.sec<=t&&r.push(i);return r}},SI=class{static{s(this,"ac")}static{o(this,"KpiWindow")}constructor(e={}){this.byProject=new Map,this.windowSec=e.windowSec??300,this.sparkBuckets=e.sparkBuckets??30,this.sparkBucketSec=e.sparkBucketSec??10,this.horizonSec=Math.max(this.windowSec,this.sparkBuckets*this.sparkBucketSec)+5,this.global=new cb(this.horizonSec)}project(e){let t=this.byProject.get(e);return t||(t=new cb(this.horizonSec),this.byProject.set(e,t)),t}observe(e){if(e.source!=="gateway")return;let t=e.raw??{},r=t.kind,i=Math.floor(e.timestamp/1e3),u=typeof t.project=="string"?t.project:"",n=typeof t.caller=="string"&&t.caller?t.caller:void 0;if(r==="gateway-traffic"){let a=fm(t.count),l=fm(t.errors);if(a===0&&l===0)return;n||this.global.addTraffic(i,a,l),u&&this.project(u).addTraffic(i,a,l);let d=Array.isArray(t.durationsMs)?t.durationsMs:[];for(let c of d){let p=Number(c);!Number.isFinite(p)||p<0||(n||this.global.addLatency(i,p,!0),u&&this.project(u).addLatency(i,p,!0))}}else if(r==="gateway-request"){let a=Number(t.durationMs);if(!Number.isFinite(a)||a<0)return;n||this.global.addLatency(i,a,!1),u&&this.project(u).addLatency(i,a,!1)}}snapshot(e=Date.now()){let t=Math.floor(e/1e3);this.global.prune(t);for(let u of this.byProject.values())u.prune(t);let r=this.global,i=vm(r,t,this.sparkBuckets,this.sparkBucketSec);return{at:e,windowSec:this.windowSec,req60:Ht(r.range(t-60,t),"count"),last:gm(r.range(t-this.windowSec,t)),sparkBucketSec:this.sparkBucketSec,spark:i}}projectStats(e,t=Date.now()){let r=this.byProject.get(e);if(!r)return;let i=Math.floor(t/1e3);return r.prune(i),{...gm(r.range(i-this.windowSec,i)),req60:Ht(r.range(i-60,i),"count"),spark:vm(r,i,this.sparkBuckets,this.sparkBucketSec).req}}};function fm(e){let t=Number(e??0);return Number.isFinite(t)&&t>0?t:0}s(fm,"Bk"),o(fm,"nonNeg");function Ht(e,t){let r=0;for(let i of e)r+=i[t];return r}s(Ht,"yn"),o(Ht,"sum");function hm(e){let t=[];for(let i of e)for(let u of i.lat)t.push(u);if(t.length)return{lat:t.sort((i,u)=>i-u),complete:!0};let r=[];for(let i of e)for(let u of i.latReq)r.push(u);return{lat:r.sort((i,u)=>i-u),complete:!1}}s(hm,"Vk"),o(hm,"latencies");function gm(e){let t=Ht(e,"count"),r=Ht(e,"errors"),{lat:i,complete:u}=hm(e),n=i.length?i.reduce((a,l)=>a+l,0)/i.length:null;return{count:t,errors:r,errorRate:t>0?r/t:null,p50:ea(i,.5),p95:ea(i,.95),avgMs:n===null?null:Math.round(n),samples:i.length,sampled:!u||i.length<t}}s(gm,"Zk"),o(gm,"statsOf");function ea(e,t){if(e.length===0)return null;let r=Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1));return Math.round(e[r])}s(ea,"Rb"),o(ea,"percentile");function vm(e,t,r,i){let u=[],n=[],a=[];for(let l=r-1;l>=0;l--){let d=t-l*i,c=e.range(d-i,d);u.push(Ht(c,"count")),n.push(Ht(c,"errors")),a.push(ea(hm(c).lat,.95))}return{req:u,errors:n,p95:a}}s(vm,"qk"),o(vm,"sparkOf");var FI=class{static{s(this,"cc")}static{o(this,"FlowIndex")}constructor(e={flows:2e3,events:5e4},t=Et){this.caps=e,this.config=t,this.revs=new Map,this.pending=new Set,this.eventFlow=new Map,this.cache=new Map,this.evidenceCache=new Map}observe(e){let t=ym(e);if(!t)return;let r=(this.revs.get(t)??0)+1;this.revs.delete(t),this.revs.set(t,r),this.revs.size>this.caps.flows&&this.revs.delete(this.revs.keys().next().value),this.pending.add(t),e.id&&(this.eventFlow.set(e.id,t),this.eventFlow.size>this.caps.events&&this.eventFlow.delete(this.eventFlow.keys().next().value))}rev(e){return this.revs.get(e)??0}drainRevs(){let e=[...this.pending].map(t=>({flowId:t,rev:this.rev(t)}));return this.pending.clear(),e}flowOfEvent(e){return this.eventFlow.get(e)}summaries(e,t=50){if(!e)return[];let r=[];for(let u of e.recentFlowIds().slice(0,t)){let n=this.rev(u),a=this.cache.get(u);if(a&&a.rev===n&&n>0){r.push(a.summary);continue}let l=e.getFlowSummary(u);if(!l)continue;let d=e.getFlowEvents(u)??[],c=e.analyzeFlow?.(u)??(d.length?ts(d,this.config):void 0),p=yb(l,d,n,c);this.cache.set(u,{rev:n,summary:p}),r.push(p)}let i=new Set(r.map(u=>u.flowId));for(let u of this.cache.keys())i.has(u)||this.cache.delete(u);return r.sort((u,n)=>n.lastSeenAt-u.lastSeenAt)}evidence(e,t=50){let r=[];if(e){for(let i of e.recentFlowIds().slice(0,t)){let u=this.rev(i),n=this.evidenceCache.get(i);if(n&&n.rev===u&&u>0){r.push(...n.samples);continue}let a=pb(i,e.getFlowEvents(i)??[]);this.evidenceCache.set(i,{rev:u,samples:a}),r.push(...a)}if(this.evidenceCache.size>t*2){let i=new Set(e.recentFlowIds().slice(0,t));for(let u of this.evidenceCache.keys())i.has(u)||this.evidenceCache.delete(u)}}return new jI(r)}findByRoute(e,t,r){let i=ta(r);return e.find(u=>u.request&&u.request.method===t&&i.test(u.request.path))?.flowId}};function pb(e,t){let r=[],i=new Map;for(let n of t){let a=n.raw??{};if(a.kind==="server-request"&&n.id){let l=a.request??{},d=fb(n)??(typeof l.requestId=="string"?l.requestId:void 0);if(!d)continue;let c=typeof l.endedAt=="number"?l.endedAt:mb(n),p=typeof l.startedAt=="number"?l.startedAt:c-(typeof l.durationMs=="number"?l.durationMs:0);i.set(d,[...i.get(d)??[],{id:n.id,start:p,end:c}])}}let u=o((n,a)=>{let l=n?i.get(n):void 0;if(l?.length)return l.length===1?l[0].id:l.filter(d=>d.start-5<=a&&a<=d.end+5).sort((d,c)=>c.start-d.start)[0]?.id},"handlerAt");for(let n of t){if(!n.id)continue;let a=n.raw??{},l=mb(n),d=o(p=>typeof p=="number"&&Number.isFinite(p)?p:0,"num"),c=a.kind;if(c==="server-request"){let p=a.request??{};if(typeof p.route!="string")continue;r.push({key:`route:${String(p.method??"GET")} ${p.route}`,flowId:e,eventId:n.id,ms:d(p.durationMs),at:l,failed:d(p.status)>=500})}else if(c==="db-query"&&typeof a.project=="string"){let p=`${String(a.op??"query")} ${String(a.table??"")}`.trim(),m=n.title.replace(/\s*\(.*$/,"").trim();for(let f of new Set([p,m]))r.push({key:`sql:${a.project}:${f}`,flowId:e,eventId:n.id,ms:d(a.durationMs),at:l,failed:n.severity==="error"})}else if(c==="egress"&&typeof a.project=="string"&&typeof a.host=="string"){let p=typeof a.error=="string"||d(a.status)>=500||n.severity==="error";r.push({key:`egress:${a.project}:${a.host}`,flowId:e,eventId:n.id,ms:d(a.durationMs),at:l,failed:p})}else if(c==="memory-mutation"){let p=(a.mutation??{}).ownerNodeId;if(typeof p!="string")continue;r.push({key:`mem:${p}`,flowId:e,eventId:u(fb(n),l)??n.id,ms:0,at:l,failed:!1})}}return r}s(pb,"AP"),o(pb,"evidenceSamples");var mb=o(e=>typeof e.timestamp=="number"?e.timestamp:Date.parse(String(e.timestamp))||0,"tsOf"),fb=o(e=>{let t=e.context??{};return typeof t.requestId=="string"&&t.requestId?t.requestId:void 0},"requestIdOf"),jI=class{static{s(this,"Eb")}static{o(this,"EvidenceLookup")}constructor(e){this.samples=e}find(e,t,r={}){let i;for(let u of this.samples)!e(u.key)||r.inFlow!==void 0&&u.flowId!==r.inFlow||t==="failing"&&!u.failed||r.minMs!==void 0&&u.ms<r.minMs||(i?(t==="slowest"?u.ms>i.ms||u.ms===i.ms&&u.at>i.at:u.at>i.at)&&(i=u):i=u);return i?{flowId:i.flowId,nodeId:i.eventId}:void 0}};function ym(e){let t=e.context??{};return typeof t.flowId=="string"&&t.flowId?t.flowId:void 0}s(ym,"Tb"),o(ym,"flowIdOf");function ta(e){let t=e.split("/").map(r=>r.startsWith(":")?"[^/?#]+":r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("/");return new RegExp(`^${t}(?:[?#].*)?$`)}s(ta,"uc"),o(ta,"routeRegex");var zI=new Set(["memory-mutation","memory-retention","singleton-instance","subscription-added","subscription-removed","store-created","hook-run"]),NI={"user-click":"click","user-input":"input","input-change":"input",keyboard:"key press","route-load":"navigate","page-load":"page load","form-submit":"submit",effect:"effect",timer:"timer","websocket-message":"socket message","backend-response":"response","hmr-update":"hot reload","ai-turn":"AI turn"};function hb(e){return e?NI[e]??e.replace(/-/g," "):"request"}s(hb,"OP"),o(hb,"originLabelOf");function gb(e){if(!e)return;if(e.startsWith("page:"))return e.slice(5)||"/";let t=/([^/:]+\.[cm]?[jt]sx?):(\d+)/.exec(e);if(t)return`${t[1]}:${t[2]}`;let r=e.replace(/^[a-z]+:/,"");return r.length>40?"\u2026"+r.slice(-39):r}s(gb,"MP"),o(gb,"originWhereOf");function vb(e){let t=Xn.indexOf(e);return t===-1?Xn.length:t}s(vb,"NP"),o(vb,"categoryRankOf");function yb(e,t,r,i){let u={},n=new Set,a="ok",l,d=1/0,c,p=1/0,m=1/0,f=-1/0,h=new Set,g=0,b=0,x,$=o(j=>{(j==="error"||j==="warn"&&a==="ok")&&(a=j)},"bump");for(let j of t){let N=j.raw??{},K=j.context??{},H=typeof N.kind=="string"?N.kind:void 0,ye=bd({source:j.source,category:j.category,title:j.title,kind:H});u[ye]=(u[ye]??0)+1;let Ze=typeof N.project=="string"?N.project:typeof K.projectName=="string"?K.projectName:void 0;Ze&&j.source!=="gateway"&&n.add(Ze),j.severity==="error"||j.severity==="fatal"?($("error"),b++,(!x||j.timestamp<x.at)&&(x={at:j.timestamp,title:j.title})):j.severity==="warning"&&$("warn");let Je=Number(N.status??N.request?.status);if(Number.isFinite(Je)&&(Je>=500?$("error"):Je>=400&&$("warn")),(H==="fetch-start"||H==="fetch-done"||H==="fetch-error")&&typeof N.url=="string"){let Oe=Number(N.startedAt??j.timestamp);(Oe<d||Oe===d&&l&&l.status===void 0)&&(d=Oe,l={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Je)?{status:Je}:l?.status!==void 0?{status:l.status}:{}})}if(h.size<80)if(H==="gateway-request"&&typeof N.url=="string")h.add(`${String(N.method??"GET")} ${Em(N.url)}`);else if(H==="server-request"){let Oe=N.request??{};typeof Oe.route=="string"&&h.add(`${String(Oe.method??"GET")} ${Oe.route}`)}else H==="db-query"&&Ze?h.add(`sql:${Ze}:${j.title.replace(/\s*\(.*$/,"")}`):H==="egress"&&Ze&&typeof N.host=="string"&&h.add(`egress:${Ze}:${N.host}`);if(H==="gateway-request"&&!N.caller&&j.source==="gateway"&&g++,H==="gateway-request"&&!N.caller&&typeof N.url=="string"&&j.timestamp<p&&(p=j.timestamp,c={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Je)?{status:Je}:{}}),H&&zI.has(H))continue;let It=Number(N.durationMs??N.request?.durationMs??0),tt=Number(N.startedAt),$i=Number.isFinite(tt)&&tt>0?tt:j.timestamp-(Number.isFinite(It)?It:0),Uu=Number.isFinite(tt)&&tt>0&&Number.isFinite(It)?tt+It:j.timestamp;$i<m&&(m=$i),Uu>f&&(f=Uu)}!l&&c&&(l=c);let w=hb(e.originType),k=gb(e.originNodeId),C=l?`${l.method} ${Em(l.path)}`:void 0,M=e.headline&&e.headline!==e.originType?e.headline:void 0,y=!e.originType&&g>1?` +${g-1} more request${g===2?"":"s"}`:"",D=e.originType?`${w}${k?` \xB7 ${k}`:""}`:C?`${C}${y}`:M??w,A=e.originType&&C?`${D} \u2192 ${C}`:D;return{flowId:e.flowId,...e.originType?{originType:e.originType}:{},...e.originNodeId?{originNodeId:e.originNodeId}:{},startedAt:e.startedAt,lastSeenAt:e.lastSeenAt,eventCount:e.eventCount,headline:A,originLabel:w,...k?{originWhere:k}:{},...l?{request:l}:{},worst:a,durationMs:Number.isFinite(m)&&f>=m?Math.round(f-m):0,lanes:u,projects:[...n].sort(),rev:r,...g?{requestCount:g}:{},...b?{errorCount:b,firstError:bb(x.title)}:{},...h.size?{touches:[...h]}:{},...i?Eb(i):{}}}s(yb,"PP"),o(yb,"summarizeFlow");function Eb(e){let t=e.classification,r=e.segmentation.stats;return{category:t.category,categoryRank:vb(t.category),decidedBy:t.decidedBy,...t.subject?{subject:t.subject}:{},tags:t.tags,segmentCount:r.segments,phaseCount:r.phases,signalCount:r.signal}}s(Eb,"DP"),o(Eb,"analysisFields");function bb(e){return e.replace(/\s*✗\s*$/,"").replace(/\s*\((?:\d+ rows?, )?[\d.]+ ?ms\)$/,"")}s(bb,"CP"),o(bb,"cleanTitle");function Em(e){let t=e.indexOf("?");return t>=0?e.slice(0,t):e}s(Em,"Wk"),o(Em,"stripQuery");function bm(e,t){return{id:e.id,kind:e.kind,label:e.label,phase:e.phase,start:e.start,end:e.end,durationMs:e.durationMs,counts:e.counts,projects:e.projects,...e.method?{method:e.method}:{},...e.route?{route:e.route}:{},...e.requestId?{requestId:e.requestId}:{},...e.after?{after:e.after}:{},...e.hot?{hot:e.hot}:{},...e.part?{part:e.part}:{},worstSeverity:e.worstSeverity,category:t}}s(bm,"Kk"),o(bm,"toDashSegment");function wb(e,t,r){if(!e)return{flowId:t,summary:null,events:[],rev:r.rev};let i=e.getFlowSummary(t)??null,u=e.getFlowEvents(t)??[],n=e.analyzeFlow?.(t)??(u.length?ts(u,r.config??Et):void 0),a,l=u;if(r.segmentId!==void 0){a=n?.segmentation.segments.find(g=>g.id===r.segmentId);let h=new Set(a?.eventIds??[]);l=u.filter(g=>h.has(g.id))}let d=Hn(l,{includeRaw:r.includeRaw===!0}),c={flowId:t,summary:i,...d,rev:r.rev};if(!n)return c;let p=n.segmentation.assignment;c.events=c.events.map(h=>{let g=p[h.id]??(h.memberIds?.[0]?p[h.memberIds[0]]:void 0);return g?{...h,segmentId:g}:h});let m=o(h=>n.segmentCategories[h.id]??"other","category");c.segments=n.segmentation.segments.map(h=>bm(h,m(h))),c.phases=n.segmentation.phases,c.segmentCategories=n.segmentCategories,c.segmentStats=n.segmentation.stats;let f=n.classification;return c.classification={category:f.category,decidedBy:f.decidedBy,...f.ruleIndex!==void 0?{ruleIndex:f.ruleIndex}:{},...f.subject?{subject:f.subject}:{},tags:f.tags,origin:f.origin},a&&(c.focus=bm(a,m(a))),c}s(wb,"Xk"),o(wb,"flowDetailPayload");var MI=300,OI=1e3,Db=20,$b=30,RI=1500,we=o(e=>e&&typeof e=="object"?e:{},"obj"),P=o(e=>typeof e=="string"&&e?e:void 0,"str"),ve=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num"),TI=class{static{s(this,"pc")}static{o(this,"ErrorLog")}constructor(e=Date.now){this.now=e,this.groups=new Map,this.pending=[],this.byRequest=new Map,this.projectOfRequest=new Map,this.seen=new Set,this.dismissals=new Map,this.changed=!1}observe(e){if(e.id){if(this.seen.has(e.id))return!1;this.seen.add(e.id),this.seen.size>2e4&&this.seen.delete(this.seen.values().next().value)}let t=yd(e);if(t)return this.dismissals.delete(t.groupId),t.kind===wu&&(this.dismissals.set(t.groupId,{until:t.until,at:e.timestamp,eventIds:new Set(t.eventIds),...t.by?{by:t.by}:{},...t.reason?{reason:t.reason}:{}}),this.dismissals.size>OI&&this.dismissals.delete(this.dismissals.keys().next().value)),this.changed=!0,!0;let r=we(e.raw),i=we(e.context),u=P(r.kind),n=P(i.requestId);u==="gateway-request"&&n&&P(r.project)&&(this.projectOfRequest.set(n,P(r.project)),this.projectOfRequest.size>5e3&&this.projectOfRequest.delete(this.projectOfRequest.keys().next().value));let a=e.severity==="error"||e.severity==="fatal",l=we(r.request),d=ve(r.status)??ve(l.status);return u==="server-request"&&(a||(d??0)>=500)?this.defer(e,"server"):e.source==="client-runtime"&&a&&(u==="error"||u==="unhandledrejection"||u==="resource-error"||u==="console")?this.browser(e,r,i):u==="egress"&&(P(r.error)||(d??0)>=500)?this.external(e,r,i,d):u==="queue-failed"?this.queue(e,r,i):u==="span"&&a?this.defer(e,"span"):u==="gateway-request"&&((d??0)>=500||d===0)?this.defer(e,"gateway"):u==="fetch-done"&&(d??0)>=500||u==="fetch-error"?this.defer(e,"fetch"):u==="log"&&a&&(e.source==="nestjs"||e.source==="nest")?this.defer(e,"log"):!1}flush(e=!1){let t=this.now(),r=o(a=>e||t-a.arrivedAt>=RI,"ready"),i=o(a=>P(we(a.event.context).requestId),"requestOf");for(let a of this.pending.filter(l=>l.kind==="server"&&r(l))){this.pending.splice(this.pending.indexOf(a),1);let l=we(a.event.raw);this.server(a.event,l,we(l.request),we(a.event.context))}let u=new Set(this.pending.filter(a=>a.kind==="server").map(i).filter(Boolean));for(let a of this.pending.filter(l=>l.kind!=="server"&&r(l)&&!(i(l)&&u.has(i(l)))))this.pending.splice(this.pending.indexOf(a),1),this.settle(a);let n=this.changed;return this.changed=!1,n}snapshot(e=[],t=15*6e4){let r=this.now(),i=Math.floor(r/6e4),u=[...this.groups.values()].map(c=>{let p=[];for(let b=i-$b+1;b<=i;b++)p.push(c.perMinute.get(b)??0);let{flows:m,perMinute:f,eventIds:h,...g}=c;return{...g,occurrences:[...g.occurrences],flowCount:m.size,spark:p}}),n=this.hiddenEvents(),a=[],l=[];for(let c of[...e,...u].sort((p,m)=>+!!m.ongoing-+!!p.ongoing||m.lastSeenAt-p.lastSeenAt)){let p=this.dismissalOf(c,n);p?l.push({...c,dismissedAt:p.at,...p.by?{dismissedBy:p.by}:{},...p.reason?{dismissedReason:p.reason}:{}}):a.push(c)}let d=a.filter(c=>c.ongoing||r-c.lastSeenAt<=t);return{at:r,recentMs:t,groups:a,recentGroups:d.length,recentOccurrences:d.reduce((c,p)=>c+(p.ongoing?1:p.occurrences.filter(m=>r-m.at<=t).length),0),dismissed:l}}hiddenEvents(){let e=new Map;for(let t of this.dismissals.values())for(let r of t.eventIds)(e.get(r)?.at??-1)<=t.at&&e.set(r,t);return e}dismissalOf(e,t){let r=this.dismissals.get(e.id);if(r&&e.lastSeenAt<=r.until)return r;let i=this.groups.get(e.id)?.eventIds,u=i?.[i.length-1];return u===void 0?void 0:t.get(u)}dismissalsFor(e,t=[],r=this.now()){let i=[];for(let u of new Set(e)){let n=this.groups.get(u),a=n??t.find(l=>l.id===u);a&&i.push({groupId:u,until:Math.max(r,a.lastSeenAt),eventIds:n?n.eventIds.slice():[],by:"dashboard",title:a.title})}return i}restorable(e){let t=new Set;for(let r of new Set(e)){this.dismissals.has(r)&&t.add(r);let i=this.groups.get(r)?.eventIds??[];for(let[u,n]of this.dismissals)i.some(a=>n.eventIds.has(a))&&t.add(u)}return[...t]}server(e,t,r,i){let u=P(i.requestId)??P(r.requestId),n=P(i.projectName)??P(t.project)??(u?this.projectOfRequest.get(u):void 0),a=P(r.method)??"GET",l=P(r.route)??"?",d=ve(r.status)??ve(t.status),c=we(r.error),p=P(c.message)??P(e.message),m=P(c.name),f=`${a} ${l}${d?` \u2192 ${d}`:""}`,h=`server:${n??"?"}:${a} ${l}:${d??""}:${m??""}:${Xt(p)}`,g=this.record(h,"server",e,{title:f,...n?{where:n,project:n}:{},...p?{message:p}:{},...P(c.stack)?{stack:hi(P(c.stack))}:{},...d!==void 0?{status:d}:{}},u,d);return u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g}),this.trimRequests(),!0}browser(e,t,r){let i=P(t.message)??e.title,u=P(r.url)??P(r.route),n=`browser:${P(t.kind)}:${Xt(i)}`;return this.record(n,"browser",e,{title:i.split(`
|
|
78
|
-
`)[0].slice(0,160),...u?{where:
|
|
79
|
-
`)[0].slice(0,160),...b?{where:b,project:b}:{},message:$,...P(x.stack)?{stack:hi(
|
|
80
|
-
`)[0].slice(0,100)}`:""}`,...$?{where:$,project:$}:{},...w?{message:w}:{}},u);u&&this.byRequest.set(u,{group:[...this.groups.values()].find(C=>C.occurrences.includes(k)),occ:k});return}let a=ve(r.status),l=P(r.method)??"GET",d=P(r.url)??"?",c=P(r.project),p=P(r.host),m=e.kind==="fetch"&&!a?"network error":String(a??"failed"),f=e.kind==="gateway"?`${l} ${p??""}${Nu(d)} \u2192 ${m}`:`${l} ${Nu(d)} \u2192 ${m}`,h=`request:${e.kind}:${c??p??""}:${l} ${Nu(d)}:${m}`,g=this.record(h,"request",t,{title:f,where:e.kind==="gateway"?`gateway \u2192 ${c??p??"?"}`:"browser",...c?{project:c}:{},...a!==void 0?{status:a}:{},...e.kind==="gateway"?{message:
|
|
75
|
+
${r}`).digest("hex")}s(mm,"Mk"),o(mm,"loginSignature");function QE(e,t,r=JE(16).toString("hex")){let i=t+GE;return`${i}.${r}.${mm(e,i,r)}`}s(QE,"Nk"),o(QE,"mintLoginCode");var EI=/^(\d{1,16})\.([0-9a-f]{32})\.([0-9a-f]{64})$/,bI=class{static{s(this,"tc")}static{o(this,"LoginLedger")}constructor(){this.redeemed=new Map}redeem(e,t,r){for(let[a,l]of this.redeemed)l<=r&&this.redeemed.delete(a);let i=EI.exec(t.trim());if(!i)return"invalid";let u=Number(i[1]),n=i[2];return fi(i[3],mm(e,u,n))?u<=r||u>r+GE+6e4?"expired":this.redeemed.has(n)?"used":(this.redeemed.set(n,u),"ok"):"invalid"}};function eb(e){return e==="/api"||e.startsWith("/api/")}s(eb,"Pk"),o(eb,"isDataEndpoint");function tb(e){return e.startsWith("/assets/dashboard-ui/")}s(tb,"Dk"),o(tb,"isAssetPath");function ub(e){let t=Number(process.env.LENSMCP_PARENT_PID??0);!Number.isInteger(t)||t<=0||setInterval(()=>{process.ppid!==t&&(console.error(`[lensmcp] ${e}: parent gateway (pid ${t}) is gone \u2014 exiting to free the port.`),process.exit(0))},5e3).unref()}s(ub,"Ck"),o(ub,"watchParentGateway");import{closeSync as wI,openSync as DI,readSync as $I,statSync as BI}from"node:fs";function rb(e,t,r){let i=BI(e).size;if(i===0)return[];let u=Math.max(0,i-t),n=Buffer.alloc(i-u),a=DI(e,"r");try{$I(a,n,0,n.length,u)}finally{wI(a)}let l=n.toString("utf8").trim().split(`
|
|
76
|
+
`);return u>0&&l.shift(),l.slice(-r)}s(rb,"Uk"),o(rb,"readEventTailLines");import{execFileSync as xI}from"node:child_process";import{createHash as CI}from"node:crypto";import{readdirSync as ib,readFileSync as Qs}from"node:fs";import{homedir as kI}from"node:os";var nb=new Set(["db","redis","queue","memory","external","fs","exec"]),AI=16;function ke(e){let t=Number(e??0);return Number.isFinite(t)&&t>=0?t:0}s(ke,"Ce"),o(ke,"finite");var II=class{static{s(this,"oc")}static{o(this,"ClusterState")}constructor(e){this.opts=e,this.gateway=null,this.services=new Map,this.edges=new Map,this.recent=[],this.dataNodes=new Map,this.podMemory=new Map,this.declCache={at:0,decls:[]},this.registryCache={at:0}}reduce(e){if(e.source==="memory"&&this.reducePodMemory(e))return;if(nb.has(e.source)){let u=e.raw??{},n=e.context??{},a=String(u.queue??u.store??u.name??e.source),l=n.projectName??u.project,d=typeof l=="string"&&l?l:void 0,c=e.source+":"+a,p=this.dataNodes.get(c),m=u.kind==="queue-state",f=u.kind==="fs-ops"?ke(u.reads)+ke(u.writes):m?0:1,h=new Set(p?.usedBy??[]);d&&h.add(d),this.dataNodes.set(c,{id:c,kind:e.source,name:a,viaProject:p?.viaProject??d??"unknown",usedBy:[...h].sort(),count:(p?.count??0)+f,lastSeenAt:e.timestamp,counts:m?u.counts:p?.counts,recent:m?u.recent:p?.recent}),this.opts.onChange?.();return}if(e.source!=="gateway")return;let t=e.raw??{},r=typeof t.kind=="string"?t.kind:"",i=e.timestamp;if(r==="gateway-up")this.gateway={at:i,ports:t.ports??[],routes:t.routes??[]};else if(r==="gateway-down")this.gateway&&(this.gateway={...this.gateway,ports:[]});else if(r==="gateway-traffic"){this.gateway||(this.gateway={at:i,ports:[],routes:[]}),this.gateway.aliveAt=i;let u=String(t.host??""),n=String(t.project??""),a=typeof t.caller=="string"?t.caller:void 0,l=(a?a+"\u21D2":"")+u+"\u2192"+n,d=this.edges.get(l);this.edges.set(l,{host:u,project:n,caller:a,count:(d?.count??0)+ke(t.count),avgMs:ke(t.avgMs),errors:(d?.errors??0)+ke(t.errors),lastSeenAt:i})}else if(r.startsWith("service-")||r==="cold-start"||r==="autoscale"||r==="idle-kill"){let u=String(t.project??"");if(!u)return;let n=this.services.get(u),a={project:u,state:n?.state??"unknown",pods:n?.pods,lastColdStartMs:n?.lastColdStartMs,lastEventAt:i,lastEvent:e.title};r==="service-starting"&&(a.state="starting"),r==="service-up"&&(a.state="up",a.pods=ke(t.pods??a.pods)),r==="cold-start"&&(a.state="up",a.pods=ke(t.pods??a.pods),typeof t.durationMs=="number"&&(a.lastColdStartMs=t.durationMs)),r==="autoscale"&&(a.pods=ke(t.to??a.pods)),(r==="service-down"||r==="idle-kill")&&(a.state="down",a.pods=0,r==="idle-kill"&&(a.idle=!0)),this.services.set(u,a)}this.recent.push({at:i,title:e.title,severity:e.severity}),this.recent.length>40&&this.recent.splice(0,this.recent.length-40),this.opts.onChange?.()}reducePodMemory(e){let t=Gn(e.raw);if(!t)return!1;let r=this.podMemory.get(t.project);r||(r=new Map,this.podMemory.set(t.project,r));let i=`${t.pod}:${t.pid}`;if(t.kind==="pod-memory-exited")r.delete(i);else{let u=r.get(i);if(!u&&(u={pod:t.pod,pid:t.pid,podGeneration:t.podGeneration??1,retained:new Map,lastSeenAt:e.timestamp},r.set(i,u),r.size>AI)){let n=[...r.entries()].sort((a,l)=>a[1].lastSeenAt-l[1].lastSeenAt)[0];n&&r.delete(n[0])}u.lastSeenAt=e.timestamp,t.kind==="pod-memory"?u.latest=t:t.kind==="pod-memory-retained"?u.retained.set(t.gen,{gen:t.gen,closedAt:ke(t.closedAt)}):u.retained.delete(t.gen)}return this.opts.onChange?.(),!0}memoryOf(e,t,r){let i=this.podMemory.get(e);if(!i||i.size===0)return;let u=[...i.values()].filter(l=>l.latest?t.length===0?r-l.lastSeenAt<=30*6e4:t.includes(l.podGeneration>1?`child-${l.pod}-g${l.podGeneration}`:`child-${l.pod}`):!1);if(u.length===0)return;let n=u.reduce((l,d)=>(l.latest?.at??0)>=(d.latest?.at??0)?l:d),a=u.map(l=>l.latest?.baseline??(l.latest?.trigger==="boot"?l.latest.live:void 0)).filter(l=>typeof l=="number");return{live:u.reduce((l,d)=>l+ke(d.latest?.live),0),reserved:u.reduce((l,d)=>l+ke(d.latest?.reserved),0),rss:u.reduce((l,d)=>l+ke(d.latest?.rss),0),...a.length?{baseline:Math.max(...a)}:{},swaps:Math.max(...u.map(l=>ke(l.latest?.swaps))),pods:u.length,retained:u.flatMap(l=>[...l.retained.values()].map(d=>({pod:l.pod,gen:d.gen,ageMs:Math.max(0,r-d.closedAt)}))),at:ke(n.latest?.at),trigger:String(n.latest?.trigger??""),...n.latest?.service?{service:n.latest.service}:{}}}discoverDecls(){if(Date.now()-this.declCache.at<1e4)return this.declCache.decls;let e=[],t,r=o((i,u)=>{if(u>4)return;let n;try{n=ib(i,{withFileTypes:!0})}catch{return}for(let a of n){if(a.name==="node_modules"||a.name.startsWith("."))continue;let l=`${i}/${a.name}`;if(a.isDirectory())r(l,u+1);else if(a.name==="project.json")try{let d=JSON.parse(Qs(l,"utf8")),c=d.targets??{};!t&&/cluster:trust$/.test(c.trust?.executor??"")&&(t=String(d.name??""));let p=d.cluster??d.davnx;if(!p)continue;let m=c["serve-hmr"]?.options?.internalPort,f=(c["serve-hmr"]?.options?.workers??[]).map(g=>g.name),h=typeof p.service=="string"?p.service:void 0;e.push({project:String(d.name??l),host:p.host,path:p.path,internalHost:p.internalHost,service:h,port:p.port,upstream:p.upstream,prependPrefix:p.prependPrefix,default:p.default,internalPort:m,workers:f,podNames:h?this.podNames(h):[],eager:p.eager,minPods:p.minPods,maxPods:p.maxPods,auth:p.auth})}catch{}}},"walk");return r(this.opts.root,0),this.declCache={at:Date.now(),decls:e,...t?{trustProject:t}:{}},e}trustCommand(){return this.discoverDecls(),`yarn nx run ${this.declCache.trustProject||"gateway"}:trust`}podNames(e){try{return ib(this.opts.podSockDir(e)).filter(t=>t.endsWith(".sock")).map(t=>t.replace(".sock","")).sort()}catch{return[]}}hostsSetup(e){let t="";try{t=(this.opts.readHosts??(()=>Qs("/etc/hosts","utf8")))()}catch{}let r=t.split(`
|
|
77
|
+
`).map(n=>n.trim()).filter(n=>n&&!n.startsWith("#")).map(n=>n.split(/\s+/)),i=o((n,a)=>r.some(l=>l[0]===n&&l.slice(1).includes(a)),"has"),u=[];for(let n of e)n.host&&!n.host.includes("*")&&(u.push(n.host),n.service&&n.internalHost!==!1&&u.push(typeof n.internalHost=="string"?n.internalHost:`internal.${n.host}`));return[...new Set(u)].map(n=>({host:n,v4:i("127.0.0.1",n),v6:i("::1",n)}))}serviceKeyView(){let e;try{e=JSON.parse(Qs(`${this.opts.root}/${_I}`,"utf8"))}catch{return{}}let t={};for(let[r,i]of Object.entries(e))typeof i!="string"||i===""||(t[r]={fingerprint:CI("sha256").update(i).digest("hex").slice(0,12)});return t}liveDecls(){let e=this.discoverDecls();for(let t of e)t.service&&(t.podNames=this.podNames(t.service));return e}legacyView(){let e=this.liveDecls();return{at:Date.now(),gateway:this.gateway,decls:e,hostsSetup:this.hostsSetup(e),trustCommand:this.trustCommand(),serviceKeys:this.serviceKeyView(),services:[...this.services.values()].sort((t,r)=>t.project.localeCompare(r.project)),edges:[...this.edges.values()].sort((t,r)=>r.lastSeenAt-t.lastSeenAt),dataNodes:[...this.dataNodes.values()].sort((t,r)=>r.count-t.count).slice(0,24),recent:this.recent.slice(-20).reverse()}}gatewayLiveness(e=Date.now()){let t=this.opts.env??process.env,r=(t.LENSMCP_GATEWAY_PORTS??"").split(",").map(d=>Number(d.trim())).filter(d=>Number.isInteger(d)&&d>0),i=this.gateway?.ports??[],u=r.length?r:i,n=Number(t.LENSMCP_PARENT_PID??0);if(n>0)return fm(n)?{state:"live",role:"gateway-child",ports:u,since:this.gateway?.at,evidence:`served by the gateway process (pid ${n})`}:{state:"down",role:"gateway-child",ports:u,evidence:`the gateway that started this dashboard (pid ${n}) is gone`};if(i.length>0)return{state:"live",role:"standalone",ports:u,since:this.gateway?.at,evidence:"gateway-up event on this workspace\u2019s bus"};let a=this.registeredGateway(e);if(a)return{state:"live",role:"standalone",ports:u,evidence:`registered with the gateway daemon (pid ${a})`};let l=this.gateway?.aliveAt??0;return l>e-3e4?{state:"live",role:"standalone",ports:u,since:l,evidence:`gateway traffic ${Math.round((e-l)/1e3)}s ago`}:this.gateway?{state:"down",role:"standalone",ports:u,evidence:"no gateway traffic in the last 30s"}:{state:"unknown",role:"standalone",ports:u,evidence:"no gateway events seen \u2014 is this dashboard running without the gateway?"}}registeredGateway(e){if(e-this.registryCache.at<15e3)return this.registryCache.pid;let t;try{let r=`${(this.opts.env??process.env).LENSMCP_HOME||kI()}/.lensmcp/workspaces.json`,i=JSON.parse(Qs(r,"utf8")),u=Array.isArray(i)?i.find(n=>n.root===this.opts.root):void 0;u&&typeof u.pid=="number"&&u.pid>0&&fm(u.pid)&&(!u.procStamp||ab(u.pid)===u.procStamp)&&(t=u.pid)}catch{}return this.registryCache={at:e,...t?{pid:t}:{}},t}view(e){let t=e.now??Date.now(),r=this.liveDecls(),i=this.hostsSetup(r),u=this.serviceKeyView(),n=new Map((e.processCluster?.services??[]).map(h=>[h.project,h])),a=new Map;for(let h of e.processCluster?.errors??[]){if(!h.project||!h.line)continue;let g=a.get(h.project)??[];g.push(h.line),a.set(h.project,g.slice(-6))}let l=[...this.edges.values()].filter(h=>!h.caller),d=r.map(h=>{let g=h.service?h.eager?"eager":"lazy":"web",b=this.services.get(h.project),x=n.get(h.project),$=(e.processCluster?.errors??[]).filter(H=>H.project===h.project&&H.fault!=="types"),w=x?.buildFailed===!0&&$.length>0&&$.every(H=>H.fault==="process"),{state:k,reason:C}=ob(g,b,x,h.podNames.length,w),M=l.filter(H=>H.project===h.project),y=M.reduce((H,ye)=>H+ye.count,0),D=M.reduce((H,ye)=>H+ye.errors,0),A=M.slice().sort((H,ye)=>ye.lastSeenAt-H.lastSeenAt)[0],j=e.kpis?.projectStats(h.project,t),N=h.service&&h.internalHost!==!1&&h.host?typeof h.internalHost=="string"?h.internalHost:`internal.${h.host}`:void 0,K=h.service?this.memoryOf(h.project,h.podNames,t):void 0;return{project:h.project,kind:g,state:k,...C?{stateReason:C}:{},...h.host?{host:h.host}:{},...h.path?{path:h.path}:{},...N?{internalHost:N}:{},...h.port!==void 0?{port:h.port}:{},...h.internalPort!==void 0?{internalPort:h.internalPort}:{},pods:{running:h.podNames.length,names:h.podNames,...h.minPods!==void 0?{min:h.minPods}:{},...h.maxPods!==void 0?{max:h.maxPods}:{}},workers:h.workers??[],...b?.lastColdStartMs!==void 0?{lastColdStartMs:b.lastColdStartMs}:{},restarts:x?.restarts??0,buildFailed:(x?.buildFailed??!1)&&!w,processError:w,typeErrors:x?.typeErrors??!1,errorLines:a.get(h.project)??[],...h.auth?{auth:{...h.auth.default?{default:h.auth.default}:{},overrides:h.auth.overrides?.length??0}}:{},traffic:{count:y,errors:D,avgMs:A?A.avgMs:null,...A?{lastSeenAt:A.lastSeenAt}:{}},...j?{window:j}:{},...u[h.project]?{keyFingerprint:u[h.project].fingerprint}:{},...K?{memory:K}:{},...b?{lastEvent:{at:b.lastEventAt,title:b.lastEvent}}:x?.lastTitle?{lastEvent:{at:x.lastSeenAt??0,title:x.lastTitle}}:{}}}).sort((h,g)=>sb[h.kind]-sb[g.kind]||h.project.localeCompare(g.project)),c=l.map(h=>({host:h.host,project:h.project,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count);for(let h of r)h.host&&!c.some(g=>g.host===h.host&&g.project===h.project)&&c.push({host:h.host,project:h.project,count:0,errors:0,avgMs:null});let p=[...this.edges.values()].filter(h=>!!h.caller).map(h=>({caller:h.caller,callee:h.project,host:h.host,count:h.count,errors:h.errors,avgMs:h.avgMs,lastSeenAt:h.lastSeenAt})).sort((h,g)=>g.count-h.count),m=[...this.dataNodes.values()].filter(h=>h.kind!=="memory").map(h=>({id:h.id,kind:h.kind,name:h.name,usedBy:h.usedBy??(h.viaProject&&h.viaProject!=="unknown"?[h.viaProject]:[]),ops:h.count,lastSeenAt:h.lastSeenAt,...h.kind==="queue"&&(h.counts||h.recent)?{queue:{counts:h.counts??{},recent:(h.recent??[]).slice(0,8).map(g=>({id:String(g.id??""),...typeof g.name=="string"?{name:g.name}:{},...typeof g.state=="string"?{state:g.state}:typeof g.status=="string"?{state:g.status}:{},...typeof g.finishedOn=="number"?{at:g.finishedOn}:typeof g.timestamp=="number"?{at:g.timestamp}:{}}))}}:{}})).sort((h,g)=>g.ops-h.ops).slice(0,24),f=i.filter(h=>!h.v4||!h.v6);return{at:t,gateway:this.gatewayLiveness(t),services:d,routes:c,edges:p,backends:m,hosts:i,...f.length?{hostsFix:lb(f)}:{},trustCommand:this.trustCommand(),recent:this.recent.slice(-20).reverse()}}},sb={web:0,eager:1,lazy:2},_I="node_modules/.cache/davnx-webpack/service-keys.json";function ab(e){if(process.platform==="win32")return"";try{return xI("ps",["-p",String(e),"-o","lstart="],{encoding:"utf8",timeout:2e3,stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}s(ab,"RP"),o(ab,"processStamp");function fm(e){if(process.ppid===e)return!0;try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}s(fm,"Bk"),o(fm,"pidAlive");function ob(e,t,r,i,u=!1){let n=r?.state;if(n==="crash-looping")return{state:"crash-looping",reason:"keeps exiting right after start"};if(n==="wedged")return{state:"wedged",reason:"running but not answering"};let a=n==="up"||t?.state==="up";return r?.buildFailed&&!a?{state:"down",reason:`${u?"a process error":"build failed"} \u2014 see the error lines`}:a?r?.buildFailed?{state:"up",reason:u?"reported a process error \u2014 see the error lines":"serving its last good build \u2014 the current build failed"}:{state:"up"}:n==="starting"||t?.state==="starting"?{state:"starting",reason:e==="lazy"?"cold start in progress":"starting"}:!n&&!t&&i>0?{state:"up",reason:`${i} pod socket${i===1?"":"s"} live`}:n==="idle"||t?.idle||e==="lazy"&&(n==="down"||t?.state==="down"||!t)?{state:"idle",reason:"scaled to zero \u2014 starts on the next request"}:n==="down"||t?.state==="down"?{state:"down",reason:"not running"}:{state:"unknown",reason:"no lifecycle events seen yet"}}s(ob,"EP"),o(ob,"serviceState");function lb(e){let t=e.filter(i=>!i.v4).map(i=>i.host),r=e.filter(i=>!i.v6).map(i=>i.host);return`printf '${[...t.length?[`127.0.0.1 ${t.join(" ")}`]:[],...r.length?[`::1 ${r.join(" ")}`]:[]].join("\\n")}\\n' | sudo tee -a /etc/hosts`}s(lb,"TP"),o(lb,"hostsFixCommand");var SI=class{static{s(this,"ic")}static{o(this,"LogRing")}constructor(e=5e3){this.cap=e,this.lines=[],this.seqN=0,this.sourceSet=new Set}get seq(){return this.seqN}get size(){return this.lines.length}sources(){return[...this.sourceSet].sort()}append(e){let t=db(e,++this.seqN);return this.sourceSet.add(t.source),this.lines.push(t),this.lines.length>this.cap+Math.ceil(this.cap/10)&&this.lines.splice(0,this.lines.length-this.cap),t}since(e,t=this.cap){let r=this.indexAfter(e),i=this.lines.slice(r);return i.length>t?i.slice(i.length-t):i}recent(e){return this.lines.slice(Math.max(0,this.lines.length-e))}query(e){let t=e.limit??2e3,r=e.q?.toLowerCase(),i=e.since&&e.since>0?this.lines.slice(this.indexAfter(e.since)):this.lines,u=[];for(let n=i.length-1;n>=0&&u.length<t;n--){let a=i[n];e.flowId&&a.flowId!==e.flowId||e.from!==void 0&&a.at<e.from||e.to!==void 0&&a.at>e.to||r&&!`${a.title} ${a.message??""} ${a.source}`.toLowerCase().includes(r)||u.push(a)}return u.reverse()}indexAfter(e){let t=0,r=this.lines.length;for(;t<r;){let i=t+r>>>1;this.lines[i].seq<=e?t=i+1:r=i}return t}};function db(e,t){let r=e.raw??{},i=e.context??{},u=typeof r.project=="string"&&r.project?r.project:e.source,n=typeof i.flowId=="string"?i.flowId:typeof i.traceId=="string"?i.traceId:void 0;return{seq:t,at:e.timestamp,source:u,category:e.category,severity:e.severity,title:e.title,...e.message?{message:e.message}:{},...n?{flowId:n}:{}}}s(db,"AP"),o(db,"logLineOf");var cb=class{static{s(this,"Go")}static{o(this,"SeenIds")}constructor(e=5e4){this.cap=e,this.set=new Set,this.order=[]}firstTime(e){if(!e)return!0;if(this.set.has(e))return!1;if(this.set.add(e),this.order.push(e),this.order.length>this.cap)for(let t of this.order.splice(0,this.order.length-this.cap))this.set.delete(t);return!0}},pb=class{static{s(this,"sc")}static{o(this,"Series")}constructor(e){this.horizonSec=e,this.buckets=new Map}bucket(e){let t=this.buckets.get(e);return t||(t={sec:e,count:0,errors:0,lat:[],latReq:[]},this.buckets.set(e,t)),t}addTraffic(e,t,r){let i=this.bucket(e);i.count+=t,i.errors+=r}addLatency(e,t,r){let i=this.bucket(e),u=r?i.lat:i.latReq;u.length<256&&u.push(t)}prune(e){for(let t of this.buckets.keys())t<=e-this.horizonSec&&this.buckets.delete(t)}range(e,t){let r=[];for(let i of this.buckets.values())i.sec>e&&i.sec<=t&&r.push(i);return r}},FI=class{static{s(this,"ac")}static{o(this,"KpiWindow")}constructor(e={}){this.byProject=new Map,this.windowSec=e.windowSec??300,this.sparkBuckets=e.sparkBuckets??30,this.sparkBucketSec=e.sparkBucketSec??10,this.horizonSec=Math.max(this.windowSec,this.sparkBuckets*this.sparkBucketSec)+5,this.global=new pb(this.horizonSec)}project(e){let t=this.byProject.get(e);return t||(t=new pb(this.horizonSec),this.byProject.set(e,t)),t}observe(e){if(e.source!=="gateway")return;let t=e.raw??{},r=t.kind,i=Math.floor(e.timestamp/1e3),u=typeof t.project=="string"?t.project:"",n=typeof t.caller=="string"&&t.caller?t.caller:void 0;if(r==="gateway-traffic"){let a=hm(t.count),l=hm(t.errors);if(a===0&&l===0)return;n||this.global.addTraffic(i,a,l),u&&this.project(u).addTraffic(i,a,l);let d=Array.isArray(t.durationsMs)?t.durationsMs:[];for(let c of d){let p=Number(c);!Number.isFinite(p)||p<0||(n||this.global.addLatency(i,p,!0),u&&this.project(u).addLatency(i,p,!0))}}else if(r==="gateway-request"){let a=Number(t.durationMs);if(!Number.isFinite(a)||a<0)return;n||this.global.addLatency(i,a,!1),u&&this.project(u).addLatency(i,a,!1)}}snapshot(e=Date.now()){let t=Math.floor(e/1e3);this.global.prune(t);for(let u of this.byProject.values())u.prune(t);let r=this.global,i=ym(r,t,this.sparkBuckets,this.sparkBucketSec);return{at:e,windowSec:this.windowSec,req60:Ht(r.range(t-60,t),"count"),last:vm(r.range(t-this.windowSec,t)),sparkBucketSec:this.sparkBucketSec,spark:i}}projectStats(e,t=Date.now()){let r=this.byProject.get(e);if(!r)return;let i=Math.floor(t/1e3);return r.prune(i),{...vm(r.range(i-this.windowSec,i)),req60:Ht(r.range(i-60,i),"count"),spark:ym(r,i,this.sparkBuckets,this.sparkBucketSec).req}}};function hm(e){let t=Number(e??0);return Number.isFinite(t)&&t>0?t:0}s(hm,"Zk"),o(hm,"nonNeg");function Ht(e,t){let r=0;for(let i of e)r+=i[t];return r}s(Ht,"yn"),o(Ht,"sum");function gm(e){let t=[];for(let i of e)for(let u of i.lat)t.push(u);if(t.length)return{lat:t.sort((i,u)=>i-u),complete:!0};let r=[];for(let i of e)for(let u of i.latReq)r.push(u);return{lat:r.sort((i,u)=>i-u),complete:!1}}s(gm,"Gk"),o(gm,"latencies");function vm(e){let t=Ht(e,"count"),r=Ht(e,"errors"),{lat:i,complete:u}=gm(e),n=i.length?i.reduce((a,l)=>a+l,0)/i.length:null;return{count:t,errors:r,errorRate:t>0?r/t:null,p50:ea(i,.5),p95:ea(i,.95),avgMs:n===null?null:Math.round(n),samples:i.length,sampled:!u||i.length<t}}s(vm,"qk"),o(vm,"statsOf");function ea(e,t){if(e.length===0)return null;let r=Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1));return Math.round(e[r])}s(ea,"Rb"),o(ea,"percentile");function ym(e,t,r,i){let u=[],n=[],a=[];for(let l=r-1;l>=0;l--){let d=t-l*i,c=e.range(d-i,d);u.push(Ht(c,"count")),n.push(Ht(c,"errors")),a.push(ea(gm(c).lat,.95))}return{req:u,errors:n,p95:a}}s(ym,"Vk"),o(ym,"sparkOf");var jI=class{static{s(this,"cc")}static{o(this,"FlowIndex")}constructor(e={flows:2e3,events:5e4},t=Et){this.caps=e,this.config=t,this.revs=new Map,this.pending=new Set,this.eventFlow=new Map,this.cache=new Map,this.evidenceCache=new Map}observe(e){let t=Em(e);if(!t)return;let r=(this.revs.get(t)??0)+1;this.revs.delete(t),this.revs.set(t,r),this.revs.size>this.caps.flows&&this.revs.delete(this.revs.keys().next().value),this.pending.add(t),e.id&&(this.eventFlow.set(e.id,t),this.eventFlow.size>this.caps.events&&this.eventFlow.delete(this.eventFlow.keys().next().value))}rev(e){return this.revs.get(e)??0}drainRevs(){let e=[...this.pending].map(t=>({flowId:t,rev:this.rev(t)}));return this.pending.clear(),e}flowOfEvent(e){return this.eventFlow.get(e)}summaries(e,t=50){if(!e)return[];let r=[];for(let u of e.recentFlowIds().slice(0,t)){let n=this.rev(u),a=this.cache.get(u);if(a&&a.rev===n&&n>0){r.push(a.summary);continue}let l=e.getFlowSummary(u);if(!l)continue;let d=e.getFlowEvents(u)??[],c=e.analyzeFlow?.(u)??(d.length?ts(d,this.config):void 0),p=Eb(l,d,n,c);this.cache.set(u,{rev:n,summary:p}),r.push(p)}let i=new Set(r.map(u=>u.flowId));for(let u of this.cache.keys())i.has(u)||this.cache.delete(u);return r.sort((u,n)=>n.lastSeenAt-u.lastSeenAt)}evidence(e,t=50){let r=[];if(e){for(let i of e.recentFlowIds().slice(0,t)){let u=this.rev(i),n=this.evidenceCache.get(i);if(n&&n.rev===u&&u>0){r.push(...n.samples);continue}let a=mb(i,e.getFlowEvents(i)??[]);this.evidenceCache.set(i,{rev:u,samples:a}),r.push(...a)}if(this.evidenceCache.size>t*2){let i=new Set(e.recentFlowIds().slice(0,t));for(let u of this.evidenceCache.keys())i.has(u)||this.evidenceCache.delete(u)}}return new zI(r)}findByRoute(e,t,r){let i=ta(r);return e.find(u=>u.request&&u.request.method===t&&i.test(u.request.path))?.flowId}};function mb(e,t){let r=[],i=new Map;for(let n of t){let a=n.raw??{};if(a.kind==="server-request"&&n.id){let l=a.request??{},d=hb(n)??(typeof l.requestId=="string"?l.requestId:void 0);if(!d)continue;let c=typeof l.endedAt=="number"?l.endedAt:fb(n),p=typeof l.startedAt=="number"?l.startedAt:c-(typeof l.durationMs=="number"?l.durationMs:0);i.set(d,[...i.get(d)??[],{id:n.id,start:p,end:c}])}}let u=o((n,a)=>{let l=n?i.get(n):void 0;if(l?.length)return l.length===1?l[0].id:l.filter(d=>d.start-5<=a&&a<=d.end+5).sort((d,c)=>c.start-d.start)[0]?.id},"handlerAt");for(let n of t){if(!n.id)continue;let a=n.raw??{},l=fb(n),d=o(p=>typeof p=="number"&&Number.isFinite(p)?p:0,"num"),c=a.kind;if(c==="server-request"){let p=a.request??{};if(typeof p.route!="string")continue;r.push({key:`route:${String(p.method??"GET")} ${p.route}`,flowId:e,eventId:n.id,ms:d(p.durationMs),at:l,failed:d(p.status)>=500})}else if(c==="db-query"&&typeof a.project=="string"){let p=`${String(a.op??"query")} ${String(a.table??"")}`.trim(),m=n.title.replace(/\s*\(.*$/,"").trim();for(let f of new Set([p,m]))r.push({key:`sql:${a.project}:${f}`,flowId:e,eventId:n.id,ms:d(a.durationMs),at:l,failed:n.severity==="error"})}else if(c==="egress"&&typeof a.project=="string"&&typeof a.host=="string"){let p=typeof a.error=="string"||d(a.status)>=500||n.severity==="error";r.push({key:`egress:${a.project}:${a.host}`,flowId:e,eventId:n.id,ms:d(a.durationMs),at:l,failed:p})}else if(c==="memory-mutation"){let p=(a.mutation??{}).ownerNodeId;if(typeof p!="string")continue;r.push({key:`mem:${p}`,flowId:e,eventId:u(hb(n),l)??n.id,ms:0,at:l,failed:!1})}}return r}s(mb,"jP"),o(mb,"evidenceSamples");var fb=o(e=>typeof e.timestamp=="number"?e.timestamp:Date.parse(String(e.timestamp))||0,"tsOf"),hb=o(e=>{let t=e.context??{};return typeof t.requestId=="string"&&t.requestId?t.requestId:void 0},"requestIdOf"),zI=class{static{s(this,"Eb")}static{o(this,"EvidenceLookup")}constructor(e){this.samples=e}find(e,t,r={}){let i;for(let u of this.samples)!e(u.key)||r.inFlow!==void 0&&u.flowId!==r.inFlow||t==="failing"&&!u.failed||r.minMs!==void 0&&u.ms<r.minMs||(i?(t==="slowest"?u.ms>i.ms||u.ms===i.ms&&u.at>i.at:u.at>i.at)&&(i=u):i=u);return i?{flowId:i.flowId,nodeId:i.eventId}:void 0}};function Em(e){let t=e.context??{};return typeof t.flowId=="string"&&t.flowId?t.flowId:void 0}s(Em,"Tb"),o(Em,"flowIdOf");function ta(e){let t=e.split("/").map(r=>r.startsWith(":")?"[^/?#]+":r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("/");return new RegExp(`^${t}(?:[?#].*)?$`)}s(ta,"uc"),o(ta,"routeRegex");var NI=new Set(["memory-mutation","memory-retention","singleton-instance","subscription-added","subscription-removed","store-created","hook-run"]),MI={"user-click":"click","user-input":"input","input-change":"input",keyboard:"key press","route-load":"navigate","page-load":"page load","form-submit":"submit",effect:"effect",timer:"timer","websocket-message":"socket message","backend-response":"response","hmr-update":"hot reload","ai-turn":"AI turn"};function gb(e){return e?MI[e]??e.replace(/-/g," "):"request"}s(gb,"MP"),o(gb,"originLabelOf");function vb(e){if(!e)return;if(e.startsWith("page:"))return e.slice(5)||"/";let t=/([^/:]+\.[cm]?[jt]sx?):(\d+)/.exec(e);if(t)return`${t[1]}:${t[2]}`;let r=e.replace(/^[a-z]+:/,"");return r.length>40?"\u2026"+r.slice(-39):r}s(vb,"NP"),o(vb,"originWhereOf");function yb(e){let t=Xn.indexOf(e);return t===-1?Xn.length:t}s(yb,"PP"),o(yb,"categoryRankOf");function Eb(e,t,r,i){let u={},n=new Set,a="ok",l,d=1/0,c,p=1/0,m=1/0,f=-1/0,h=new Set,g=0,b=0,x,$=o(j=>{(j==="error"||j==="warn"&&a==="ok")&&(a=j)},"bump");for(let j of t){let N=j.raw??{},K=j.context??{},H=typeof N.kind=="string"?N.kind:void 0,ye=bd({source:j.source,category:j.category,title:j.title,kind:H});u[ye]=(u[ye]??0)+1;let Ze=typeof N.project=="string"?N.project:typeof K.projectName=="string"?K.projectName:void 0;Ze&&j.source!=="gateway"&&n.add(Ze),j.severity==="error"||j.severity==="fatal"?($("error"),b++,(!x||j.timestamp<x.at)&&(x={at:j.timestamp,title:j.title})):j.severity==="warning"&&$("warn");let Je=Number(N.status??N.request?.status);if(Number.isFinite(Je)&&(Je>=500?$("error"):Je>=400&&$("warn")),(H==="fetch-start"||H==="fetch-done"||H==="fetch-error")&&typeof N.url=="string"){let Oe=Number(N.startedAt??j.timestamp);(Oe<d||Oe===d&&l&&l.status===void 0)&&(d=Oe,l={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Je)?{status:Je}:l?.status!==void 0?{status:l.status}:{}})}if(h.size<80)if(H==="gateway-request"&&typeof N.url=="string")h.add(`${String(N.method??"GET")} ${bm(N.url)}`);else if(H==="server-request"){let Oe=N.request??{};typeof Oe.route=="string"&&h.add(`${String(Oe.method??"GET")} ${Oe.route}`)}else H==="db-query"&&Ze?h.add(`sql:${Ze}:${j.title.replace(/\s*\(.*$/,"")}`):H==="egress"&&Ze&&typeof N.host=="string"&&h.add(`egress:${Ze}:${N.host}`);if(H==="gateway-request"&&!N.caller&&j.source==="gateway"&&g++,H==="gateway-request"&&!N.caller&&typeof N.url=="string"&&j.timestamp<p&&(p=j.timestamp,c={method:String(N.method??"GET"),path:N.url,...Number.isFinite(Je)?{status:Je}:{}}),H&&NI.has(H))continue;let It=Number(N.durationMs??N.request?.durationMs??0),tt=Number(N.startedAt),$i=Number.isFinite(tt)&&tt>0?tt:j.timestamp-(Number.isFinite(It)?It:0),Uu=Number.isFinite(tt)&&tt>0&&Number.isFinite(It)?tt+It:j.timestamp;$i<m&&(m=$i),Uu>f&&(f=Uu)}!l&&c&&(l=c);let w=gb(e.originType),k=vb(e.originNodeId),C=l?`${l.method} ${bm(l.path)}`:void 0,M=e.headline&&e.headline!==e.originType?e.headline:void 0,y=!e.originType&&g>1?` +${g-1} more request${g===2?"":"s"}`:"",D=e.originType?`${w}${k?` \xB7 ${k}`:""}`:C?`${C}${y}`:M??w,A=e.originType&&C?`${D} \u2192 ${C}`:D;return{flowId:e.flowId,...e.originType?{originType:e.originType}:{},...e.originNodeId?{originNodeId:e.originNodeId}:{},startedAt:e.startedAt,lastSeenAt:e.lastSeenAt,eventCount:e.eventCount,headline:A,originLabel:w,...k?{originWhere:k}:{},...l?{request:l}:{},worst:a,durationMs:Number.isFinite(m)&&f>=m?Math.round(f-m):0,lanes:u,projects:[...n].sort(),rev:r,...g?{requestCount:g}:{},...b?{errorCount:b,firstError:wb(x.title)}:{},...h.size?{touches:[...h]}:{},...i?bb(i):{}}}s(Eb,"DP"),o(Eb,"summarizeFlow");function bb(e){let t=e.classification,r=e.segmentation.stats;return{category:t.category,categoryRank:yb(t.category),decidedBy:t.decidedBy,...t.subject?{subject:t.subject}:{},tags:t.tags,segmentCount:r.segments,phaseCount:r.phases,signalCount:r.signal}}s(bb,"CP"),o(bb,"analysisFields");function wb(e){return e.replace(/\s*✗\s*$/,"").replace(/\s*\((?:\d+ rows?, )?[\d.]+ ?ms\)$/,"")}s(wb,"UP"),o(wb,"cleanTitle");function bm(e){let t=e.indexOf("?");return t>=0?e.slice(0,t):e}s(bm,"Kk"),o(bm,"stripQuery");function wm(e,t){return{id:e.id,kind:e.kind,label:e.label,phase:e.phase,start:e.start,end:e.end,durationMs:e.durationMs,counts:e.counts,projects:e.projects,...e.method?{method:e.method}:{},...e.route?{route:e.route}:{},...e.requestId?{requestId:e.requestId}:{},...e.after?{after:e.after}:{},...e.hot?{hot:e.hot}:{},...e.part?{part:e.part}:{},worstSeverity:e.worstSeverity,category:t}}s(wm,"Xk"),o(wm,"toDashSegment");function Db(e,t,r){if(!e)return{flowId:t,summary:null,events:[],rev:r.rev};let i=e.getFlowSummary(t)??null,u=e.getFlowEvents(t)??[],n=e.analyzeFlow?.(t)??(u.length?ts(u,r.config??Et):void 0),a,l=u;if(r.segmentId!==void 0){a=n?.segmentation.segments.find(g=>g.id===r.segmentId);let h=new Set(a?.eventIds??[]);l=u.filter(g=>h.has(g.id))}let d=Hn(l,{includeRaw:r.includeRaw===!0}),c={flowId:t,summary:i,...d,rev:r.rev};if(!n)return c;let p=n.segmentation.assignment;c.events=c.events.map(h=>{let g=p[h.id]??(h.memberIds?.[0]?p[h.memberIds[0]]:void 0);return g?{...h,segmentId:g}:h});let m=o(h=>n.segmentCategories[h.id]??"other","category");c.segments=n.segmentation.segments.map(h=>wm(h,m(h))),c.phases=n.segmentation.phases,c.segmentCategories=n.segmentCategories,c.segmentStats=n.segmentation.stats;let f=n.classification;return c.classification={category:f.category,decidedBy:f.decidedBy,...f.ruleIndex!==void 0?{ruleIndex:f.ruleIndex}:{},...f.subject?{subject:f.subject}:{},tags:f.tags,origin:f.origin},a&&(c.focus=wm(a,m(a))),c}s(Db,"Hk"),o(Db,"flowDetailPayload");var OI=300,RI=1e3,$b=20,Bb=30,TI=1500,we=o(e=>e&&typeof e=="object"?e:{},"obj"),P=o(e=>typeof e=="string"&&e?e:void 0,"str"),ve=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num"),PI=class{static{s(this,"pc")}static{o(this,"ErrorLog")}constructor(e=Date.now){this.now=e,this.groups=new Map,this.pending=[],this.byRequest=new Map,this.projectOfRequest=new Map,this.seen=new Set,this.dismissals=new Map,this.changed=!1}observe(e){if(e.id){if(this.seen.has(e.id))return!1;this.seen.add(e.id),this.seen.size>2e4&&this.seen.delete(this.seen.values().next().value)}let t=yd(e);if(t)return this.dismissals.delete(t.groupId),t.kind===wu&&(this.dismissals.set(t.groupId,{until:t.until,at:e.timestamp,eventIds:new Set(t.eventIds),...t.by?{by:t.by}:{},...t.reason?{reason:t.reason}:{}}),this.dismissals.size>RI&&this.dismissals.delete(this.dismissals.keys().next().value)),this.changed=!0,!0;let r=we(e.raw),i=we(e.context),u=P(r.kind),n=P(i.requestId);u==="gateway-request"&&n&&P(r.project)&&(this.projectOfRequest.set(n,P(r.project)),this.projectOfRequest.size>5e3&&this.projectOfRequest.delete(this.projectOfRequest.keys().next().value));let a=e.severity==="error"||e.severity==="fatal",l=we(r.request),d=ve(r.status)??ve(l.status);return u==="server-request"&&(a||(d??0)>=500)?this.defer(e,"server"):e.source==="client-runtime"&&a&&(u==="error"||u==="unhandledrejection"||u==="resource-error"||u==="console")?this.browser(e,r,i):u==="egress"&&(P(r.error)||(d??0)>=500)?this.external(e,r,i,d):u==="queue-failed"?this.queue(e,r,i):u==="span"&&a?this.defer(e,"span"):u==="gateway-request"&&((d??0)>=500||d===0)?this.defer(e,"gateway"):u==="fetch-done"&&(d??0)>=500||u==="fetch-error"?this.defer(e,"fetch"):u==="log"&&a&&(e.source==="nestjs"||e.source==="nest")?this.defer(e,"log"):!1}flush(e=!1){let t=this.now(),r=o(a=>e||t-a.arrivedAt>=TI,"ready"),i=o(a=>P(we(a.event.context).requestId),"requestOf");for(let a of this.pending.filter(l=>l.kind==="server"&&r(l))){this.pending.splice(this.pending.indexOf(a),1);let l=we(a.event.raw);this.server(a.event,l,we(l.request),we(a.event.context))}let u=new Set(this.pending.filter(a=>a.kind==="server").map(i).filter(Boolean));for(let a of this.pending.filter(l=>l.kind!=="server"&&r(l)&&!(i(l)&&u.has(i(l)))))this.pending.splice(this.pending.indexOf(a),1),this.settle(a);let n=this.changed;return this.changed=!1,n}snapshot(e=[],t=15*6e4){let r=this.now(),i=Math.floor(r/6e4),u=[...this.groups.values()].map(c=>{let p=[];for(let b=i-Bb+1;b<=i;b++)p.push(c.perMinute.get(b)??0);let{flows:m,perMinute:f,eventIds:h,...g}=c;return{...g,occurrences:[...g.occurrences],flowCount:m.size,spark:p}}),n=this.hiddenEvents(),a=[],l=[];for(let c of[...e,...u].sort((p,m)=>+!!m.ongoing-+!!p.ongoing||m.lastSeenAt-p.lastSeenAt)){let p=this.dismissalOf(c,n);p?l.push({...c,dismissedAt:p.at,...p.by?{dismissedBy:p.by}:{},...p.reason?{dismissedReason:p.reason}:{}}):a.push(c)}let d=a.filter(c=>c.ongoing||r-c.lastSeenAt<=t);return{at:r,recentMs:t,groups:a,recentGroups:d.length,recentOccurrences:d.reduce((c,p)=>c+(p.ongoing?1:p.occurrences.filter(m=>r-m.at<=t).length),0),dismissed:l}}hiddenEvents(){let e=new Map;for(let t of this.dismissals.values())for(let r of t.eventIds)(e.get(r)?.at??-1)<=t.at&&e.set(r,t);return e}dismissalOf(e,t){let r=this.dismissals.get(e.id);if(r&&e.lastSeenAt<=r.until)return r;let i=this.groups.get(e.id)?.eventIds,u=i?.[i.length-1];return u===void 0?void 0:t.get(u)}dismissalsFor(e,t=[],r=this.now()){let i=[];for(let u of new Set(e)){let n=this.groups.get(u),a=n??t.find(l=>l.id===u);a&&i.push({groupId:u,until:Math.max(r,a.lastSeenAt),eventIds:n?n.eventIds.slice():[],by:"dashboard",title:a.title})}return i}restorable(e){let t=new Set;for(let r of new Set(e)){this.dismissals.has(r)&&t.add(r);let i=this.groups.get(r)?.eventIds??[];for(let[u,n]of this.dismissals)i.some(a=>n.eventIds.has(a))&&t.add(u)}return[...t]}server(e,t,r,i){let u=P(i.requestId)??P(r.requestId),n=P(i.projectName)??P(t.project)??(u?this.projectOfRequest.get(u):void 0),a=P(r.method)??"GET",l=P(r.route)??"?",d=ve(r.status)??ve(t.status),c=we(r.error),p=P(c.message)??P(e.message),m=P(c.name),f=`${a} ${l}${d?` \u2192 ${d}`:""}`,h=`server:${n??"?"}:${a} ${l}:${d??""}:${m??""}:${Xt(p)}`,g=this.record(h,"server",e,{title:f,...n?{where:n,project:n}:{},...p?{message:p}:{},...P(c.stack)?{stack:hi(P(c.stack))}:{},...d!==void 0?{status:d}:{}},u,d);return u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g}),this.trimRequests(),!0}browser(e,t,r){let i=P(t.message)??e.title,u=P(r.url)??P(r.route),n=`browser:${P(t.kind)}:${Xt(i)}`;return this.record(n,"browser",e,{title:i.split(`
|
|
78
|
+
`)[0].slice(0,160),...u?{where:xb(u)}:{},message:i,...P(t.stack)?{stack:hi(P(t.stack))}:{}},P(r.requestId)),!0}external(e,t,r,i){let u=P(t.project)??P(r.projectName),n=P(t.host)??"?",a=P(t.method)??"GET",l=P(t.path)??"",d=P(t.error),c=i?String(i):d??"failed",p=`external:${u??"?"}:${n}:${a} ${Nu(l)}:${i??Xt(d)}`;return this.record(p,"external",e,{title:`${a} ${n}${Nu(l)} \u2192 ${c}`,where:`${u??"?"} \u2192 ${n}`,...u?{project:u}:{},...d?{message:d}:{},...i?{status:i}:{}},P(r.requestId),i),!0}queue(e,t,r){let i=P(t.queue)??"?",u=P(t.failedReason)??P(t.error)??e.message,n=P(t.project)??P(r.projectName),a=`queue:${i}:${P(t.name)??""}:${Xt(u)}`;return this.record(a,"queue",e,{title:`Job ${P(t.name)??""} failed on ${i}`.replace(/\s+/g," "),where:n?`${n} \xB7 ${i}`:i,...n?{project:n}:{},...u?{message:u}:{},...P(t.stack)?{stack:hi(P(t.stack))}:{}},P(r.requestId)),!0}defer(e,t){return this.pending.push({event:e,kind:t,arrivedAt:this.now()}),this.pending.length>2e3&&this.pending.splice(0,this.pending.length-2e3),!1}settle(e){let t=e.event,r=we(t.raw),i=we(t.context),u=P(i.requestId),n=u?this.byRequest.get(u):void 0;if(n){e.kind==="span"&&!n.occ.stepId&&(n.occ.stepId=t.id),!n.occ.flowId&&P(i.flowId)&&(n.occ.flowId=P(i.flowId)),this.changed=!0;return}if(e.kind==="log"){let b=P(r.project)??P(i.projectName);if([...this.groups.values()].some(w=>w.kind==="server"&&(w.project===b||!w.project)&&Math.abs(w.lastSeenAt-t.timestamp)<3e3))return;let x=we(we(r.request).error),$=Bm(P(x.message)??t.title);this.record(`log:${b??"?"}:${Xt($)}`,"log",t,{title:$.split(`
|
|
79
|
+
`)[0].slice(0,160),...b?{where:b,project:b}:{},message:$,...P(x.stack)?{stack:hi(Bm(P(x.stack)))}:{}},u);return}if(e.kind==="span"){let b=we(r.span),x=P(b.name)??t.title.replace(/\s*\(\d+ms\)\s*✗?$/,""),$=P(i.projectName)??(u?this.projectOfRequest.get(u):void 0),w=P(t.message)??P(we(b.error).message),k=this.record(`exception:${$??"?"}:${x}:${Xt(w)}`,"exception",t,{title:`${x} threw${w?`: ${w.split(`
|
|
80
|
+
`)[0].slice(0,100)}`:""}`,...$?{where:$,project:$}:{},...w?{message:w}:{}},u);u&&this.byRequest.set(u,{group:[...this.groups.values()].find(C=>C.occurrences.includes(k)),occ:k});return}let a=ve(r.status),l=P(r.method)??"GET",d=P(r.url)??"?",c=P(r.project),p=P(r.host),m=e.kind==="fetch"&&!a?"network error":String(a??"failed"),f=e.kind==="gateway"?`${l} ${p??""}${Nu(d)} \u2192 ${m}`:`${l} ${Nu(d)} \u2192 ${m}`,h=`request:${e.kind}:${c??p??""}:${l} ${Nu(d)}:${m}`,g=this.record(h,"request",t,{title:f,where:e.kind==="gateway"?`gateway \u2192 ${c??p??"?"}`:"browser",...c?{project:c}:{},...a!==void 0?{status:a}:{},...e.kind==="gateway"?{message:Cb(r,a)}:{}},u,a);u&&this.byRequest.set(u,{group:this.groups.get(h),occ:g})}record(e,t,r,i,u,n){let a=we(r.context),l=P(a.flowId),d=this.groups.get(e);d||(d={id:e,kind:t,...i,count:0,firstSeenAt:r.timestamp,lastSeenAt:r.timestamp,occurrences:[],flows:new Set,perMinute:new Map,eventIds:[]},this.groups.set(e,d),this.evict()),d.count+=1,d.eventIds.push(r.id),d.eventIds.length>200&&d.eventIds.shift(),d.firstSeenAt=Math.min(d.firstSeenAt,r.timestamp),r.timestamp>=d.lastSeenAt&&(d.lastSeenAt=r.timestamp,i.stack&&(d.stack=i.stack),i.message&&(d.message=i.message)),l&&d.flows.add(l);let c=Math.floor(r.timestamp/6e4);d.perMinute.set(c,(d.perMinute.get(c)??0)+1);for(let m of d.perMinute.keys())m<c-Bb&&d.perMinute.delete(m);let p={id:r.id,at:r.timestamp,...l?{flowId:l}:{},...u?{requestId:u}:{},...n!==void 0?{status:n}:{}};return d.occurrences.unshift(p),d.occurrences.sort((m,f)=>f.at-m.at),d.occurrences.length>$b&&(d.occurrences.length=$b),this.changed=!0,p}evict(){if(this.groups.size<=OI)return;let e=[...this.groups.values()].sort((t,r)=>t.lastSeenAt-r.lastSeenAt)[0];e&&this.groups.delete(e.id)}trimRequests(){this.byRequest.size>5e3&&this.byRequest.delete(this.byRequest.keys().next().value)}};function Dm(e,t,r){if(t==="crash-looping")return{kind:"service",title:`${e} keeps crashing`,serving:!1};if(t==="wedged")return{kind:"service",title:`${e} is not answering`,serving:!1};let i=r.length>0&&r.every(n=>n.fault==="process"),u=t==="up";return{kind:u?i?"log":"build":"service",title:i?`${e} reported a process error`:`${e} failed to build`,serving:u}}s(Dm,"Ab"),o(Dm,"describeServiceFault");function $m(e,t=Date.now()){let r=[],i=o((c,p=!0)=>({...c,count:c.count??1,firstSeenAt:c.at??t,lastSeenAt:c.at??t,occurrences:[],flowCount:0,spark:[],...p?{ongoing:!0}:{}}),"base"),u=o(c=>{let p=new Map;for(let m of ua(we(e[c]).errors))p.set(P(m.project)??"workspace",[...p.get(P(m.project)??"workspace")??[],m]);return p},"grouped"),n=u("typecheck://errors"),a=u("lint://errors");for(let c of ua(we(e["build://failures"]).failures)){let p=c.domain==="typecheck"||c.domain==="lint"?c.domain:"build",m=P(c.project)??"workspace";p==="typecheck"&&n.has(m)||p==="lint"&&a.has(m)||r.push(i({id:`build:${P(c.fingerprint)??P(c.message)??"?"}`,kind:p,title:`${p==="typecheck"?"Type error":p==="lint"?"Lint error":"Build error"}${P(c.project)?` in ${P(c.project)}`:""}`,...P(c.file)?{where:P(c.file)}:{},...P(c.project)?{project:P(c.project)}:{},...P(c.message)?{message:P(c.message)}:{},resource:"build://failures",...ve(c.timestamp)!==void 0?{at:ve(c.timestamp)}:{}}))}for(let[c,p]of n){let m=p[0];r.push(i({id:`typecheck:${c}`,kind:"typecheck",title:`${p.length} type error${p.length===1?"":"s"} in ${c}`,where:[P(m.file),ve(m.line)].filter(f=>f!==void 0).join(":")||c,project:c,message:p.slice(0,5).map(f=>`${P(f.file)??""}${ve(f.line)!==void 0?`:${ve(f.line)}`:""} ${P(f.code)??""} ${P(f.message)??""}`.trim()).join(`
|
|
81
81
|
`),count:p.length,resource:"typecheck://errors",at:Math.max(...p.map(f=>ve(f.timestamp)??0))||t}))}for(let[c,p]of a){let m=p[0]??{};r.push(i({id:`lint:${c}`,kind:"lint",title:`${p.length} lint error${p.length===1?"":"s"} in ${c}`,where:[P(m.file),ve(m.line)].filter(f=>f!==void 0).join(":")||c,project:c,message:p.slice(0,5).map(f=>`${P(f.file)??""}${ve(f.line)!==void 0?`:${ve(f.line)}`:""} ${P(f.rule)??""} ${P(f.message)??""}`.trim()).join(`
|
|
82
82
|
`),count:p.length,resource:"lint://errors",at:Math.max(...p.map(f=>ve(f.timestamp)??0))||t},!1))}let l=we(e["process://cluster"]),d=ua(l.errors);for(let c of ua(l.services)){let p=P(c.state),m=P(c.project)??"?",f=d.filter($=>$.project===m),h=o($=>$.map(w=>P(w.line)).filter(Boolean),"text");if(c.typeErrors===!0&&!n.has(m)){let $=h(f.filter(w=>w.fault==="types"));r.push(i({id:`typecheck:${m}`,kind:"typecheck",title:`Type errors in ${m}`,where:m,project:m,...$.length?{message:$.slice(-6).join(`
|
|
83
|
-
`)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}if(p!=="crash-looping"&&p!=="wedged"&&c.buildFailed!==!0)continue;let g=f.filter($=>$.fault!=="types"),b=h(g),x=
|
|
84
|
-
`)}:P(c.lastTitle)?{message:P(c.lastTitle)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}return r}s(
|
|
85
|
-
`)[0].replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,"<id>").replace(/\b[0-9A-HJKMNP-TV-Z]{26}\b/g,"<id>").replace(/0x[0-9a-f]+/gi,"<hex>").replace(/\d+/g,"#").slice(0,140):""}s(Xt,"bn"),o(Xt,"norm");function Nu(e){let t=(e.split("?")[0]??e).split("/");return t.map((r,i)=>{let u=t[i-1]??"";return/^\d+$/.test(r)&&!(/^(?:api|v)$/i.test(u)&&r.length<=2)||/^[0-9a-f]{16,}$/i.test(r)||/^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(r)?":id":r}).join("/")}s(Nu,"Jo"),o(Nu,"routeShape");function
|
|
83
|
+
`)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}if(p!=="crash-looping"&&p!=="wedged"&&c.buildFailed!==!0)continue;let g=f.filter($=>$.fault!=="types"),b=h(g),x=Dm(m,p,g);r.push(i({id:`service:${m}:${p}`,kind:x.kind,title:x.title,where:x.serving?`${m} \u2014 still serving its last good build`:m,project:m,...b.length?{message:b.slice(-6).join(`
|
|
84
|
+
`)}:P(c.lastTitle)?{message:P(c.lastTitle)}:{},resource:"process://cluster",...ve(c.lastSeenAt)!==void 0?{at:ve(c.lastSeenAt)}:{}}))}return r}s($m,"jb"),o($m,"standingErrors");var ua=o(e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[],"arr");function Xt(e){return e?e.split(`
|
|
85
|
+
`)[0].replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,"<id>").replace(/\b[0-9A-HJKMNP-TV-Z]{26}\b/g,"<id>").replace(/0x[0-9a-f]+/gi,"<hex>").replace(/\d+/g,"#").slice(0,140):""}s(Xt,"bn"),o(Xt,"norm");function Nu(e){let t=(e.split("?")[0]??e).split("/");return t.map((r,i)=>{let u=t[i-1]??"";return/^\d+$/.test(r)&&!(/^(?:api|v)$/i.test(u)&&r.length<=2)||/^[0-9a-f]{16,}$/i.test(r)||/^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(r)?":id":r}).join("/")}s(Nu,"Jo"),o(Nu,"routeShape");function xb(e){try{return new URL(e).pathname}catch{return e}}s(xb,"ZP"),o(xb,"pagePath");function hi(e){let t=e.split(`
|
|
86
86
|
`),r=t[0]??"",i=t.slice(1).filter(a=>/^\s*at /.test(a)),u=i.filter(a=>!/node_modules|node:internal|node:async_hooks|\(native\)|<anonymous>/.test(a)),n=(u.length?u:i).slice(0,8);return[r,...n].join(`
|
|
87
|
-
`)}s(hi,"dc"),o(hi,"appFrames");function
|
|
88
|
-
${z(j.lastError)}`:R(j.lastStatus)?` \u2192 ${R(j.lastStatus)}`:""}`}:{},count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"failing")??e.evidence?.find(H=>H===N,"latest"),n(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)}):y.slow===!0&&r.push({id:`net:slow:${A}:${D}`,kind:"egress-slow",severity:"medium",title:`${D} is slow`,where:`${A} \u2192 ${D}`,detail:`p95 ${Ue(R(y.p95Ms)??0)} \xB7 max ${Ue(R(y.maxMs)??0)} over ${R(y.count)??0} calls`,count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"slowest"),n(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["build://failures"]).failures)){let D=z(y.file);r.push({id:`build:${z(y.fingerprint)??z(y.message)??D??"?"}`,kind:"build",severity:"high",title:`Build error${z(y.project)?` in ${z(y.project)}`:""}`,...D?{where:D}:{},...z(y.message)?{detail:z(y.message)}:{},resource:"build://failures",at:R(y.timestamp)})}let $=ce(oe(t["typecheck://errors"]).errors),w=new Map;for(let y of $){let D=z(y.project)??"workspace";w.set(D,[...w.get(D)??[],y])}for(let[y,D]of w){let A=D[0];r.push({id:`typecheck:${y}`,kind:"typecheck",severity:"high",title:`${D.length} type error${D.length===1?"":"s"} in ${y}`,where:[z(A.file),R(A.line)].filter(j=>j!==void 0).join(":")||void 0,detail:`${z(A.code)?z(A.code)+": ":""}${z(A.message)??""}`,count:D.length,resource:"typecheck://errors",at:Math.max(...D.map(j=>R(j.timestamp)??0))})}let k=oe(t["process://cluster"]),C=ce(k.errors);for(let y of ce(k.services)){let D=z(y.state),A=z(y.project)??"?";if(D!=="crash-looping"&&D!=="wedged"&&y.buildFailed!==!0)continue;let j=C.filter(H=>H.project===A&&H.fault!=="types"),N=j.map(H=>z(H.line)).filter(Boolean),K=
|
|
87
|
+
`)}s(hi,"dc"),o(hi,"appFrames");function Bm(e){return e.replace(/^\[Nest\]\s+\d+\s+-\s+[^A-Z]*?\s+(?:ERROR|WARN)\s+(?:\[[^\]]+\]\s+)?/,"")}s(Bm,"eS"),o(Bm,"stripNestPrefix");function Cb(e,t){let r=Array.isArray(e.steps)?e.steps:[],i=r[r.length-1],u=i?P(i.step):void 0;return t===503?`the gateway answered 503${u?` after "${u}"`:""} \u2014 the service did not become ready (cold start or crash)`:t===502?"the gateway could not reach the service (502)":t===504?"the service did not answer in time (504)":`the gateway answered ${t??"with a failure"}${u?` after "${u}"`:""}`}s(Cb,"qP"),o(Cb,"gatewayReason");var kb=["graph://patterns","perf://slow-routes","perf://duplicate-requests","db://slow-queries","db://analysis","memory://leaks/suspected","memory://owners/growing","memory://current","react://components/hot","runtime://errors","runtime://browser/errors","trace://failed","net://egress/hosts","typecheck://current","typecheck://errors","build://current","build://failures","lint://current","process://cluster","visual://violations/current","perf://rules"],oe=o(e=>e&&typeof e=="object"?e:{},"obj"),ce=o(e=>Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[],"arr"),z=o(e=>typeof e=="string"&&e?e:void 0,"str"),R=o(e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,"num");function Ab(e){let t=e.resources,r=[],i=o(y=>{for(let D of y){let A=e.flowOfEvent(D);if(A)return{flowId:A,nodeId:D,eventIds:y.slice(0,50)}}return y.length?{eventIds:y.slice(0,50)}:void 0},"evidenceOf"),u=o((y,D)=>{let A=ta(D),j=o(N=>N.startsWith(`${y} `)&&A.test(N.slice(y.length+1)),"hit");return e.flows.find(N=>N.request&&N.request.method===y&&A.test(N.request.path)||N.touches?.some(j))?.flowId},"flowForRoute"),n=o(y=>e.flows.find(D=>D.touches?.includes(y))?.flowId,"flowTouching"),a=o((y,D)=>y?{flowId:y.flowId,nodeId:y.nodeId}:D?{flowId:D}:void 0,"at"),l=o((y,D)=>{let A=ta(D),j=`route:${y} `;return N=>N.startsWith(j)&&(N.slice(j.length)===D||A.test(N.slice(j.length)))},"routeKey");for(let y of ce(oe(t["graph://patterns"]).patterns)){let D=z(y.kind),A=oe(y.details),j=(Array.isArray(y.evidence)?y.evidence:[]).filter(ye=>typeof ye=="string"),N=z(y.title)??D??"pattern",K=D==="n+1-query"?"n-plus-one":D==="db-in-loop"?"db-in-loop":D==="render-storm"?"render-storm":D==="slow-path"?"slow-path":D==="leak"?"leak":"other",H=z(A.signature)??z(A.componentInstanceId)??N;r.push({id:`graph:${D}:${H}`,kind:K,severity:y.severity==="error"?"high":"medium",title:N,...z(A.signature)?{code:z(A.signature)}:{},...K==="render-storm"&&z(A.componentInstanceId)?{where:xm(z(A.componentInstanceId))}:{},detail:Ob(K,A),...R(A.count)!==void 0?{count:R(A.count)}:R(A.dbCallsInsideLoop)!==void 0?{count:R(A.dbCallsInsideLoop)}:{},evidence:i(j),resource:"graph://patterns",at:R(y.detectedAt)})}let d=oe(t["perf://slow-routes"]),c=R(d.thresholdMs)??500;for(let y of ce(d.routes)){let D=z(y.method)??"GET",A=z(y.route)??"?",j=R(y.worstRecentMs)??0,N=a(e.evidence?.find(l(D,A),"latest",{minMs:c})??e.evidence?.find(l(D,A),"slowest"),u(D,A));r.push({id:`perf:slow-route:${D} ${A}`,kind:"slow-route",severity:j>=c*3?"high":"medium",title:`${D} ${A} is slow`,where:`${D} ${A}`,detail:`worst ${Ue(j)} recently \u2014 ${R(y.recentSlowSamples)??0} of the last ${Math.min(R(y.samples)??0,R(d.recentSampleWindow)??20)} calls over the ${Ue(c)} budget (last call ${Ue(R(y.lastDurationMs)??0)})`,count:R(y.slowSamples),...N?{evidence:N}:{},resource:"perf://slow-routes",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["perf://duplicate-requests"]).endpoints)){let D=z(y.method)??"GET",A=z(y.url)??"?";r.push({id:`perf:dup:${D} ${A}`,kind:"duplicate-requests",severity:"medium",title:`${D} ${A} fired ${R(y.peakConcurrent)??"?"}\xD7 at once`,where:`${D} ${A}`,detail:`${R(y.peakConcurrent)??"?"} identical requests in flight together \u2014 the browser asked for the same thing repeatedly`,count:R(y.totalRequests),resource:"perf://duplicate-requests",at:R(y.lastSeenAt)})}let p=oe(t["db://slow-queries"]),m=R(p.thresholdMs)??100;for(let y of ce(p.queries)){let D=R(y.p95Ms)??0,A=R(y.maxMs)??0,j=`${z(y.op)??"query"} ${z(y.table)??""}`.trim();r.push({id:`db:slow:${z(y.project)??"?"}:${j}`,kind:"slow-query",severity:D>=m*5?"high":D>=m?"medium":"low",title:D>=m?`Slow query: ${j}`:`Occasionally slow query: ${j}`,where:`${z(y.project)??"?"} \xB7 ${j}`,detail:`p95 ${Ue(D)} \xB7 max ${Ue(A)} \xB7 avg ${Ue(R(y.avgMs)??0)} over ${R(y.count)??0} runs (budget ${Ue(m)})`,...z(y.lastSql)?{code:z(y.lastSql)}:{},count:R(y.count),...(()=>{let N=`sql:${z(y.project)??"?"}:${j}`,K=a(e.evidence?.find(H=>H===N,"latest",{minMs:m})??e.evidence?.find(H=>H===N,"slowest"),n(N));return K?{evidence:K}:{}})(),resource:"db://slow-queries",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["db://analysis"]).runs))for(let D of ce(y.findings)){let A=z(D.kind)??"finding";r.push({id:`db:analysis:${z(y.project)??"?"}:${A}:${z(D.table)??""}`,kind:A==="missing-index"?"missing-index":"slow-query",severity:D.severity==="error"?"high":D.severity==="info"?"low":"medium",title:`${A.replace(/-/g," ")} on ${z(D.table)??"a table"}`,where:`${z(y.project)??"?"} \xB7 ${z(D.table)??""}`,...z(D.detail)?{detail:z(D.detail)}:{},resource:"db://analysis",at:R(y.runAt)})}let f=new Map;for(let y of ce(oe(t["memory://leaks/suspected"]).suspected)){let D=z(y.ownerId)??"?",A=f.get(D);(!A||(R(y.at)??0)>=(R(A.at)??0))&&f.set(D,y)}for(let y of f.values()){let D=z(y.ownerId)??"?",A=oe(y.detail),j=z(y.flowId),N=a(j?e.evidence?.find(K=>K===`mem:${D}`,"latest",{inFlow:j}):void 0,j);r.push({id:`memory:leak:${Cm(D)}`,kind:"leak",severity:"high",title:`Suspected leak: ${Cm(D)}`,where:D,detail:`grew by ${R(A.growth)??"?"} (${R(A.startCount)??"?"} \u2192 ${R(A.endCount)??"?"}) during one flow and did not shrink`,...N?{evidence:N}:{},resource:"memory://leaks/suspected",at:R(y.at)})}let h=new Map;for(let y of ce(oe(t["runtime://errors"]).entries)){let D=z(y.fingerprint)??z(y.title)??"?",A=h.get(D),j=!A||(R(y.timestamp)??0)>(R(A.e.timestamp)??0),N=j?z(y.stack)??A?.stack:A?.stack??z(y.stack);h.set(D,{e:j?y:A.e,n:(A?.n??0)+1,...N?{stack:N}:{}})}let g=new Set;for(let[y,{e:D,n:A,stack:j}]of h){let N=z(D.id),K=z(D.requestId);K&&g.add(K),r.push({id:`runtime:server:${y}`,kind:"server-error",severity:"high",title:z(D.title)??"Server error",where:[z(D.source),z(D.route)].filter(Boolean).join(" \xB7 ")||void 0,...z(D.message)?{detail:z(D.message)}:{},...j?{code:km(j)}:{},count:A,evidence:i(N?[N]:[]),resource:"runtime://errors",at:R(D.timestamp)})}let b=new Map;for(let y of ce(oe(t["runtime://browser/errors"]).entries)){let D=z(y.fingerprint)??z(y.title)??z(y.message)??"?",A=b.get(D);b.set(D,{e:A&&(R(A.e.timestamp)??0)>(R(y.timestamp)??0)?A.e:y,n:(A?.n??0)+1})}for(let[y,{e:D,n:A}]of b){let j=z(D.id);r.push({id:`runtime:browser:${y}`,kind:"browser-error",severity:"high",title:z(D.title)??z(D.message)??"Browser error",...z(D.url)?{where:z(D.url)}:{},...z(D.message)&&z(D.message)!==z(D.title)?{detail:z(D.message)}:{},...z(D.stack)?{code:km(z(D.stack))}:{},count:A,evidence:i(j?[j]:[]),resource:"runtime://browser/errors",at:R(D.timestamp)})}let x=new Map;for(let y of ce(oe(t["trace://failed"]).spans)){let D=z(y.name)??"?";if(D.startsWith("nest.request ")||z(y.requestId)&&g.has(z(y.requestId)))continue;let A=x.get(D);x.set(D,{s:A&&(R(A.s.startTime)??0)>(R(y.startTime)??0)?A.s:y,n:(A?.n??0)+1})}for(let[y,{s:D,n:A}]of x){let j=z(D.id);r.push({id:`trace:failed:${y}`,kind:"failed-span",severity:"medium",title:`${y} failed`,where:y,count:A,evidence:i(j?[j]:[])??(z(D.flowId)?{flowId:z(D.flowId)}:void 0),resource:"trace://failed",at:R(D.startTime)})}for(let y of ce(oe(t["net://egress/hosts"]).hosts)){let D=z(y.host)??"?",A=z(y.project)??"?",j=ce(y.endpoints).find(N=>(R(N.errorCount)??0)+(R(N.status5xx)??0)>0);y.failing===!0?r.push({id:`net:failing:${A}:${D}`,kind:"egress-failing",severity:"high",title:`Calls to ${D} are failing`,where:`${A} \u2192 ${D}`,detail:z(y.detail)??`${R(y.errorCount)??0} errors, ${R(y.status5xx)??0}\xD7 5xx`,...j?{code:`${z(j.method)??"GET"} ${D}${z(j.path)??""}${z(j.lastError)?`
|
|
88
|
+
${z(j.lastError)}`:R(j.lastStatus)?` \u2192 ${R(j.lastStatus)}`:""}`}:{},count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"failing")??e.evidence?.find(H=>H===N,"latest"),n(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)}):y.slow===!0&&r.push({id:`net:slow:${A}:${D}`,kind:"egress-slow",severity:"medium",title:`${D} is slow`,where:`${A} \u2192 ${D}`,detail:`p95 ${Ue(R(y.p95Ms)??0)} \xB7 max ${Ue(R(y.maxMs)??0)} over ${R(y.count)??0} calls`,count:R(y.count),...(()=>{let N=`egress:${A}:${D}`,K=a(e.evidence?.find(H=>H===N,"slowest"),n(N));return K?{evidence:K}:{}})(),resource:"net://egress/hosts",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["build://failures"]).failures)){let D=z(y.file);r.push({id:`build:${z(y.fingerprint)??z(y.message)??D??"?"}`,kind:"build",severity:"high",title:`Build error${z(y.project)?` in ${z(y.project)}`:""}`,...D?{where:D}:{},...z(y.message)?{detail:z(y.message)}:{},resource:"build://failures",at:R(y.timestamp)})}let $=ce(oe(t["typecheck://errors"]).errors),w=new Map;for(let y of $){let D=z(y.project)??"workspace";w.set(D,[...w.get(D)??[],y])}for(let[y,D]of w){let A=D[0];r.push({id:`typecheck:${y}`,kind:"typecheck",severity:"high",title:`${D.length} type error${D.length===1?"":"s"} in ${y}`,where:[z(A.file),R(A.line)].filter(j=>j!==void 0).join(":")||void 0,detail:`${z(A.code)?z(A.code)+": ":""}${z(A.message)??""}`,count:D.length,resource:"typecheck://errors",at:Math.max(...D.map(j=>R(j.timestamp)??0))})}let k=oe(t["process://cluster"]),C=ce(k.errors);for(let y of ce(k.services)){let D=z(y.state),A=z(y.project)??"?";if(D!=="crash-looping"&&D!=="wedged"&&y.buildFailed!==!0)continue;let j=C.filter(H=>H.project===A&&H.fault!=="types"),N=j.map(H=>z(H.line)).filter(Boolean),K=Dm(A,D,j);r.push({id:`service:${A}:${D}`,kind:"service",severity:"high",title:K.title,where:K.serving?`${A} \u2014 still serving its last good build`:A,...z(y.lastTitle)?{detail:z(y.lastTitle)}:{},...N.length?{code:N.slice(-6).join(`
|
|
89
89
|
`)}:{},count:R(y.restarts),resource:"process://cluster",at:R(y.lastSeenAt)})}for(let y of ce(oe(t["perf://rules"]).findings)){let D=z(y.rule)??"perf",A=z(y.project)??"?",j=z(y.subject)??"?",N=(Array.isArray(y.fix)?y.fix:[]).filter(ye=>typeof ye=="string"),K=oe(y.cost),H=oe(y.evidence);r.push({id:`perf-rule:${D}:${A}:${j}`,kind:"perf-rule",severity:y.severity==="error"?"high":"medium",title:z(y.title)??D,where:`${D} \xB7 ${A}${j!==A?` \xB7 ${j}`:""}`,...z(y.summary)?{detail:z(y.summary)}:{},...N.length?{fix:N.map((ye,Ze)=>`${Ze+1}. ${ye}`).join(`
|
|
90
|
-
`)}:{},...z(y.verify)?{verify:z(y.verify)}:{},...z(y.docs)?{docs:z(y.docs)}:{},code:
|
|
91
|
-
`)}s(
|
|
90
|
+
`)}:{},...z(y.verify)?{verify:z(y.verify)}:{},...z(y.docs)?{docs:z(y.docs)}:{},code:Mb(K,H),...R(K.modules)!==void 0?{count:R(K.modules)}:{},resource:"perf://rules",at:R(y.lastSeenAt)})}let M=new Map;for(let y of r){let D=M.get(y.id);(!D||(y.at??0)>=(D.at??0))&&M.set(y.id,y)}return[...M.values()]}s(Ab,"VP"),o(Ab,"collectProblems");function Ib(e){let t=oe(e["process://cluster"]),r=ce(t.errors);return ce(t.services).filter(i=>i.buildFailed===!0).map(i=>z(i.project)??"?").filter(i=>{let u=r.filter(n=>n.project===i&&n.fault!=="types");return!(u.length>0&&u.every(n=>n.fault==="process"))})}s(Ib,"GP"),o(Ib,"podBuildFailures");function _b(e,t=Date.now()){let r=[],i=o((n,a,l,d,c)=>{let p=oe(e[n]);if(!e[n])return;let m,f=z(p.detail)??"",h=d(p),g=h?void 0:c?.(p);p.producer==="none"?(m="unchecked",f=f||"nothing is reporting this yet \u2014 not a pass"):h?(m="fail",f=h):g?(m="warn",f=g):p.stale===!0?m="stale":m="pass",r.push({id:a,label:l,status:m,detail:Am(f),resource:n})},"health");i("build://current","build","Build",n=>{let a=ce(n.failures),l=a.filter(d=>d.domain!=="typecheck"&&d.domain!=="lint").length;return l>0||a.length===0&&n.status==="failing"?`${l||"some"} build failure${l===1?"":"s"}`:void 0});let u=Ib(e);if(u.length){let n=r.find(d=>d.id==="build"),a=n?.status==="fail"?`${n.detail}; `:"",l=Am(`${a}${u.length} service build${u.length===1?"":"s"} failing (${u.join(", ")})`);n?Object.assign(n,{status:"fail",detail:l,resource:n.status==="fail"?n.resource:"process://cluster"}):r.unshift({id:"build",label:"Build",status:"fail",detail:l,resource:"process://cluster"})}return i("typecheck://current","typecheck","Typecheck",n=>{let a=R(n.errorCount)??0;return a>0?`${a} type error${a===1?"":"s"}`:void 0}),i("lint://current","lint","Lint",n=>{let a=R(n.errorCount)??0;return a>0?`${a} lint error${a===1?"":"s"}`:void 0}),i("runtime://browser/errors","browser","Browser capture",n=>{let a=R(n.count)??0;return a>0?`${a} browser error${a===1?"":"s"}`:void 0}),i("visual://violations/current","visual","Visual rules",n=>{let a=ce(n.violations).length;return a>0?`${a} visual violation${a===1?"":"s"}`:void 0}),i("db://analysis","db-analysis","DB analysis",n=>{let a=R(n.errorCount),l=a??R(n.findingCount)??0;if(l!==0)return a===void 0?`${l} finding${l===1?"":"s"}`:`${l} error-level finding${l===1?"":"s"}`},n=>{let a=R(n.warningCount)??0,l=[];if(a>0&&l.push(`${a} warning${a===1?"":"s"}`),n.incomplete===!0){let d=R(n.droppedFindings)??0;l.push(d>0?`incomplete \u2014 ${d} findings never reached the lens`:"incomplete \u2014 part of the run never reached the lens")}return l.length>0?l.join("; "):void 0}),r}s(_b,"JP"),o(_b,"collectChecks");function Sb(e){let t=oe(oe(e["memory://current"]).current),r=new Set(ce(oe(e["memory://leaks/suspected"]).suspected).map(u=>z(u.ownerId))),i=ce(oe(e["memory://owners/growing"]).owners).map(u=>({ownerId:z(u.ownerId)??"?",itemCount:R(u.itemCount)??0,growth:R(u.growthSinceStart)??0,mutations:R(u.mutations)??0,...R(u.lastMutatedAt)!==void 0?{lastMutatedAt:R(u.lastMutatedAt)}:{},suspected:r.has(z(u.ownerId)),flowIds:(Array.isArray(u.flowIds)?u.flowIds:[]).filter(n=>typeof n=="string").slice(-5)})).filter(u=>!/^Lensmcp/i.test(u.ownerId)).sort((u,n)=>Number(n.suspected)-Number(u.suspected)||n.growth-u.growth).slice(0,8);return{...R(t.heapUsed)!==void 0?{heapUsed:R(t.heapUsed)}:{},...R(t.rss)!==void 0?{rss:R(t.rss)}:{},owners:i}}s(Sb,"WP"),o(Sb,"collectMemory");function Fb(e){return{hot:ce(oe(e["react://components/hot"]).components).map(t=>({component:z(t.componentName)??xm(z(t.componentLogicalId)??"?"),renders:R(t.renderCount)??0,totalMs:Math.round((R(t.totalActualMs)??0)*10)/10})).sort((t,r)=>r.renders-t.renders).slice(0,8)}}s(Fb,"KP"),o(Fb,"collectReact");var UI=class{static{s(this,"fc")}static{o(this,"ProblemLedger")}constructor(e=10*6e4){this.keepResolvedMs=e,this.known=new Map}update(e,t=Date.now()){let r=new Set;for(let i of e){if(r.has(i.id))continue;r.add(i.id);let{at:u,...n}=i,a=this.known.get(i.id),l=u??a?.lastSeenAt??t,d={...n,firstSeenAt:a?.firstSeenAt??Math.min(l,t),lastSeenAt:l};this.known.set(i.id,{firstSeenAt:d.firstSeenAt,lastSeenAt:l,problem:d})}for(let[i,u]of this.known)r.has(i)||(u.resolvedAt===void 0?u.resolvedAt=t:t-u.resolvedAt>this.keepResolvedMs&&this.known.delete(i));return[...this.known.values()].map(i=>i.resolvedAt!==void 0?{...i.problem,resolvedAt:i.resolvedAt}:i.problem).sort(zb)}},jb={high:0,medium:1,low:2};function zb(e,t){let r=e.resolvedAt!==void 0?1:0,i=t.resolvedAt!==void 0?1:0;return r-i||jb[e.severity]-jb[t.severity]||t.lastSeenAt-e.lastSeenAt}s(zb,"XP"),o(zb,"problemOrder");function Nb(e,t){let r=e.now??Date.now();return{at:r,problems:t.update(Ab(e),r),checks:_b(e.resources,r),memory:Sb(e.resources),react:Fb(e.resources)}}s(Nb,"iS"),o(Nb,"buildDiagnostics");function Mb(e,t){let r=[],i=[R(e.modules)!==void 0?`${R(e.modules)} modules`:void 0,R(e.bytes)!==void 0?`${(R(e.bytes)/1048576).toFixed(1)} MB`:void 0,R(e.compileMs)!==void 0?`~${Ue(R(e.compileMs))} compile`:void 0,R(e.memoryMb)!==void 0?`~${R(e.memoryMb)} MB memory`:void 0].filter(Boolean);i.length&&r.push(`cost: ${i.join(" \xB7 ")}${z(e.basis)?` (${z(e.basis)})`:""}`);for(let[u,n]of Object.entries(t)){if(n==null||Array.isArray(n)&&n.length===0)continue;let a=typeof n=="object"?JSON.stringify(n):String(n);if(r.push(`${u}: ${a.length>400?`${a.slice(0,399)}\u2026`:a}`),r.length>=24)break}return r.join(`
|
|
91
|
+
`)}s(Mb,"HP"),o(Mb,"perfRuleEvidence");function Ob(e,t){return e==="n-plus-one"?`the same query ran ${R(t.count)??"?"}\xD7 in one request (threshold ${R(t.threshold)??"?"}) \u2014 one round-trip per row`:e==="db-in-loop"?`${R(t.dbCallsInsideLoop)??"?"} database calls inside one loop of ${R(t.iterations)??"?"} iterations${R(t.durationMs)!==void 0?` (${Ue(R(t.durationMs))})`:""}`:e==="render-storm"?`rendered ${R(t.count)??"?"}\xD7 within ${R(t.windowMs)??"?"}ms (threshold ${R(t.threshold)??"?"})`:e==="slow-path"?z(t.summary)??"the longest causal chain in the flow":z(t.summary)??""}s(Ob,"YP"),o(Ob,"patternDetail");function xm(e){let t=e.split(":").pop()??e;return t.split("#")[0]||t}s(xm,"sS"),o(xm,"componentName");function Cm(e){let[t,r]=e.split("::"),i=(t??e).split("#")[0];return r?`${i}.${r}`:i??e}s(Cm,"rS"),o(Cm,"ownerName");function km(e){return e.split(`
|
|
92
92
|
`).filter(t=>!/node_modules|node:internal|node:async_hooks/.test(t)).slice(0,5).join(`
|
|
93
|
-
`)}s(
|
|
93
|
+
`)}s(km,"nS"),o(km,"firstFrames");function Ue(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${Math.round(e)}ms`}s(Ue,"ot"),o(Ue,"fmtMs");function Am(e,t=160){return e.length>t?e.slice(0,t-1)+"\u2026":e}s(Am,"oS"),o(Am,"shorten");function ra(e,t){return`event: ${e.type}
|
|
94
94
|
${t!==void 0?`id: ${t}
|
|
95
95
|
`:""}data: ${JSON.stringify(e.data)}
|
|
96
96
|
|
|
97
|
-
`}s(ra,"Ob"),o(ra,"sseFrame");var
|
|
97
|
+
`}s(ra,"Ob"),o(ra,"sseFrame");var qI=class{static{s(this,"mc")}static{o(this,"StreamHub")}constructor(e=15e3){this.clients=new Set,this.latest=new Map,this.latestJson=new Map,this.frameId=0,this.currentLogSeq=0,this.pinger=setInterval(()=>this.writeAll(`:ping
|
|
98
98
|
|
|
99
99
|
`),e),this.pinger.unref()}get size(){return this.clients.size}attach(e,t){e.writeHead(200,{"content-type":"text/event-stream; charset=utf-8","cache-control":"no-store",connection:"keep-alive","x-accel-buffering":"no"}),e.write(`retry: 3000
|
|
100
100
|
|
|
@@ -102,14 +102,14 @@ ${t!==void 0?`id: ${t}
|
|
|
102
102
|
id: ${++this.frameId}
|
|
103
103
|
data: ${t}
|
|
104
104
|
|
|
105
|
-
`;return this.latest.set(e.type,r),this.writeAll(r),!0}publishLogs(e){if(this.currentLogSeq=e.data.seq,this.clients.size===0)return;let t=ra(e,++this.frameId);for(let r of this.clients)if(!r.logsDropped){if(r.res.writableNeedDrain){r.logsDropped=!0;continue}this.safeWrite(r,t)}}latestData(e){let t=this.latestJson.get(e);return t===void 0?void 0:JSON.parse(t)}close(){clearInterval(this.pinger);for(let e of this.clients)try{e.res.end()}catch{}this.clients.clear()}writeAll(e){for(let t of this.clients)this.safeWrite(t,e)}safeWrite(e,t){try{e.res.write(t)}catch{this.clients.delete(e)}}};function Ct(e,t){let r,i=0,u=!1,n=!1,a=o(async()=>{if(r=void 0,u){n=!0;return}u=!0,i=Date.now();try{await e()}catch(d){console.error("[lensmcp] dashboard: stream producer failed (contained):",d)}finally{u=!1,n&&(n=!1,l())}},"fire"),l=o(()=>{if(r)return;let d=Math.max(0,t-(Date.now()-i));r=setTimeout(()=>{a()},d),r.unref()},"kick");return{kick:l}}s(Ct,"Jt"),o(Ct,"coalesce");function
|
|
105
|
+
`;return this.latest.set(e.type,r),this.writeAll(r),!0}publishLogs(e){if(this.currentLogSeq=e.data.seq,this.clients.size===0)return;let t=ra(e,++this.frameId);for(let r of this.clients)if(!r.logsDropped){if(r.res.writableNeedDrain){r.logsDropped=!0;continue}this.safeWrite(r,t)}}latestData(e){let t=this.latestJson.get(e);return t===void 0?void 0:JSON.parse(t)}close(){clearInterval(this.pinger);for(let e of this.clients)try{e.res.end()}catch{}this.clients.clear()}writeAll(e){for(let t of this.clients)this.safeWrite(t,e)}safeWrite(e,t){try{e.res.write(t)}catch{this.clients.delete(e)}}};function Ct(e,t){let r,i=0,u=!1,n=!1,a=o(async()=>{if(r=void 0,u){n=!0;return}u=!0,i=Date.now();try{await e()}catch(d){console.error("[lensmcp] dashboard: stream producer failed (contained):",d)}finally{u=!1,n&&(n=!1,l())}},"fire"),l=o(()=>{if(r)return;let d=Math.max(0,t-(Date.now()-i));r=setTimeout(()=>{a()},d),r.unref()},"kick");return{kick:l}}s(Ct,"Jt"),o(Ct,"coalesce");function Rb(e,t){if(e!=="POST")return{ok:!1,status:405,error:"this endpoint changes state \u2014 POST only"};if((String(t["content-type"]??"").split(";")[0]??"").trim().toLowerCase()!=="application/json")return{ok:!1,status:415,error:"send the body as application/json"};let r=t["sec-fetch-site"];return r!==void 0&&r!=="same-origin"?{ok:!1,status:403,error:"cross-site requests may not change dashboard state"}:{ok:!0}}s(Rb,"cS"),o(Rb,"mutationVerdict");var Mu=class extends Error{static{s(this,"wt")}static{o(this,"RequestRefused")}constructor(e,t){super(t),this.status=e}},ZI=256*1024,Tb=500,LI=2048;function Pb(e,t=ZI){return new Promise((r,i)=>{let u=[],n=0;e.on("data",a=>{if(n+=a.length,n>t){i(new Mu(413,`body over ${t} bytes`)),e.destroy();return}u.push(a)}),e.on("end",()=>r(Buffer.concat(u).toString("utf8"))),e.on("error",i)})}s(Pb,"uS"),o(Pb,"readBody");function Ub(e){let t;try{t=JSON.parse(e)}catch{throw new Mu(400,"the body is not JSON")}let r=t?.ids;if(!Array.isArray(r)||r.length===0)throw new Mu(400,'expected { "ids": [<error id>, \u2026] }');if(r.length>Tb)throw new Mu(400,`at most ${Tb} ids in one request`);if(!r.every(i=>typeof i=="string"&&i.length>0&&i.length<=LI))throw new Mu(400,"every id is a non-empty string");return r}s(Ub,"lS"),o(Ub,"parseErrorIds");function qb(e){let t=JSON.stringify(e.base),r=encodeURIComponent(e.assetVersion),i=`${Vb(e.base)}/assets/dashboard-ui`,u=e.assetsReady?"":'<div class="lm-missing"><strong>The dashboard UI is not built.</strong><br>Run <code>yarn nx run @lensmcp/lensmcp-mcp:bundle</code> and reload. The data endpoints under <code>/api</code> are live.</div>';return`<!doctype html>
|
|
106
106
|
<html lang="en">
|
|
107
107
|
<head>
|
|
108
108
|
<meta charset="utf-8">
|
|
109
109
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
110
110
|
<meta name="color-scheme" content="dark light">
|
|
111
111
|
<title>${gi(e.title)}</title>
|
|
112
|
-
<link rel="icon" href="data:image/svg+xml,${encodeURIComponent(
|
|
112
|
+
<link rel="icon" href="data:image/svg+xml,${encodeURIComponent(Lb)}">
|
|
113
113
|
<script>
|
|
114
114
|
window.__LENS_BASE__=${t};
|
|
115
115
|
window.__LENS_TOKEN_PARAM__=${JSON.stringify(Ys)};
|
|
@@ -129,7 +129,7 @@ ${e.assetsReady?`<link rel="stylesheet" href="${i}/app.css?v=${r}">
|
|
|
129
129
|
<div id="root">${u}</div>
|
|
130
130
|
<noscript><div class="lm-missing">The LensMCP dashboard needs JavaScript.</div></noscript>
|
|
131
131
|
</body>
|
|
132
|
-
</html>`}s(
|
|
132
|
+
</html>`}s(qb,"dS"),o(qb,"renderShell");function Zb(e){let t=gi(e.wsKey),r=e.reason==="expired"?"That sign-in link has expired or was already used. Links work once, for ten minutes.":"This dashboard shows your workspace\u2019s telemetry, so it asks for proof you are its owner.";return`<!doctype html>
|
|
133
133
|
<html lang="en">
|
|
134
134
|
<head>
|
|
135
135
|
<meta charset="utf-8">
|
|
@@ -137,7 +137,7 @@ ${e.assetsReady?`<link rel="stylesheet" href="${i}/app.css?v=${r}">
|
|
|
137
137
|
<meta name="color-scheme" content="dark light">
|
|
138
138
|
<meta name="referrer" content="no-referrer">
|
|
139
139
|
<title>${gi(e.title)} \xB7 sign in</title>
|
|
140
|
-
<link rel="icon" href="data:image/svg+xml,${encodeURIComponent(
|
|
140
|
+
<link rel="icon" href="data:image/svg+xml,${encodeURIComponent(Lb)}">
|
|
141
141
|
<style>
|
|
142
142
|
html,body{margin:0;background:#0a1826;color:#dce9f6}
|
|
143
143
|
@media (prefers-color-scheme: light){html,body{background:#e6ecf2;color:#0f2a40}}
|
|
@@ -158,10 +158,10 @@ html,body{margin:0;background:#0a1826;color:#dce9f6}
|
|
|
158
158
|
After that this browser stays signed in for 30 days.
|
|
159
159
|
</div>
|
|
160
160
|
</body>
|
|
161
|
-
</html>`}s(
|
|
161
|
+
</html>`}s(Zb,"pS"),o(Zb,"renderLockedPage");var Lb='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="3" y="3" width="26" height="26" fill="#0a1826" stroke="#79dcff" stroke-width="2"/><path d="M16 3v26M3 16h26" stroke="#79dcff" stroke-opacity=".5"/><circle cx="16" cy="16" r="4" fill="#79dcff"/></svg>';function gi(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}s(gi,"hc"),o(gi,"escapeHtml");function Vb(e){return gi(e)}s(Vb,"tD"),o(Vb,"escapeAttr"),process.env.LENSMCP_EVENT_FILE??=`${process.cwd()}/.lensmcp/events.jsonl`,ub("dashboard");var{session:Be,flows:Jb}=UE(),VI=Date.now(),kt=process.cwd(),vi=Number(process.env.LENSMCP_DASHBOARD_PORT??4321),et=(process.env.LENSMCP_DASHBOARD_BASE??"").replace(/\/+$/,""),Ou=process.env.LENSMCP_WS_KEY||et.replace(/^\//,"")||d5(kt),Wb=process.env.LENSMCP_WS_KEY??"",Im=(()=>{try{let e=JSON.parse(Vm(`${kt}/.lensmcp/config.json`,"utf8")).key;return typeof e=="string"&&/^[\w.-]+$/.test(e)?e:""}catch{return""}})();function Gb(e){let t=process.env.TMPDIR??"/tmp";if(Wb)return`${t}/${Wb}/${e}-devserver`;let r=`${t}/${e}-devserver`;return Im&&!Lm(r)&&Lm(`${t}/${Im}/${e}-devserver`)?`${t}/${Im}/${e}-devserver`:r}s(Gb,"aD"),o(Gb,"podSockDir");var At=process.env.LENSMCP_DASHBOARD_BIND??"127.0.0.1",at=At==="127.0.0.1"||At==="::1"||At==="localhost",Ru=KE(process.env,kt),ot=Ru.token,Kb=HE(Ou),JI=new bI,qe=new qI,_e=new SI(5e3),ia=new FI,Tu=new jI(void 0,Jb),WI=new UI,yi=new PI,Yt=new II({root:kt,podSockDir:Gb,onChange:o(()=>{Sm.kick(),t5.kick()},"onChange")});async function Ei(e){try{return await Be.resources.read(e)}catch{return}}s(Ei,"vc"),o(Ei,"readResource");async function na(e){let t={};return await Promise.all(e.map(async r=>{let i=await Ei(r);i!==void 0&&(t[r]=i)})),t}s(na,"Pb"),o(na,"readResources");var GI=new cb,Hb=new cb,Qt=[];function Xb(e){GI.firstTime(e.id)&&(Qt.push(_e.append(e)),Qt.length>2e3&&Qt.splice(0,Qt.length-2e3),ia.observe(e),Tu.observe(e),Em(e)&&KI.kick(),yi.observe(e)&&wi.kick(),Hb.firstTime(e.id)&&Yt.reduce(e))}s(Xb,"dD"),o(Xb,"onBusEvent");function Yb(){try{let e=process.env.LENSMCP_EVENT_FILE??`${kt}/.lensmcp/events.jsonl`;for(let t of rb(e,8*1024*1024,25e3))try{let r=JSON.parse(t);if(!r||r.source!=="gateway"&&!nb.has(r.source))continue;Hb.firstTime(r.id)&&Yt.reduce(r)}catch{}}catch{}}s(Yb,"pD"),o(Yb,"replayClusterTail");var _m,bi=[],Sm=Ct(async()=>{let e=await Ei("process://cluster");_m=Yt.view({processCluster:e,kpis:ia}),qe.publish({type:"cluster",data:_m}),Di.kick()},250),Fm=Ct(()=>{bi=Tu.summaries(Qe()),qe.publish({type:"flows",data:{flows:bi}})&&Di.kick()},300),KI=Ct(()=>{let e=Tu.drainRevs();e.length&&qe.publish({type:"flow-rev",data:e}),Fm.kick()},300),jm=Ct(async()=>{let e=await na(kb),t=Nb({resources:e,flows:bi,flowOfEvent:o(r=>Tu.flowOfEvent(r),"flowOfEvent"),evidence:Tu.evidence(Qe())},WI);qe.publish({type:"diagnostics",data:t})},1e3),zm=["build://failures","typecheck://errors","lint://errors","process://cluster"],wi=Ct(async()=>{let e=$m(await na(zm));qe.publish({type:"errors",data:yi.snapshot(e)})},500),Di=Ct(async()=>{qe.publish({type:"session",data:await e5()})},500),Qb=o(()=>{qe.publish({type:"kpis",data:ia.snapshot()})},"kpiPush");setInterval(()=>{if(Qt.length===0)return;let e=Qt.splice(0,Qt.length);qe.publishLogs({type:"logs",data:{seq:_e.seq,sources:_e.sources(),lines:e.slice(-500)}})},250).unref(),setInterval(Qb,2e3).unref(),setInterval(()=>Sm.kick(),3e3).unref(),setInterval(()=>jm.kick(),1e4).unref(),setInterval(()=>{yi.flush()&&wi.kick()},500).unref(),setInterval(()=>wi.kick(),15e3).unref(),setInterval(()=>Di.kick(),5e3).unref(),Be.bus.subscribe(Xb),Yb(),Be.resources.subscribe("flow://recent",()=>Fm.kick());for(let e of kb)Be.resources.subscribe(e,()=>jm.kick());Be.resources.subscribe("agent://current-status",()=>Di.kick());for(let e of zm)Be.resources.subscribe(e,()=>wi.kick());async function e5(){let e=await Ei("agent://current-status")??{},t=_m??Yt.view({kpis:ia}),r=[],i=t.hosts.filter(l=>!l.v4||!l.v6);i.length&&r.push({id:"hosts",title:`${i.length} host${i.length===1?" does":"s do"} not resolve to this machine`,detail:`${i.map(l=>l.host).join(", ")} \u2014 requests to ${i.length===1?"it":"them"} fail until /etc/hosts maps ${i.length===1?"it":"them"} to 127.0.0.1 and ::1.`,...t.hostsFix?{fix:t.hostsFix}:{}}),t.gateway.state==="down"&&r.push({id:"gateway",title:"The dev gateway is not running",detail:t.gateway.evidence,fix:"lensmcp gateway start"});let u=[...e.blocking??[],...e.warnings??[]].map(l=>(l.title??"").split(" \u2014 ")[0].trim()).filter(Boolean),n=e.status??"starting",a=u.length?u.slice(0,3).join(" \xB7 ")+(u.length>3?` \xB7 +${u.length-3} more`:""):n==="clean"?"Nothing is failing":"Waiting for the first signals";return{phase:r.length?"setup-incomplete":bi.length===0?"empty":"live",gateway:t.gateway,status:n,headline:a,flowCount:bi.length,eventCount:_e.seq,setupIssues:r}}s(e5,"mD"),o(e5,"sessionView");var Pu=new Set,t5=Ct(()=>{if(Pu.size===0)return;let e=`event: update
|
|
162
162
|
data: `+JSON.stringify(Yt.legacyView())+`
|
|
163
163
|
|
|
164
|
-
`;for(let t of Pu)try{t.write(e)}catch{Pu.delete(t)}},80);setInterval(()=>{Pu.size>0&&
|
|
164
|
+
`;for(let t of Pu)try{t.write(e)}catch{Pu.delete(t)}},80);setInterval(()=>{Pu.size>0&&t5.kick()},3e3).unref();function u5(e,t=!1,r){return Db(Qe(),e,{includeRaw:t,rev:Tu.rev(e),config:Jb,...r!==void 0?{segmentId:r}:{}})}s(u5,"hD"),o(u5,"flowDetail");async function r5(){let e=Be.resources.list().sort(),t={};return await Promise.all(e.map(async r=>{try{t[r]=await Be.resources.read(r)}catch(i){t[r]={__error:i instanceof Error?i.message:String(i)}}})),{at:Date.now(),count:e.length,resources:t}}s(r5,"gD"),o(r5,"snapshot");var i5=["./dashboard-ui/","../../../libs/cli/bundled/dashboard-ui/"].map(e=>new URL(e,import.meta.url)),HI=/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*$/,XI={js:"application/javascript; charset=utf-8",css:"text/css; charset=utf-8",woff2:"font/woff2",woff:"font/woff",svg:"image/svg+xml",png:"image/png",json:"application/json",map:"application/json"};function n5(e){if(!(!HI.test(e)||e.split("/").some(t=>t===".."||t===".")))for(let t of i5)try{let r=new URL(e,t),i=Jm(r);if(!i.isFile())continue;return{body:Vm(r),mtimeMs:i.mtimeMs}}catch{}}s(n5,"bD"),o(n5,"findAsset");function Nm(){for(let e of i5)try{return String(Math.round(Jm(new URL("app.js",e)).mtimeMs))}catch{}}s(Nm,"SS"),o(Nm,"uiAssetVersion"),Nm()||console.warn("[lensmcp] dashboard: the UI bundle (dashboard-ui/app.js) was not found beside the dashboard or in libs/cli/bundled/ \u2014 the page will ask for a rebuild. Build it: yarn nx run @lensmcp/lensmcp-mcp:bundle");function ge(e,t,r){e.writeHead(t,{"content-type":"application/json","cache-control":"no-store"}),e.end(JSON.stringify(r))}s(ge,"ye"),o(ge,"json");function Mm(e,t){e.writeHead(401,{"content-type":"text/html; charset=utf-8","cache-control":"no-store","referrer-policy":"no-referrer"}),e.end(Zb({title:`LensMCP \xB7 ${Ou}`,wsKey:Ou,reason:t}))}s(Mm,"vS"),o(Mm,"locked");var Om=l5((e,t)=>{let r;try{r=new URL(e.url??"/","http://localhost")}catch{t.writeHead(400,{"content-type":"text/plain"}),t.end("bad request target");return}let i=LE(at,e.headers.host);if(!i.ok){ge(t,i.status,{error:i.error});return}let u=r.pathname;if(et){if(u===et){t.writeHead(302,{location:et+"/"+r.search}),t.end();return}u.startsWith(et+"/")&&(u=u.slice(et.length))}if(ot){let a=r.searchParams.get(Ys),l=cm(ot,e.headers.authorization,a,{header:e.headers.cookie,name:Kb});if(eb(u)){if(!l){t.writeHead(401,{"content-type":"application/json","www-authenticate":'Bearer realm="lensmcp-dashboard"',"cache-control":"no-store"}),t.end(JSON.stringify({error:`unauthorized \u2014 ${at?"":`this dashboard is bound to ${At}; `}sign in with the link \`lensmcp gateway status\` prints, or send the workspace token as a Bearer`}));return}}else if(!tb(u)){let d=r.searchParams.get(lm);if(d!==null||a!==null){let c=d!==null?JI.redeem(ot,d,Date.now())==="ok":cm(ot,void 0,a);if(!c&&!l){Mm(t,"expired");return}r.searchParams.delete(lm),r.searchParams.delete(Ys);let p=e.headers["x-forwarded-proto"]==="https";t.writeHead(303,{location:r.pathname+r.search,"cache-control":"no-store","referrer-policy":"no-referrer",...c?{"set-cookie":YE(Kb,pm(ot),et||"/",p)}:{}}),t.end();return}if(!l){Mm(t,"signin");return}}}if(u==="/api/stream"){let a=Number(r.searchParams.get("logsSince")??"0"),l=a>0?_e.since(a,2e3):_e.recent(1500),d=[{type:"hello",data:{protocol:1,sessionId:Be.id,startedAt:VI,rawAllowed:at,workspace:{key:Ou,name:Ou,base:et},logSeq:_e.seq}},{type:"logs",data:{seq:_e.seq,sources:_e.sources(),lines:l}}];qe.attach(t,d);for(let[c,p]of[["cluster",Sm],["flows",Fm],["diagnostics",jm],["session",Di],["errors",wi]])qe.latestData(c)===void 0&&p.kick();qe.latestData("kpis")===void 0&&Qb();return}if(u==="/api/cluster/stream"){t.writeHead(200,{"content-type":"text/event-stream","cache-control":"no-store",connection:"keep-alive"}),t.write(`event: snapshot
|
|
165
165
|
data: `+JSON.stringify(Yt.legacyView())+`
|
|
166
166
|
|
|
167
|
-
`),Pu.add(t),e.on("close",()=>Pu.delete(t));return}if(u==="/api/cluster"){ge(t,200,Yt.legacyView());return}if(u==="/api/snapshot"){
|
|
167
|
+
`),Pu.add(t),e.on("close",()=>Pu.delete(t));return}if(u==="/api/cluster"){ge(t,200,Yt.legacyView());return}if(u==="/api/snapshot"){r5().then(a=>ge(t,200,a)).catch(a=>ge(t,500,{error:a instanceof Error?a.message:String(a)}));return}if(u==="/api/resources"){let a=Be.resources.list().sort().map(l=>({uri:l,scheme:l.split("://")[0]??l,revision:Be.resources.revision(l)}));ge(t,200,{resources:a});return}if(u==="/api/resource"){let a=r.searchParams.get("uri")??"";if(!Be.resources.list().includes(a)){ge(t,404,{error:`unknown resource: ${a}`});return}Ei(a).then(l=>ge(t,200,{uri:a,revision:Be.resources.revision(a),value:l}));return}if(u==="/api/flow"){let a=r.searchParams.get("id")??"",l=r.searchParams.get("raw")==="1";if(l&&!at){ge(t,403,{error:"raw AI payloads are served only on a loopback-bound dashboard; unset LENSMCP_DASHBOARD_BIND"});return}let d=r.searchParams.get("segment");ge(t,200,u5(a,l,d!==null&&d.length>0&&d.length<=512?d:void 0));return}if(u==="/api/ai-call"){if(!at){ge(t,403,{error:"AI call content is served only on a loopback-bound dashboard; unset LENSMCP_DASHBOARD_BIND"});return}let a=r.searchParams.get("id")??"";if(!gs(a)){ge(t,400,{error:"invalid ai call id"});return}let l=gc(process.env.LENSMCP_EVENT_FILE??`${kt}/.lensmcp/events.jsonl`,a);if(!l){ge(t,404,{error:"no captured content for this call \u2014 not captured (LENSMCP_AI_CAPTURE=content), or rotated away"});return}ge(t,200,l);return}if(u==="/api/logs"){let a=Number(r.searchParams.get("since")??"0"),l=r.searchParams.get("flow")??void 0,d=r.searchParams.get("q")??void 0,c=Number(r.searchParams.get("around")??""),p=Math.min(6e4,Math.max(100,Number(r.searchParams.get("window")??"5000")||5e3)),m=Math.min(5e3,Math.max(1,Number(r.searchParams.get("limit")??"2000")||2e3)),f=l||d||Number.isFinite(c)&&c>0?_e.query({since:a,...l?{flowId:l}:{},...d?{q:d}:{},...Number.isFinite(c)&&c>0?{from:c-p,to:c+p}:{},limit:m}):a>0?_e.since(a,m):_e.recent(m);ge(t,200,{seq:_e.seq,sources:_e.sources(),events:f});return}if(u==="/api/errors/dismiss"||u==="/api/errors/restore"){let a=Rb(e.method,e.headers);if(!a.ok){ge(t,a.status,{error:a.error});return}let l=u==="/api/errors/dismiss";Pb(e).then(async d=>{let c=Ub(d),p=l?yi.dismissalsFor(c,$m(await na(zm))).map(m=>Pd(m,Be.id)):yi.restorable(c).map(m=>Ud(m,Be.id,Date.now()));os(p6(process.env,kt),p),ge(t,200,{count:p.length})}).catch(d=>{t.headersSent||(d instanceof Mu?ge(t,d.status,{error:d.message}):ge(t,500,{error:`could not write to the event bus: ${d instanceof Error?d.message:String(d)}`}))});return}if(u.startsWith("/api/")){ge(t,404,{error:`no such endpoint: ${u}`});return}if(u.startsWith("/assets/dashboard-ui/")){let a=u.slice(21),l=n5(a);if(!l){t.writeHead(404,{"content-type":"text/plain"}),t.end("asset not bundled");return}let d=a.split(".").pop()??"",c=/^(?:chunks|media)\//.test(a),p=`"${o5("sha1").update(l.body).digest("hex").slice(0,16)}"`;if(!c&&e.headers["if-none-match"]===p){t.writeHead(304,{etag:p}),t.end();return}t.writeHead(200,{"content-type":XI[d]??"application/octet-stream","cache-control":c?"public, max-age=31536000, immutable":"no-cache",...c?{}:{etag:p}}),t.end(l.body);return}let n=Nm();t.writeHead(200,{"content-type":"text/html; charset=utf-8","cache-control":"no-store"}),t.end(qb({base:et,title:`LensMCP \xB7 ${Ou}`,assetsReady:!!n,assetVersion:n??"0"}))});Om.on("error",e=>{throw e.code==="EADDRINUSE"&&(console.error(`[lensmcp] dashboard: port ${vi} is already in use (an orphaned dashboard from a crashed gateway?) \u2014 exiting.`),process.exit(1)),e}),Om.listen(vi,At,()=>{let e=Be.resources.list().length;console.error(`[lensmcp] dashboard \u2192 http://${at?"localhost":At}:${vi} (${e} resources registered)`),ot&&at?process.stderr.isTTY?console.error(`[lensmcp] sign in \u2192 http://localhost:${vi}${et}/?${lm}=${QE(ot,Date.now())} (one use, 10 min)`):console.error("[lensmcp] dashboard sign-in: `lensmcp gateway status` (or `lensmcp dashboard`) prints a one-time link."):!ot&&at&&console.error(`[lensmcp] WARNING: the dashboard serves workspace telemetry to ANY account on this machine${Ru.source==="unavailable"?` (could not establish a token: ${Ru.reason})`:" (LENSMCP_ALLOW_INSECURE=1)"}.`),at||(console.error(`[lensmcp] WARNING: dashboard bound to ${At} \u2014 reachable beyond this machine.`),console.error(ot?`[lensmcp] its data endpoints require a token (${Ru.source==="env"?"LENSMCP_DASHBOARD_TOKEN":dm(kt)}). Open the page as http://${At}:${vi}/?${Ys}=YOUR_TOKEN`:`[lensmcp] WARNING: it serves workspace telemetry with NO authentication${Ru.source==="unavailable"?` (could not establish a token: ${Ru.reason})`:" (LENSMCP_ALLOW_INSECURE=1)"}. Unset LENSMCP_DASHBOARD_BIND to restore loopback.`))}),process.on("uncaughtException",e=>{console.error("[lensmcp] dashboard: uncaught exception (contained):",e)});function Rm(e){qe.close(),Om.close(),Be.stop().catch(()=>{}).finally(()=>process.exit(e==="SIGINT"?130:0))}s(Rm,"IS"),o(Rm,"shutdown"),process.on("SIGINT",Rm),process.on("SIGTERM",Rm);
|