@precisionutilityguild/liquid-shadow 1.0.4 → 1.0.6
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/README.md +4 -4
- package/dist/data/migrations/000_baseline.sql +315 -0
- package/dist/data/migrations/010_type_graph_edges.sql +27 -0
- package/dist/data/migrations/011_handoff_embeddings.sql +2 -0
- package/dist/data/migrations/012_ember_state.sql +18 -0
- package/dist/entry/cli/index.js +640 -616
- package/dist/entry/ember/index.js +545 -0
- package/dist/entry/mcp/server.js +497 -324
- package/dist/index.js +493 -322
- package/dist/logic/domain/embeddings/worker.js +1 -1
- package/dist/logic/parser/index.js +14 -13
- package/dist/skills/shadow_audit/SKILL.md +43 -0
- package/dist/skills/shadow_chronicle/SKILL.md +40 -0
- package/dist/skills/shadow_continue/SKILL.md +63 -0
- package/dist/skills/shadow_crystallize/SKILL.md +41 -0
- package/dist/skills/shadow_mission/SKILL.md +53 -0
- package/dist/skills/shadow_onboard/SKILL.md +39 -0
- package/dist/skills/shadow_research/SKILL.md +34 -0
- package/dist/skills/shadow_sync/SKILL.md +18 -0
- package/dist/skills/shadow_synthesize/SKILL.md +48 -0
- package/dist/skills/shadow_trace_impact/SKILL.md +55 -0
- package/dist/skills/shadow_understand/SKILL.md +57 -0
- package/dist/skills/shadow_workspace/SKILL.md +30 -0
- package/dist/web-manifest.json +11 -4
- package/package.json +4 -3
- package/skills/shadow_audit/SKILL.md +43 -0
- package/skills/shadow_chronicle/SKILL.md +40 -0
- package/skills/shadow_continue/SKILL.md +63 -0
- package/skills/shadow_crystallize/SKILL.md +41 -0
- package/skills/shadow_mission/SKILL.md +53 -0
- package/skills/shadow_onboard/SKILL.md +39 -0
- package/skills/shadow_research/SKILL.md +34 -0
- package/skills/shadow_sync/SKILL.md +18 -0
- package/skills/shadow_synthesize/SKILL.md +48 -0
- package/skills/shadow_trace_impact/SKILL.md +55 -0
- package/skills/shadow_understand/SKILL.md +57 -0
- package/skills/shadow_workspace/SKILL.md +30 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
1
|
+
var fx=Object.defineProperty;var se=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ze=(n,e)=>{for(var r in e)fx(n,r,{get:e[r],enumerable:!0})};import vx from"pino";var _x,xx,$,Q=se(()=>{"use strict";_x={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},xx=vx({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(n,e){return{level:n,severity:_x[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),$=xx});import{fileURLToPath as Sx}from"node:url";import{dirname as $c,join as Lf,resolve as $x}from"node:path";import{existsSync as wx}from"node:fs";function Ex(){let n=Df;for(;n!==$c(n);){if(wx(Lf(n,"package.json")))return n;n=$c(n)}return $x(Df,"..","..")}function nt(...n){return Lf(Ex(),...n)}var kx,Df,Ln=se(()=>{"use strict";kx=Sx(import.meta.url),Df=$c(kx)});import mn from"fs";import Yi from"path";import{fileURLToPath as Dx}from"url";function Mx(){let n=Ox;if(mn.readdirSync(n).some(i=>i.match(/^\d{3}_.*\.sql$/)))return n;let r=Yi.resolve(n,"../../data/migrations");return mn.existsSync(r)&&mn.readdirSync(r).some(i=>i.match(/^\d{3}_.*\.sql$/))?r:n}function jx(n){n.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
3
|
-
version
|
|
4
|
-
name
|
|
5
|
-
applied_at REAL
|
|
3
|
+
version INTEGER PRIMARY KEY,
|
|
4
|
+
name TEXT NOT NULL,
|
|
5
|
+
applied_at REAL DEFAULT (unixepoch())
|
|
6
6
|
);
|
|
7
|
-
`)}function
|
|
7
|
+
`)}function Fx(n){jx(n);let e=n.prepare("SELECT version FROM schema_migrations ORDER BY version").all();return new Set(e.map(r=>r.version))}function Ux(n){return mn.readdirSync(n).filter(r=>r.match(/^\d{3}_.*\.sql$/)&&!r.startsWith("000_")).sort().map(r=>{let i=r.match(/^(\d{3})_(.+)\.sql$/),t=parseInt(i[1],10),o=i[2],a=mn.readFileSync(Yi.join(n,r),"utf-8").split(/^-- DOWN$/m);return{version:t,name:o,up:a[0].trim(),down:a[1]?.trim()}})}function Zx(n,e){Mt.info({version:e.version,name:e.name},"Applying migration"),n.transaction(()=>{n.exec(e.up),n.prepare("INSERT INTO schema_migrations (version, name) VALUES (?, ?)").run(e.version,e.name)})(),Mt.info({version:e.version},"Migration applied successfully")}function Hx(n,e,r){let i=Yi.join(e,"000_baseline.sql");if(!mn.existsSync(i)){Mt.warn("000_baseline.sql not found \u2014 falling back to incremental migrations");return}Mt.info("Fresh database detected \u2014 applying consolidated baseline schema");let t=mn.readFileSync(i,"utf-8");n.transaction(()=>{n.exec(t);let o=n.prepare("INSERT OR IGNORE INTO schema_migrations (version, name) VALUES (?, ?)");for(let s of r)o.run(s.version,s.name)})(),Mt.info({stamped:r.length},"Baseline applied \u2014 incremental migrations stamped")}function Jf(n){let e=Fx(n),r=Mx(),i=Ux(r);if(e.size===0){Hx(n,r,i);return}let t=i.filter(o=>!e.has(o.version));if(t.length===0){Mt.debug("No pending migrations");return}Mt.info({count:t.length},"Running pending migrations");for(let o of t)Zx(n,o);Mt.info("All migrations complete")}var Mt,Lx,Ox,Vf=se(()=>{"use strict";Q();Mt=$.child({module:"migrations"}),Lx=Dx(import.meta.url),Ox=Yi.dirname(Lx)});import Wx from"better-sqlite3";import Xi from"path";import Rc from"fs";import qf from"crypto";import Bx from"os";function eo(n){let e=Bx.homedir(),r=Xi.join(e,".mcp-liquid-shadow"),i=Xi.join(r,"dbs");Rc.existsSync(i)||Rc.mkdirSync(i,{recursive:!0});let t=qf.createHash("sha256").update(n).digest("hex").substring(0,12),s=`${Xi.basename(n).replace(/[^a-zA-Z0-9-_]/g,"_")}_${t}.db`;return Xi.join(i,s)}function Kf(n,e){let r=e||eo(n);Tt.debug({repoPath:n,dbPath:r},"Initializing database");let i=new Wx(r);return i.pragma("journal_mode = WAL"),i.pragma("busy_timeout = 5000"),Jf(i),Qi.set(n,r),jt.set(r,i),Tt.debug({repoPath:n,dbPath:r},"Database initialized successfully"),i}function fn(n){return qf.createHash("sha256").update(n,"utf8").digest("hex")}function Pc(n,e){return e?fn(n)!==e:!0}function ke(n){let e=Qi.get(n)||eo(n),r=jt.get(e);if(r){if(r.open)return r;jt.delete(e)}let i=Kf(n);return jt.set(e,i),i}function rt(n){let e=eo(n);if(!Rc.existsSync(e))return!1;try{let r=ke(n);return r.prepare(`
|
|
8
8
|
SELECT value FROM index_metadata
|
|
9
9
|
WHERE key = 'index_completed'
|
|
10
|
-
`).get()?.value==="true"?!0:r.prepare("SELECT COUNT(*) as count FROM files").get().count>0}catch(r){return
|
|
10
|
+
`).get()?.value==="true"?!0:r.prepare("SELECT COUNT(*) as count FROM files").get().count>0}catch(r){return Tt.debug({repoPath:n,error:r},"Error checking index status"),!1}}function to(n,e){let r=ke(n),i=r.prepare("INSERT OR REPLACE INTO index_metadata (key, value, updated_at) VALUES (?, ?, unixepoch())");r.transaction(()=>{i.run("index_completed","true"),i.run("last_indexed_at",Date.now().toString()),e&&i.run("last_indexed_commit",e)})(),Tt.debug({repoPath:n,commitSha:e},"Repository marked as indexed")}function jr(n){try{return ke(n).prepare(`
|
|
11
11
|
SELECT value FROM index_metadata
|
|
12
12
|
WHERE key = 'last_indexed_commit'
|
|
13
|
-
`).get()?.value||null}catch(e){return
|
|
13
|
+
`).get()?.value||null}catch(e){return Tt.debug({repoPath:n,error:e},"Error getting last indexed commit"),null}}function Nc(n){let e=Qi.get(n)||eo(n),r=jt.get(e);r&&(r.open&&(Tt.debug({repoPath:n,dbPath:e},"Closing database connection"),r.close()),jt.delete(e)),Qi.delete(n)}function Yf(){for(let[n,e]of jt.entries())try{e.open&&(Tt.debug({dbPath:n},"Closing database connection"),e.close())}catch(r){Tt.error({dbPath:n,err:r},"Error closing database execution")}jt.clear()}var Tt,jt,Qi,Xf,ft=se(()=>{"use strict";Q();Vf();Tt=$.child({module:"db"});jt=new Map,Qi=new Map;process.on("exit",()=>Yf());Xf=n=>{Tt.debug({signal:n},"Received termination signal, closing databases"),Yf(),process.exit(0)};process.on("SIGINT",()=>Xf("SIGINT"));process.on("SIGTERM",()=>Xf("SIGTERM"))});var _e,ht=se(()=>{"use strict";_e=class{db;constructor(e){this.db=e}get database(){return this.db}all(e,...r){return this.db.prepare(e).all(...r)}get(e,...r){return this.db.prepare(e).get(...r)}run(e,...r){return this.db.prepare(e).run(...r).changes}insert(e,...r){return this.db.prepare(e).run(...r).lastInsertRowid}transaction(e){return this.db.transaction(e)()}}});function gS(n,e){if(!n)return!1;let r=n.trim();return!r||hS.has(r.toLowerCase())||e.has(r)?!1:/^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(r)}function yS(n){return n.split(/[,|&]/).map(e=>e.trim()).filter(Boolean)}function bS(n){let e=n.replace(/^[({\[]+/,"").replace(/[)}\]]+$/,"").replace(/^readonly\s+/,"").trim();return e&&e.match(/^([A-Za-z_$][A-Za-z0-9_$.]*)/)?.[1]||null}function vS(n){let e=[],r=0,i="",t=!1;for(let o of n){if(o==="<"&&(r++,r===1)){t=!0,i="";continue}if(o===">"&&(r>0&&r--,r===0&&t)){t=!1,i.trim()&&e.push(i),i="";continue}t&&(i+=o)}return e}function _S(n){let e=new Set;for(let r of n){let i=r.split(",").map(t=>t.trim());for(let t of i){let o=t.match(/^([A-Za-z_$][A-Za-z0-9_$]*)/);o?.[1]&&e.add(o[1])}}return e}function zc(n,e){let r=[];for(let i of yS(n)){let t=bS(i);t&&gS(t,e)&&r.push(t)}return r}function ph(n){if(!n)return[];let e=n.replace(/\s+/g," ").trim();if(!e)return[];let r=vS(e),i=_S(r),t=[],o=new Set,s=(l,u,p)=>{let d=`${l}:${u}`;o.has(d)||(o.add(d),t.push({relationship:l,targetName:u,...p?{metadata:p}:{}}))},a=e.match(/\bextends\s+(.+?)(?=\bimplements\b|\{|=|$)/);if(a?.[1]){let l=zc(a[1],i);for(let u of l)s("extends",u,a[1].trim())}let c=e.match(/\bimplements\s+(.+?)(?=\{|=|$)/);if(c?.[1]){let l=zc(c[1],i);for(let u of l)s("implements",u,c[1].trim())}for(let l of r){let u=/([A-Za-z_$][A-Za-z0-9_$]*)\s+extends\s+([^,>]+)/g,p=null;for(;(p=u.exec(l))!==null;){let d=p[2]?.trim();if(!d)continue;let m=zc(d,i);for(let f of m)s("constrained_by",f,d)}}return t}var hS,dh=se(()=>{"use strict";hS=new Set(["any","unknown","never","void","null","undefined","string","number","boolean","symbol","object","bigint","readonly","keyof","infer","extends","implements","class","interface","type","function","new"])});import xS from"path";var oo,mh=se(()=>{"use strict";ht();dh();oo=class extends _e{findByPath(e){return this.get("SELECT * FROM files WHERE path = ?",e)}findAll(e){let r="SELECT * FROM files ORDER BY path ASC";return e&&(r+=` LIMIT ${e}`),this.all(r)}getAllPaths(){return this.all("SELECT path FROM files").map(r=>r.path)}findInSubPath(e,r){let i=xS.resolve(e,r),t=i.endsWith("/")?i:i+"/";return this.all(`
|
|
14
14
|
SELECT * FROM files
|
|
15
15
|
WHERE (path LIKE ? OR path = ?)
|
|
16
16
|
ORDER BY path ASC
|
|
@@ -25,7 +25,16 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
25
25
|
SELECT * FROM files
|
|
26
26
|
WHERE ${i}
|
|
27
27
|
LIMIT ?
|
|
28
|
-
`,...e.map(t=>`%${t}%`),r)}
|
|
28
|
+
`,...e.map(t=>`%${t}%`),r)}findContentFts(e,r=50){let i=this.buildContentFtsQuery(e);return i?this.all(`
|
|
29
|
+
SELECT
|
|
30
|
+
files.*,
|
|
31
|
+
bm25(content_fts, 0.2, 1.0) AS bm25_rank
|
|
32
|
+
FROM content_fts
|
|
33
|
+
JOIN files ON files.path = content_fts.file_path
|
|
34
|
+
WHERE content_fts MATCH ?
|
|
35
|
+
ORDER BY bm25_rank ASC
|
|
36
|
+
LIMIT ?
|
|
37
|
+
`,i,Math.max(1,Math.min(r,1e3))):[]}getContent(e){return this.get("SELECT content FROM file_content WHERE file_path = ?",e)?.content}findContentByToken(e,r=10){return this.all(`
|
|
29
38
|
SELECT file_path
|
|
30
39
|
FROM content_fts
|
|
31
40
|
WHERE content_fts MATCH ?
|
|
@@ -77,7 +86,7 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
77
86
|
SUBSTR(path, LENGTH(?) + 2) as relPath
|
|
78
87
|
FROM files
|
|
79
88
|
WHERE path LIKE ? || '/%/package.json'
|
|
80
|
-
`,e,e)}deletePaths(e){if(e.length===0)return;let r=this.db.prepare("DELETE FROM files WHERE path = ?");this.db.transaction(t=>{for(let o of t)r.run(o)})(e)}updateMtime(e,r){this.run("UPDATE files SET mtime = ? WHERE path = ?",r,e)}batchSaveIndexResults(e,r,i,t){let o=this.db.prepare("DELETE FROM exports WHERE file_path = ?"),s=this.db.prepare("DELETE FROM imports WHERE file_path = ?"),a=this.db.prepare("DELETE FROM configs WHERE file_path = ?"),c=this.db.prepare("DELETE FROM file_content WHERE file_path = ?"),l=this.db.prepare("DELETE FROM event_synapses WHERE file_path = ?"),u=this.db.prepare("INSERT INTO exports (file_path, name, kind, signature, doc, start_line, end_line, classification, capabilities, parent_id, embedding) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"),
|
|
89
|
+
`,e,e)}deletePaths(e){if(e.length===0)return;let r=this.db.prepare("DELETE FROM files WHERE path = ?");this.db.transaction(t=>{for(let o of t)r.run(o)})(e)}updateMtime(e,r){this.run("UPDATE files SET mtime = ? WHERE path = ?",r,e)}batchSaveIndexResults(e,r,i,t){let o=this.db.prepare("DELETE FROM exports WHERE file_path = ?"),s=this.db.prepare("DELETE FROM imports WHERE file_path = ?"),a=this.db.prepare("DELETE FROM configs WHERE file_path = ?"),c=this.db.prepare("DELETE FROM file_content WHERE file_path = ?"),l=this.db.prepare("DELETE FROM event_synapses WHERE file_path = ?"),u=this.db.prepare("DELETE FROM type_graph_edges WHERE file_path = ?"),p=this.db.prepare("INSERT INTO exports (file_path, name, kind, signature, doc, start_line, end_line, classification, capabilities, parent_id, embedding) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"),d=this.db.prepare("INSERT INTO imports (file_path, module_specifier, imported_symbols, resolved_path) VALUES (?, ?, ?, ?)"),m=this.db.prepare("INSERT INTO configs (file_path, key, value, kind) VALUES (?, ?, ?, ?)"),f=this.db.prepare("INSERT INTO file_content (file_path, content) VALUES (?, ?)"),h=this.db.prepare("INSERT INTO event_synapses (file_path, type, name, direction, line_number, code_snippet) VALUES (?, ?, ?, ?, ?, ?)"),v=this.db.prepare("INSERT INTO type_graph_edges (file_path, source_symbol_id, source_symbol_name, target_symbol_name, relationship, line_number, metadata) VALUES (?, ?, ?, ?, ?, ?, ?)"),y=this.db.prepare(`
|
|
81
90
|
INSERT INTO files (path, mtime, last_scanned_at, classification, summary, embedding, content_hash)
|
|
82
91
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
83
92
|
ON CONFLICT(path) DO UPDATE SET
|
|
@@ -87,7 +96,7 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
87
96
|
summary=excluded.summary,
|
|
88
97
|
embedding=excluded.embedding,
|
|
89
98
|
content_hash=excluded.content_hash
|
|
90
|
-
`),
|
|
99
|
+
`),b=this.db.transaction(x=>{for(let k of x){let{meta:I,exports:N,imports:L,configs:C,events:S,content:R,classification:A,summary:H,embedding:W,contentHash:O}=k;o.run(I.path),s.run(I.path),a.run(I.path),c.run(I.path),l.run(I.path),u.run(I.path);let K=O??(R&&i?i(R):null);if(y.run(I.path,I.mtime,Date.now(),A||"Unknown",H||"",W?JSON.stringify(W):null,K),N){let D=(M,V,J)=>{for(let P of V){let E=P.embedding?JSON.stringify(P.embedding):null,G=p.run(M,P.name,P.kind,P.signature,P.doc||"",P.line,P.endLine||P.line,P.classification||"Other",P.capabilities||"[]",J,E),Y=Number(G.lastInsertRowid);if(Number.isFinite(Y)){let re=ph(P.signature);for(let B of re)B.targetName!==P.name&&v.run(M,Y,P.name,B.targetName,B.relationship,P.line,B.metadata||null)}P.members&&P.members.length>0&&D(M,P.members,G.lastInsertRowid)}};D(I.path,N,null)}if(L)for(let D of L){let M=D.resolved_path!==void 0?D.resolved_path:t?.(D.module,I.path,r)??"";d.run(I.path,D.module,D.name,M)}if(C)for(let D of C)m.run(I.path,D.key,D.value,D.kind);if(R!==void 0&&f.run(I.path,R),S)for(let D of S)h.run(I.path,D.type,D.name,D.direction,D.line,D.snippet)}}),_=500;for(let x=0;x<e.length;x+=_)b(e.slice(x,x+_))}getLatestScanTime(){return this.get("SELECT MAX(last_scanned_at) as t FROM files")?.t||null}buildContentFtsQuery(e){let r=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>=2).slice(0,12);if(r.length===0)return"";if(r.length===1)return`${r[0]}*`;let i=`"${r.join(" ")}"`,t=r.map(o=>`${o}*`).join(" OR ");return`${i} OR ${t}`}}});var so,fh=se(()=>{"use strict";ht();so=class n extends _e{static HTTP_METHOD_EXPORTS=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]);findByNameAndFile(e,r){return this.all("SELECT * FROM exports WHERE file_path = ? AND name = ?",r,e)}findByNameGlobal(e){return this.all("SELECT * FROM exports WHERE name = ?",e)}findAtLine(e,r){return this.get(`
|
|
91
100
|
SELECT * FROM exports
|
|
92
101
|
WHERE file_path = ? AND start_line <= ? AND end_line >= ?
|
|
93
102
|
ORDER BY (end_line - start_line) ASC -- Get innermost symbol
|
|
@@ -116,7 +125,13 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
116
125
|
WHERE (kind = 'HTTP Route' OR classification = 'Service Boundary')
|
|
117
126
|
AND (name LIKE ? OR signature LIKE ?)
|
|
118
127
|
LIMIT ?
|
|
119
|
-
`,`%${e}%`,`%${e}%`,r)}findByFile(e){return this.all("SELECT * FROM exports WHERE file_path = ? ORDER BY start_line ASC",e)}findByFiles(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM exports WHERE file_path IN (${r}) ORDER BY file_path, start_line ASC`,...e)}
|
|
128
|
+
`,`%${e}%`,`%${e}%`,r)}findByFile(e){return this.all("SELECT * FROM exports WHERE file_path = ? ORDER BY start_line ASC",e)}findByFiles(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM exports WHERE file_path IN (${r}) ORDER BY file_path, start_line ASC`,...e)}findWithEmbeddings(e=5e3){return this.all(`
|
|
129
|
+
SELECT *
|
|
130
|
+
FROM exports
|
|
131
|
+
WHERE embedding IS NOT NULL
|
|
132
|
+
ORDER BY file_path, start_line
|
|
133
|
+
LIMIT ?
|
|
134
|
+
`,e)}findSiblings(e){return this.all(`
|
|
120
135
|
SELECT name, kind, signature, start_line, end_line,
|
|
121
136
|
parent_id, id,
|
|
122
137
|
(SELECT name FROM exports WHERE id = e.parent_id) as parent_name
|
|
@@ -178,7 +193,7 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
178
193
|
SELECT * FROM exports
|
|
179
194
|
WHERE lower(name) LIKE ?
|
|
180
195
|
LIMIT ?
|
|
181
|
-
`,`%${e.toLowerCase()}%`,r)}getAllNames(e=5e3){return this.all("SELECT DISTINCT name FROM exports WHERE parent_id IS NULL LIMIT ?",e).map(i=>i.name)}countByFile(e){return this.get("SELECT COUNT(*) as count FROM exports WHERE file_path = ?",e)?.count||0}findDeadExports(e={}){let{limit:r=50,includeTests:i=!1,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=e,c=[];i||(c.push("e.file_path NOT LIKE '%/test/%'"),c.push("e.file_path NOT LIKE '%/tests/%'"),c.push("e.file_path NOT LIKE '%/__tests__/%'"),c.push("e.file_path NOT LIKE '%.spec.%'"),c.push("e.file_path NOT LIKE '%.test.%'")),t||(c.push("e.file_path NOT LIKE '%/migrations/%'"),c.push("e.file_path NOT LIKE '%/migration/%'"),c.push("e.file_path NOT LIKE '%Migration.%'")),o||(c.push("e.file_path NOT LIKE '%/__fixtures__/%'"),c.push("e.file_path NOT LIKE '%/__mocks__/%'"),c.push("e.file_path NOT LIKE '%/fixtures/%'"),c.push("e.file_path NOT LIKE '%/mocks/%'"),c.push("e.file_path NOT LIKE '%.fixture.%'"),c.push("e.file_path NOT LIKE '%.mock.%'"));for(let
|
|
196
|
+
`,`%${e.toLowerCase()}%`,r)}getAllNames(e=5e3){return this.all("SELECT DISTINCT name FROM exports WHERE parent_id IS NULL LIMIT ?",e).map(i=>i.name)}countByFile(e){return this.get("SELECT COUNT(*) as count FROM exports WHERE file_path = ?",e)?.count||0}findDeadExports(e={}){let{limit:r=50,includeTests:i=!1,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=e,c=[];i||(c.push("e.file_path NOT LIKE '%/test/%'"),c.push("e.file_path NOT LIKE '%/tests/%'"),c.push("e.file_path NOT LIKE '%/__tests__/%'"),c.push("e.file_path NOT LIKE '%.spec.%'"),c.push("e.file_path NOT LIKE '%.test.%'")),t||(c.push("e.file_path NOT LIKE '%/migrations/%'"),c.push("e.file_path NOT LIKE '%/migration/%'"),c.push("e.file_path NOT LIKE '%Migration.%'")),o||(c.push("e.file_path NOT LIKE '%/__fixtures__/%'"),c.push("e.file_path NOT LIKE '%/__mocks__/%'"),c.push("e.file_path NOT LIKE '%/fixtures/%'"),c.push("e.file_path NOT LIKE '%/mocks/%'"),c.push("e.file_path NOT LIKE '%.fixture.%'"),c.push("e.file_path NOT LIKE '%.mock.%'"));for(let f of s){let h=f.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_");c.push(`e.file_path NOT LIKE '${h}'`)}let l=c.length>0?`AND ${c.join(" AND ")}`:"",d=this.all(`
|
|
182
197
|
SELECT e.name, e.kind, e.file_path, e.start_line
|
|
183
198
|
FROM exports e
|
|
184
199
|
WHERE e.kind IN (
|
|
@@ -188,11 +203,18 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
188
203
|
)
|
|
189
204
|
AND e.parent_id IS NULL
|
|
190
205
|
${l}
|
|
191
|
-
AND NOT EXISTS (
|
|
206
|
+
AND NOT EXISTS (
|
|
207
|
+
SELECT 1
|
|
208
|
+
FROM imports i
|
|
209
|
+
WHERE REPLACE(i.imported_symbols, ' ', '') = e.name
|
|
210
|
+
OR REPLACE(i.imported_symbols, ' ', '') LIKE e.name || ',%'
|
|
211
|
+
OR REPLACE(i.imported_symbols, ' ', '') LIKE '%,' || e.name
|
|
212
|
+
OR REPLACE(i.imported_symbols, ' ', '') LIKE '%,' || e.name || ',%'
|
|
213
|
+
)
|
|
192
214
|
AND NOT EXISTS (SELECT 1 FROM imports i WHERE i.resolved_path = e.file_path AND i.imported_symbols LIKE '%*%')
|
|
193
215
|
ORDER BY e.file_path, e.start_line
|
|
194
216
|
LIMIT ?
|
|
195
|
-
`,r*2).map(
|
|
217
|
+
`,r*2).filter(f=>!this.isFrameworkEntrypointExport(f)).map(f=>{let{confidence:h,reason:v}=this.scoreDeadExportConfidence(f);return{...f,confidence:h,reason:v}}),m=d;return a==="high"?m=d.filter(f=>f.confidence==="high"):a==="medium"&&(m=d.filter(f=>f.confidence==="high"||f.confidence==="medium")),m.slice(0,r)}scoreDeadExportConfidence(e){let r=e.file_path.toLowerCase(),i=e.name;return r.includes("/index.")||r.endsWith("index.ts")||r.endsWith("index.js")?{confidence:"low",reason:"Barrel/index file - likely re-export"}:e.kind==="TsInterfaceDeclaration"||e.kind==="TsTypeAliasDeclaration"?{confidence:"medium",reason:"Type definition - may be used externally"}:r.includes("/entry/")||r.includes("/bin/")||r.includes("main.")||r.includes("server.")||r.includes("cli.")?{confidence:"medium",reason:"Entry point - may be invoked externally"}:(r.includes("/components/")||r.endsWith(".tsx")||r.endsWith(".jsx"))&&/^[A-Z][A-Za-z0-9_]*$/.test(i)?{confidence:"medium",reason:"Component export - may be used by runtime composition"}:(r.includes("/contexts/")||r.includes("/context/"))&&(/Provider$/.test(i)||i.startsWith("use"))?{confidence:"medium",reason:"Context/provider export - may be wired dynamically"}:i.startsWith("create")||i.endsWith("Factory")||i.endsWith("Builder")?{confidence:"medium",reason:"Factory/builder pattern - may be used dynamically"}:i.startsWith("use")&&i.length>3?{confidence:"medium",reason:"Hook pattern - may be used in components"}:{confidence:"high",reason:"No detected usage"}}isFrameworkEntrypointExport(e){let i=e.file_path.toLowerCase().replace(/\\/g,"/"),t=e.name;return!!(/(^|\/)(src\/)?app\/.*\/route\.(t|j)sx?$/.test(i)&&n.HTTP_METHOD_EXPORTS.has(t)||/(^|\/)(src\/)?app\/.*\/(page|layout|loading|error|not-found|default|template)\.(t|j)sx?$/.test(i)||/(^|\/)(src\/)?middleware\.(t|j)sx?$/.test(i)||i.includes("/routes/")&&["loader","action","meta","headers"].includes(t))}getGravityMap(e=[],r){let i={},t=`
|
|
196
218
|
SELECT ws.symbol_id, m.name as mission_name, m.status
|
|
197
219
|
FROM working_set ws
|
|
198
220
|
JOIN missions m ON ws.mission_id = m.id
|
|
@@ -221,7 +243,33 @@ var T_=Object.defineProperty;var pe=(n,e)=>()=>(n&&(e=n(n=0)),e);var Me=(n,e)=>{
|
|
|
221
243
|
OR name LIKE ?
|
|
222
244
|
OR name LIKE ?
|
|
223
245
|
LIMIT 10
|
|
224
|
-
`,e,`%.${e}`,`%::${e}`)}}
|
|
246
|
+
`,e,`%.${e}`,`%::${e}`)}findTypeGraphEdges(e,r={}){let{filePath:i,direction:t="both",relationship:o,limit:s=50}=r,a=Math.max(1,Math.min(s,500)),c=[];if(t==="both"||t==="outbound"){let l=`
|
|
247
|
+
SELECT
|
|
248
|
+
id,
|
|
249
|
+
file_path,
|
|
250
|
+
source_symbol_id,
|
|
251
|
+
source_symbol_name,
|
|
252
|
+
target_symbol_name,
|
|
253
|
+
relationship,
|
|
254
|
+
line_number,
|
|
255
|
+
metadata,
|
|
256
|
+
'outbound' AS direction
|
|
257
|
+
FROM type_graph_edges
|
|
258
|
+
WHERE source_symbol_name = ?
|
|
259
|
+
`,u=[e];i&&(l+=" AND file_path = ?",u.push(i)),o&&(l+=" AND relationship = ?",u.push(o)),l+=" ORDER BY file_path ASC, line_number ASC, target_symbol_name ASC LIMIT ?",u.push(a),c.push(...this.all(l,...u))}if(t==="both"||t==="inbound"){let l=`
|
|
260
|
+
SELECT
|
|
261
|
+
id,
|
|
262
|
+
file_path,
|
|
263
|
+
source_symbol_id,
|
|
264
|
+
source_symbol_name,
|
|
265
|
+
target_symbol_name,
|
|
266
|
+
relationship,
|
|
267
|
+
line_number,
|
|
268
|
+
metadata,
|
|
269
|
+
'inbound' AS direction
|
|
270
|
+
FROM type_graph_edges
|
|
271
|
+
WHERE target_symbol_name = ?
|
|
272
|
+
`,u=[e];o&&(l+=" AND relationship = ?",u.push(o)),l+=" ORDER BY file_path ASC, line_number ASC, source_symbol_name ASC LIMIT ?",u.push(a),c.push(...this.all(l,...u))}return c.slice(0,a)}findTypeGraphEdgesBySymbolId(e,r={}){let i=this.findById(e);return i?this.findTypeGraphEdges(i.name,{...r,filePath:i.file_path}):[]}}});var hh,gh=se(()=>{"use strict";hh=`
|
|
225
273
|
WITH RECURSIVE dependency_chain AS (
|
|
226
274
|
-- Base case: Direct dependents of the target symbol
|
|
227
275
|
-- Meaning: Files that import the file where the symbol is defined
|
|
@@ -272,7 +320,7 @@ SELECT DISTINCT
|
|
|
272
320
|
dc.imported_symbols
|
|
273
321
|
FROM dependency_chain dc
|
|
274
322
|
ORDER BY dc.depth, dc.consumer_path;
|
|
275
|
-
`});var
|
|
323
|
+
`});var ao,yh=se(()=>{"use strict";ht();gh();ao=class extends _e{findByFile(e){return this.all("SELECT * FROM imports WHERE file_path = ?",e)}findByFiles(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM imports WHERE file_path IN (${r}) ORDER BY file_path`,...e)}getAllResolved(){return this.all(`
|
|
276
324
|
SELECT * FROM imports
|
|
277
325
|
WHERE resolved_path IS NOT NULL AND resolved_path != ''
|
|
278
326
|
`)}findDependents(e){return this.all("SELECT * FROM imports WHERE resolved_path = ?",e)}countByFile(e){return this.get("SELECT COUNT(*) as count FROM imports WHERE file_path = ?",e)?.count||0}countDependents(e){return this.get("SELECT COUNT(*) as count FROM imports WHERE resolved_path = ?",e)?.count||0}getImportsForFile(e){return this.all("SELECT module_specifier, imported_symbols, resolved_path FROM imports WHERE file_path = ?",e)}findImportSource(e,r){return this.get(`
|
|
@@ -298,7 +346,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
298
346
|
SELECT COUNT(*) as count FROM imports
|
|
299
347
|
WHERE resolved_path IN (${i})
|
|
300
348
|
AND (imported_symbols LIKE ? OR imported_symbols = '' OR imported_symbols = '*')
|
|
301
|
-
`,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(
|
|
349
|
+
`,...e,`%${r}%`)?.count||0}findImpactDependents(e,r,i){return this.all(hh,e,r,i,r)}getCount(){return this.get("SELECT COUNT(*) as count FROM imports")?.count||0}}});import{Worker as SS}from"node:worker_threads";import{cpus as $S}from"node:os";import{fileURLToPath as wS}from"node:url";import{dirname as kS,join as bh}from"node:path";import{existsSync as vh}from"node:fs";function ES(){if(xh.endsWith(".ts")){let e=bh(_h,"worker.ts");if(vh(e))return e}let n=bh(_h,"worker.js");return vh(n)?n:nt("dist/logic/domain/embeddings/worker.js")}function gn(n){return Un||(Un=new Zn(n)),Un}async function Ur(){Un&&(await Un.shutdown(),Un=null)}var xh,_h,Zn,Un,Sh=se(()=>{"use strict";Q();Ln();xh=wS(import.meta.url),_h=kS(xh);Zn=class{workers=[];taskQueue=[];pendingTasks=new Map;taskIdCounter=0;initialized=!1;initPromise;shutdownRequested=!1;numWorkers;cacheDir;initTimeout;constructor(e={}){this.numWorkers=e.numWorkers??Math.max(1,Math.min(2,$S().length-1)),this.cacheDir=e.cacheDir??"./.cache",this.initTimeout=e.initTimeout??6e4}async initialize(){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=this._doInitialize(),this.initPromise)}async _doInitialize(){let e;try{$.info({numWorkers:this.numWorkers},"Initializing embedding worker pool");let r=new Promise((i,t)=>{e=setTimeout(()=>t(new Error(`Worker pool initialization timed out after ${this.initTimeout}ms`)),this.initTimeout)});if(await Promise.race([this._initializeWorkers(),r]),e&&clearTimeout(e),this.shutdownRequested){this.initialized=!1,this.initPromise=void 0,$.debug("Initialization completed but shutdown was requested");return}this.initialized=!0,$.info({numWorkers:this.workers.length},"Embedding worker pool ready")}catch(r){throw e&&clearTimeout(e),this.initPromise=void 0,this.initialized=!1,await this.shutdown(),r}}async _initializeWorkers(){let e=ES();$.debug({workerPath:e},"Resolved worker path");let r=[];for(let i=0;i<this.numWorkers;i++)i>0&&await new Promise(t=>setTimeout(t,25)),r.push(this.createWorker(e,i));await Promise.all(r)}async createWorker(e,r){return new Promise((i,t)=>{let o=setTimeout(()=>{t(new Error(`Worker ${r} initialization timed out`))},this.initTimeout),s=new SS(e,{workerData:{cacheDir:this.cacheDir},execArgv:process.execArgv}),a={worker:s,busy:!1,currentTaskId:null};s.on("message",c=>{if(c.type==="ready"){if(clearTimeout(o),this.shutdownRequested){$.debug({workerIndex:r},"Worker ready but shutdown requested, terminating"),s.terminate().catch(()=>{}),i();return}this.workers.push(a),$.debug({workerIndex:r},"Worker ready"),i()}else c.type==="result"&&c.id?this.handleTaskComplete(a,c.id,c.embeddings||[]):c.type==="error"&&c.id&&this.handleTaskError(a,c.id,new Error(c.error||"Unknown error"))}),s.on("error",c=>{if(clearTimeout(o),$.error({err:c,workerIndex:r},"Worker error"),a.currentTaskId&&this.handleTaskError(a,a.currentTaskId,c),!this.initialized){t(c);return}let l=this.workers.indexOf(a);l!==-1&&this.workers.splice(l,1),!this.shutdownRequested&&this.initialized&&this.createWorker(e,r).catch(u=>{$.error({err:u},"Failed to replace crashed worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&$.warn({workerIndex:r,code:c},"Worker exited unexpectedly")})})}handleTaskComplete(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.resolve(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}handleTaskError(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.reject(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}processQueue(){if(this.taskQueue.length===0)return;let e=this.workers.find(i=>!i.busy);if(!e)return;let r=this.taskQueue.shift();r&&(e.busy=!0,e.currentTaskId=r.id,this.pendingTasks.set(r.id,r),e.worker.postMessage({type:"embed",id:r.id,texts:r.texts}))}async generateEmbeddings(e,r=128,i){if(this.initialized||await this.initialize(),e.length===0)return[];let t=[];for(let l=0;l<e.length;l+=r)t.push(e.slice(l,l+r));let o=new Array(t.length),s=0,a=t.map((l,u)=>new Promise((p,d)=>{let f={id:`task_${++this.taskIdCounter}`,texts:l,resolve:h=>{if(o[u]=h,s++,i){let v=Math.min(s*r,e.length);i(v,e.length)}p()},reject:h=>{if(o[u]=new Array(l.length).fill(null),s++,$.warn({err:h,chunkIndex:u},"Chunk embedding failed"),i){let v=Math.min(s*r,e.length);i(v,e.length)}p()}};this.taskQueue.push(f),this.processQueue()}));await Promise.all(a);let c=[];for(let l of o)c.push(...l);return $.info({total:e.length,successful:c.filter(l=>l!==null).length,workers:this.workers.length},"Parallel embedding generation complete"),c}get workerCount(){return this.workers.length}get busyWorkers(){return this.workers.filter(e=>e.busy).length}get queueSize(){return this.taskQueue.length}get isInitialized(){return this.initialized}async shutdown(){if(this.shutdownRequested=!0,this.initPromise)try{await this.initPromise}catch{}if(!this.initialized&&this.workers.length===0){this.shutdownRequested=!1,this.initPromise=void 0;return}$.info({numWorkers:this.workers.length},"Shutting down embedding worker pool");let e=this.workers.map(r=>new Promise(i=>{r.worker.postMessage({type:"shutdown"}),r.worker.once("exit",()=>i()),setTimeout(()=>{r.worker.terminate().then(()=>i())},5e3)}));await Promise.all(e),this.workers=[],this.taskQueue=[],this.pendingTasks.clear(),this.initialized=!1,this.shutdownRequested=!1,$.info("Embedding worker pool shutdown complete")}},Un=null});var gt={};Ze(gt,{EmbeddingPriorityQueue:()=>lo,EmbeddingWorkerPool:()=>Zn,cosineSimilarity:()=>Br,generateEmbedding:()=>uo,generateEmbeddingsBatch:()=>po,getDefaultPool:()=>gn,setUseWorkerThreads:()=>Wr,shutdownDefaultPool:()=>Ur});async function IS(){return Zr||(Zr=await import("@xenova/transformers"),Zr.env.cacheDir="./.cache",Zr.env.allowLocalModels=!0),Zr}function Wr(n){Ac=n,$.info({useWorkerThreads:n},"Worker thread mode updated")}function $h(n=!1){let e=(Hr||"").toLowerCase(),r={};return Hr&&(r.dtype=Hr),n?(r.quantized=!1,r):(e==="fp32"||e==="fp16"||e==="float32"||e==="float16"?r.quantized=!1:e.startsWith("q")&&(r.quantized=!0),r)}async function TS(){$.info({model:co,dtype:Hr},"Loading embedding model...");let{pipeline:n}=await IS(),e=$h(!1);try{return await n("feature-extraction",co,e)}catch(r){let i=r?.message||"";if(!(i.includes("/onnx/model_quantized.onnx")||i.includes("model_quantized.onnx")))throw r;return $.warn({model:co,dtype:Hr},"Quantized ONNX artifact missing, retrying with unquantized ONNX"),await n("feature-extraction",co,$h(!0))}}async function kh(){return Cc||(Cc=TS()),Cc}async function uo(n){try{let r=await(await kh())(n,{pooling:"mean",normalize:!0});return Array.from(r.data)}catch(e){return $.error({err:e},"Failed to generate embedding"),null}}async function po(n,e=wh,r){return n.length===0?[]:Ac?gn().generateEmbeddings(n,e,r):Eh(n,e,r)}async function Eh(n,e,r){let i=new Array(n.length).fill(null),t=await kh();for(let o=0;o<n.length;o+=e){let s=Math.min(o+e,n.length),a=n.slice(o,s);try{let c=await t(a,{pooling:"mean",normalize:!0}),[l,u]=c.dims;for(let p=0;p<l;p++){let d=p*u,m=d+u;i[o+p]=Array.from(c.data.slice(d,m))}}catch(c){$.error({err:c,batchStart:o,batchEnd:s},"Single-threaded batch embedding failed, falling back to sequential for this chunk");for(let l=0;l<a.length;l++)try{let u=a[l];if(!u||u.trim().length===0)continue;let p=await t(u,{pooling:"mean",normalize:!0});i[o+l]=Array.from(p.data)}catch{i[o+l]=null}}r&&r(s,n.length)}return $.debug({total:n.length,successful:i.filter(o=>o!==null).length},"Batch embedding complete"),i}function Br(n,e){let r=0,i=0,t=0;for(let o=0;o<n.length;o++)r+=n[o]*e[o],i+=n[o]*n[o],t+=e[o]*e[o];return r/(Math.sqrt(i)*Math.sqrt(t))}var co,Hr,Zr,wh,Ac,Cc,lo,Oe=se(()=>{"use strict";Q();Sh();co=process.env.EMBEDDING_MODEL??"Xenova/all-MiniLM-L6-v2",Hr=process.env.EMBEDDING_DTYPE??"fp32",Zr=null;wh=128,Ac=!1;Cc=null;lo=class{queue=[];processing=!1;results=new Map;enqueue(e){this.queue.push(e),this.queue.sort((r,i)=>i.priority-r.priority)}enqueueMany(e){this.queue.push(...e),this.queue.sort((r,i)=>i.priority-r.priority)}get size(){return this.queue.length}get isProcessing(){return this.processing}getResult(e){return this.results.get(e)}async processQueue(e=wh,r){if(this.processing)return $.warn("Queue processing already in progress"),this.results;this.processing=!0;let i=this.queue.length;try{Ac?await this.processQueueParallel(e,i,r):await this.processQueueSequential(e,i,r)}finally{this.processing=!1}return this.results}async processQueueSequential(e,r,i){for(;this.queue.length>0;){let t=this.queue.splice(0,e),o=t.map(a=>a.text),s=await Eh(o,o.length);if(t.forEach((a,c)=>{this.results.set(a.id,s[c])}),i){let a=r-this.queue.length;i(a,r)}}}async processQueueParallel(e,r,i){let t=this.queue.splice(0),o=t.map(c=>c.text),a=await gn().generateEmbeddings(o,e,(c,l)=>{i&&i(c,l)});t.forEach((c,l)=>{this.results.set(c.id,a[l])})}clear(){this.queue=[],this.results.clear()}}});var Gr,Dc=se(()=>{"use strict";ht();Gr=class extends _e{findById(e){return this.get("SELECT * FROM missions WHERE id = ?",e)}findByIds(e){if(e.length===0)return[];let r=e.map(()=>"?").join(", ");return this.all(`SELECT * FROM missions WHERE id IN (${r})`,...e)}findActive(e){let r="SELECT * FROM missions WHERE status IN ('in-progress', 'planned', 'verifying')",i=[];return e&&(r+=" AND git_branch = ?",i.push(e)),r+=` ORDER BY
|
|
302
350
|
CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
|
|
303
351
|
created_at ASC`,this.all(r,...i)}findAll(e){let r="SELECT * FROM missions",i=[];return e&&(r+=" WHERE status = ?",i.push(e)),r+=` ORDER BY
|
|
304
352
|
CASE WHEN status = 'in-progress' THEN 0 WHEN status = 'verifying' THEN 1 ELSE 2 END,
|
|
@@ -310,7 +358,43 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
310
358
|
`,e)}create(e){return this.insert(`
|
|
311
359
|
INSERT INTO missions (name, goal, strategy_graph, status, git_branch, commit_sha, parent_id, verification_context, outcome_contract)
|
|
312
360
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
313
|
-
`,e.name,e.goal,e.strategy_graph,e.status,e.git_branch,e.commit_sha,e.parent_id,e.verification_context,e.outcome_contract)}addArtifact(e,r,i,t){this.run("INSERT INTO mission_artifacts (mission_id, type, identifier, metadata) VALUES (?, ?, ?, ?)",e,r,i,t?JSON.stringify(t):null)}getArtifacts(e){return this.all("SELECT * FROM mission_artifacts WHERE mission_id = ?",e)}update(e,r){let i=Object.keys(r);if(i.length===0)return;let t=i.map(s=>`${s} = ?`).join(", "),o=Object.values(r);o.push(e),this.run(`UPDATE missions SET ${t}, updated_at = unixepoch() WHERE id = ?`,...o)}updateStatus(e,r,i){i?this.run("UPDATE missions SET status = ?, updated_at = unixepoch(), commit_sha = ? WHERE id = ?",r,i,e):this.run("UPDATE missions SET status = ?, updated_at = unixepoch() WHERE id = ?",r,e)}getWorkingSet(e){
|
|
361
|
+
`,e.name,e.goal,e.strategy_graph,e.status,e.git_branch,e.commit_sha,e.parent_id,e.verification_context,e.outcome_contract)}addArtifact(e,r,i,t){this.run("INSERT INTO mission_artifacts (mission_id, type, identifier, metadata) VALUES (?, ?, ?, ?)",e,r,i,t?JSON.stringify(t):null)}getArtifacts(e){return this.all("SELECT * FROM mission_artifacts WHERE mission_id = ?",e)}update(e,r){let i=Object.keys(r);if(i.length===0)return;let t=i.map(s=>`${s} = ?`).join(", "),o=Object.values(r);o.push(e),this.run(`UPDATE missions SET ${t}, updated_at = unixepoch() WHERE id = ?`,...o)}updateStatus(e,r,i){i?this.run("UPDATE missions SET status = ?, updated_at = unixepoch(), commit_sha = ? WHERE id = ?",r,i,e):this.run("UPDATE missions SET status = ?, updated_at = unixepoch() WHERE id = ?",r,e)}getWorkingSet(e){let r=this.all(`
|
|
362
|
+
SELECT file_path, type, source_priority, created_at
|
|
363
|
+
FROM (
|
|
364
|
+
SELECT
|
|
365
|
+
ws.file_path,
|
|
366
|
+
COALESCE(ws.type, 'file') AS type,
|
|
367
|
+
0 AS source_priority,
|
|
368
|
+
ws.created_at
|
|
369
|
+
FROM working_set ws
|
|
370
|
+
WHERE ws.mission_id = ?
|
|
371
|
+
|
|
372
|
+
UNION ALL
|
|
373
|
+
|
|
374
|
+
SELECT
|
|
375
|
+
il.file_path,
|
|
376
|
+
'intent' AS type,
|
|
377
|
+
1 AS source_priority,
|
|
378
|
+
il.created_at
|
|
379
|
+
FROM intent_logs il
|
|
380
|
+
WHERE il.mission_id = ?
|
|
381
|
+
AND il.file_path IS NOT NULL
|
|
382
|
+
|
|
383
|
+
UNION ALL
|
|
384
|
+
|
|
385
|
+
SELECT
|
|
386
|
+
e.file_path,
|
|
387
|
+
'symbol' AS type,
|
|
388
|
+
2 AS source_priority,
|
|
389
|
+
il.created_at
|
|
390
|
+
FROM intent_logs il
|
|
391
|
+
JOIN exports e ON e.id = il.symbol_id
|
|
392
|
+
WHERE il.mission_id = ?
|
|
393
|
+
AND e.file_path IS NOT NULL
|
|
394
|
+
)
|
|
395
|
+
WHERE file_path IS NOT NULL
|
|
396
|
+
ORDER BY source_priority ASC, created_at DESC, file_path ASC
|
|
397
|
+
`,e,e,e),i=new Map;for(let t of r)!t.file_path||i.has(t.file_path)||i.set(t.file_path,{file_path:t.file_path,type:t.type||"file"});return[...i.values()]}clearWorkingSet(e){this.run("DELETE FROM working_set WHERE mission_id = ?",e)}addToWorkingSet(e,r,i="file"){this.run("INSERT OR IGNORE INTO files (path, mtime, last_scanned_at) VALUES (?, unixepoch(), unixepoch())",r),this.run("INSERT INTO working_set (mission_id, file_path, type) VALUES (?, ?, ?)",e,r,i)}findColdMissions(e,r=10){return this.all(`
|
|
314
398
|
SELECT m.id, COUNT(il.id) as log_count
|
|
315
399
|
FROM missions m
|
|
316
400
|
LEFT JOIN intent_logs il ON il.mission_id = m.id
|
|
@@ -328,9 +412,9 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
328
412
|
SELECT AVG(updated_at - created_at) AS avg_duration
|
|
329
413
|
FROM missions
|
|
330
414
|
WHERE status = 'completed' AND updated_at > created_at
|
|
331
|
-
`),t=i?.avg_duration!=null?Math.round(i.avg_duration):null,o=Math.floor(Date.now()/1e3)-168*3600,s=Math.floor(Date.now()/1e3)-720*3600,a=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",o),c=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",s),l=a?.n??0,u=c?.n??0,p=`${l} completed in last 7 days, ${u} in last 30 days.`;if(t!=null){let d=Math.round(t/60);p+=` Avg mission duration: ${d} min.`}return{completionRate:r,averageDurationSeconds:t,completedLast7Days:l,completedLast30Days:u,velocityNote:p}}suspendByBranch(e){this.run(`UPDATE missions
|
|
415
|
+
`),t=i?.avg_duration!=null?Math.round(i.avg_duration):null,o=Math.floor(Date.now()/1e3)-168*3600,s=Math.floor(Date.now()/1e3)-720*3600,a=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",o),c=this.get("SELECT COUNT(*) AS n FROM missions WHERE status = 'completed' AND updated_at >= ?",s),l=a?.n??0,u=c?.n??0,p=`${l} completed in last 7 days, ${u} in last 30 days.`;if(t!=null){let d=Math.round(t/60);p+=` Avg mission duration: ${d} min.`}return{completionRate:r,averageDurationSeconds:t,completedLast7Days:l,completedLast30Days:u,velocityNote:p}}suspendByBranch(e){return this.run(`UPDATE missions
|
|
332
416
|
SET status = 'suspended', updated_at = unixepoch()
|
|
333
|
-
WHERE git_branch = ? AND status IN ('in-progress', '
|
|
417
|
+
WHERE git_branch = ? AND status IN ('in-progress', 'verifying')`,e)}resumeByBranch(e){return this.run(`UPDATE missions
|
|
334
418
|
SET status = 'in-progress', updated_at = unixepoch()
|
|
335
419
|
WHERE git_branch = ? AND status = 'suspended'`,e)}findMergedMissions(e,r){if(r.length===0)return[];let i=r.filter(o=>o!==e);if(i.length===0)return[];let t=i.map(()=>"?").join(",");return this.all(`SELECT * FROM missions
|
|
336
420
|
WHERE status IN ('in-progress', 'planned', 'verifying', 'suspended')
|
|
@@ -353,7 +437,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
353
437
|
SELECT linked_repo_path, linked_mission_id, relationship, direction
|
|
354
438
|
FROM cross_repo_links
|
|
355
439
|
WHERE mission_id = ?
|
|
356
|
-
`,e)}catch{return[]}}findLastMission(){return this.get("SELECT * FROM missions ORDER BY updated_at DESC, id DESC LIMIT 1")}findActiveByPriority(){return this.get("SELECT * FROM missions WHERE status IN ('in-progress', 'active', 'verifying') ORDER BY CASE WHEN status = 'in-progress' THEN 0 ELSE 1 END, created_at ASC LIMIT 1")}
|
|
440
|
+
`,e)}catch{return[]}}findLastMission(){return this.get("SELECT * FROM missions ORDER BY updated_at DESC, id DESC LIMIT 1")}findActiveByPriority(){return this.get("SELECT * FROM missions WHERE status IN ('in-progress', 'active', 'verifying') ORDER BY CASE WHEN status = 'in-progress' THEN 0 ELSE 1 END, created_at ASC LIMIT 1")}addHandoff(e,r){let i=JSON.stringify(r),t=e??0,o=this.insert("INSERT INTO mission_artifacts (mission_id, type, identifier, metadata) VALUES (?, ?, ?, ?)",t,"handoff",r.kind,i),s=[`[handoff:${r.kind}]`,...r.findings.map(a=>a.statement),...r.risks.map(a=>a.description),...r.gaps].filter(Boolean).join(" ");return Promise.resolve().then(()=>(Oe(),gt)).then(({generateEmbedding:a})=>a(s)).then(a=>{a&&this.run("UPDATE mission_artifacts SET embedding = ? WHERE id = ?",JSON.stringify(a),o)}).catch(()=>{}),o}getHandoffs(e,r,i=20){let t=["type = 'handoff'"],o=[];e!==void 0&&(t.push("mission_id = ?"),o.push(e??0)),r&&(t.push("identifier = ?"),o.push(r));let s=`SELECT * FROM mission_artifacts WHERE ${t.join(" AND ")} ORDER BY created_at DESC LIMIT ?`;return o.push(i),this.all(s,...o)}async findSemanticHandoffs(e,r=5){let{cosineSimilarity:i}=await Promise.resolve().then(()=>(Oe(),gt)),t=this.all("SELECT * FROM mission_artifacts WHERE type = 'handoff' AND embedding IS NOT NULL"),o=[];for(let s of t)try{let a=JSON.parse(s.embedding),c=i(e,a);c>.3&&o.push({...s,similarity:c})}catch{}return o.sort((s,a)=>a.similarity-s.similarity).slice(0,r)}}});var mo,Ih=se(()=>{"use strict";ht();Q();mo=class n extends _e{findByMission(e,r=50){return this.all(`
|
|
357
441
|
SELECT
|
|
358
442
|
id, mission_id, symbol_id, file_path, type, content, confidence,
|
|
359
443
|
symbol_name, signature, commit_sha, is_crystallized, crystal_id,
|
|
@@ -374,7 +458,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
374
458
|
`,e)}create(e){let r=this.insert(`
|
|
375
459
|
INSERT INTO intent_logs (mission_id, symbol_id, file_path, type, content, confidence, symbol_name, signature, commit_sha)
|
|
376
460
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
377
|
-
`,e.mission_id,e.symbol_id,e.file_path,e.type,e.content,e.confidence,e.symbol_name,e.signature,e.commit_sha);return n.EMBEDDABLE_TYPES.has(e.type)&&this.generateAndStoreEmbedding(Number(r),e).catch(i=>{
|
|
461
|
+
`,e.mission_id,e.symbol_id,e.file_path,e.type,e.content,e.confidence,e.symbol_name,e.signature,e.commit_sha);return n.EMBEDDABLE_TYPES.has(e.type)&&this.generateAndStoreEmbedding(Number(r),e).catch(i=>{$.debug({err:i,intentLogId:r},"Failed to generate intent log embedding")}),r}static EMBEDDABLE_TYPES=new Set(["decision","discovery","fix","blocker","note","heritage","crystal"]);static buildEmbeddingText(e){let r=[`[${e.type}]`];return e.symbol_name&&r.push(`symbol: ${e.symbol_name}`),e.file_path&&r.push(`file: ${e.file_path.split("/").pop()}`),r.push(e.content),r.join(" ")}async generateAndStoreEmbedding(e,r){let{generateEmbedding:i}=await Promise.resolve().then(()=>(Oe(),gt)),t=n.buildEmbeddingText(r),o=await i(t);o&&this.run("UPDATE intent_logs SET embedding = ? WHERE id = ?",JSON.stringify(o),e)}findWithEmbeddings(){return this.all("SELECT * FROM intent_logs WHERE embedding IS NOT NULL AND type NOT IN ('system', 'lapsed')")}async findSemanticMatches(e,r,i){let{cosineSimilarity:t}=await Promise.resolve().then(()=>(Oe(),gt)),o=this.findWithEmbeddings();if(o.length>5e3)return $.warn({count:o.length},"Intent log count exceeds brute-force vector scan limit (5000). Skipping semantic recall."),[];let s=[];for(let a of o)if(!(i&&a.symbol_id===i))try{let c=JSON.parse(a.embedding),l=t(e,c);l>.25&&s.push({id:a.id,mission_id:a.mission_id,type:a.type,content:a.content,symbol_name:a.symbol_name,file_path:a.file_path,similarity:l,created_at:a.created_at})}catch{}return s.sort((a,c)=>c.similarity-a.similarity).slice(0,r)}delete(e){this.run("DELETE FROM intent_logs WHERE id = ?",e)}update(e,r){let i=Object.keys(r);if(i.length===0)return;let t=i.map(s=>`${s} = ?`).join(", "),o=Object.values(r);o.push(e),this.run(`UPDATE intent_logs SET ${t} WHERE id = ?`,...o)}findRepairableOrphans(){return this.all(`
|
|
378
462
|
SELECT id, file_path, symbol_name, signature
|
|
379
463
|
FROM intent_logs
|
|
380
464
|
WHERE symbol_id IS NULL AND symbol_name IS NOT NULL
|
|
@@ -398,7 +482,7 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
398
482
|
WHERE id = ?
|
|
399
483
|
`,e)}importHeritage(e,r,i,t){this.run(`
|
|
400
484
|
INSERT INTO intent_logs (type, content, commit_sha, created_at, confidence, mission_id)
|
|
401
|
-
VALUES ('heritage', ?, ?, ?, ?,
|
|
485
|
+
VALUES ('heritage', ?, ?, ?, ?, NULL)
|
|
402
486
|
`,e,r,i,t)}countByType(e){return this.get("SELECT COUNT(*) as count FROM intent_logs WHERE type = ?",e)?.count||0}findRawByMission(e){return this.all(`SELECT
|
|
403
487
|
id, mission_id, symbol_id, file_path, type, content, confidence,
|
|
404
488
|
symbol_name, signature, commit_sha, is_crystallized, crystal_id,
|
|
@@ -437,29 +521,98 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
437
521
|
FROM intent_logs
|
|
438
522
|
WHERE mission_id = ? AND is_crystallized = 0 AND type NOT IN ('adr', 'system', 'crystal', 'lapsed')
|
|
439
523
|
AND created_at > ?
|
|
440
|
-
ORDER BY created_at DESC LIMIT ?`,e,i.created_at,r-1);return[i,...t]}return this.findByMission(e,r)}async
|
|
524
|
+
ORDER BY created_at DESC LIMIT ?`,e,i.created_at,r-1);return[i,...t]}return this.findByMission(e,r)}async findSemanticTheme(e,r,i=200){let{cosineSimilarity:t}=await Promise.resolve().then(()=>(Oe(),gt)),o=this.findWithEmbeddings(),s=[];for(let a of o)if(n.EMBEDDABLE_TYPES.has(a.type)&&!(r&&a.mission_id!==null&&!r.includes(a.mission_id)))try{let c=JSON.parse(a.embedding),l=t(e,c);l>.35&&s.push({...a,_similarity:l})}catch{}return s.sort((a,c)=>c._similarity-a._similarity).slice(0,i).map(({_similarity:a,...c})=>c)}crystallizeTheme(e,r,i){return this.transaction(()=>{let t=this.insert(`INSERT INTO intent_logs (mission_id, type, content, confidence, is_crystallized, symbol_id, file_path, symbol_name, signature, commit_sha)
|
|
525
|
+
VALUES (NULL, 'crystal', ?, 1.0, 0, NULL, NULL, NULL, NULL, NULL)`,i);if(r.length>0){let o=r.map(()=>"?").join(",");this.run(`UPDATE intent_logs SET is_crystallized = 1, crystal_id = ? WHERE id IN (${o})`,t,...r)}return t})}async backfillEmbeddings(e=64,r){let{generateEmbeddingsBatch:i}=await Promise.resolve().then(()=>(Oe(),gt)),t=[...n.EMBEDDABLE_TYPES].map(u=>`'${u}'`).join(","),o=this.all(`SELECT * FROM intent_logs WHERE embedding IS NULL AND type IN (${t})`);if(o.length===0)return 0;let s=o.map(u=>n.buildEmbeddingText(u)),a=await i(s,e,r),c=this.db.prepare("UPDATE intent_logs SET embedding = ? WHERE id = ?"),l=0;return this.transaction(()=>{for(let u=0;u<o.length;u++)a[u]&&(c.run(JSON.stringify(a[u]),o[u].id),l++)}),$.info({total:o.length,embedded:l},"Intent log embedding backfill complete"),l}}});var fo,Th=se(()=>{"use strict";ht();fo=class extends _e{findByKey(e,r=20){return this.all(`
|
|
441
526
|
SELECT file_path, key, value, kind
|
|
442
527
|
FROM configs
|
|
443
528
|
WHERE key LIKE ? OR value LIKE ?
|
|
444
529
|
LIMIT ?
|
|
445
|
-
`,`%${e}%`,`%${e}%`,r)}findByKind(e,r=50){let i="SELECT key, value, kind, file_path FROM configs",t=[];return e&&(i+=" WHERE kind = ?",t.push(e)),i+=" LIMIT ?",t.push(r),this.all(i,...t)}findEnvValue(e){return this.get("SELECT value FROM configs WHERE key LIKE ? OR key = ? LIMIT 1",`%:env:${e}`,e)?.value}countByKind(e){return this.get("SELECT COUNT(*) as count FROM configs WHERE kind = ?",e)?.count||0}getAll(){return this.all("SELECT key, value, kind, file_path FROM configs")}}});var
|
|
530
|
+
`,`%${e}%`,`%${e}%`,r)}findByKind(e,r=50){let i="SELECT key, value, kind, file_path FROM configs",t=[];return e&&(i+=" WHERE kind = ?",t.push(e)),i+=" LIMIT ?",t.push(r),this.all(i,...t)}findEnvValue(e){return this.get("SELECT value FROM configs WHERE key LIKE ? OR key = ? LIMIT 1",`%:env:${e}`,e)?.value}countByKind(e){return this.get("SELECT COUNT(*) as count FROM configs WHERE kind = ?",e)?.count||0}getAll(){return this.all("SELECT key, value, kind, file_path FROM configs")}}});var ho,Rh=se(()=>{"use strict";ht();ho=class extends _e{search(e,r=10){return this.all(`
|
|
446
531
|
SELECT file_path, snippet(content_fts, 1, '<b>', '</b>', '...', 20) as snippet
|
|
447
532
|
FROM content_fts
|
|
448
533
|
WHERE content_fts MATCH ?
|
|
449
534
|
LIMIT ?
|
|
450
|
-
`,e,r)}}});var
|
|
451
|
-
WHERE query LIKE ? ORDER BY created_at DESC LIMIT ?`,`${e}%`,r):this.findRecent(r)}pruneIfNeeded(){(this.get("SELECT COUNT(*) as count FROM search_history")?.count??0)<=
|
|
535
|
+
`,e,r)}}});var Ph,go,Nh=se(()=>{"use strict";ht();Ph=500,go=class extends _e{record(e,r,i=null){this.run("INSERT INTO search_history (query, mode, branch) VALUES (?, ?, ?)",e,r,i),this.pruneIfNeeded()}findRecent(e=20){return this.all("SELECT id, query, mode, branch, created_at FROM search_history ORDER BY created_at DESC LIMIT ?",e)}findRecentByQueryPrefix(e,r=10){return e.trim()?this.all(`SELECT id, query, mode, branch, created_at FROM search_history
|
|
536
|
+
WHERE query LIKE ? ORDER BY created_at DESC LIMIT ?`,`${e}%`,r):this.findRecent(r)}pruneIfNeeded(){(this.get("SELECT COUNT(*) as count FROM search_history")?.count??0)<=Ph||this.run(`DELETE FROM search_history WHERE id NOT IN (
|
|
452
537
|
SELECT id FROM search_history ORDER BY created_at DESC LIMIT ?
|
|
453
|
-
)`,
|
|
538
|
+
)`,Ph)}}});var yo,zh=se(()=>{"use strict";ht();yo=class extends _e{getSection(e){return this.get("SELECT section, data, updated_at FROM hologram_snapshot WHERE section = ?",e)}getAllSections(){return this.all("SELECT section, data, updated_at FROM hologram_snapshot ORDER BY section")}upsertSection(e,r){this.run(`
|
|
454
539
|
INSERT INTO hologram_snapshot (section, data, updated_at)
|
|
455
540
|
VALUES (?, ?, unixepoch())
|
|
456
541
|
ON CONFLICT(section) DO UPDATE SET
|
|
457
542
|
data = excluded.data,
|
|
458
543
|
updated_at = excluded.updated_at
|
|
459
|
-
`,e,r)}deleteSection(e){this.run("DELETE FROM hologram_snapshot WHERE section = ?",e)}deleteAll(){this.run("DELETE FROM hologram_snapshot")}hasSection(e){return(this.get("SELECT COUNT(*) as count FROM hologram_snapshot WHERE section = ?",e)?.count??0)>0}}});var L,X=pe(()=>{"use strict";Et();bf();xf();kf();tc();Df();Of();Af();Cf();jf();L=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=Te(e),s=r.files?.database,a=!r.intentLogs||!r.searchHistory||!r.missions||!r.hologram;if(s===o&&o.open&&!a)return r;this.repositoryCache.delete(e)}let i=Te(e),t={files:new zi(i),exports:new Di(i),imports:new Oi(i),missions:new br(i),intentLogs:new Mi(i),configs:new Ui(i),content:new Fi(i),searchHistory:new Zi(i),hologram:new Hi(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),ec(e)}static clearCache(e){this.repositoryCache.delete(e)}}});var Wi,Bi,Gf,Ji,Vf,qf,Kf,Yf,Xf,Qf,eh,th,nh,rh,Er,Gi,ih,oh,lc=pe(()=>{"use strict";Wi=[/\/pages\/(?!_)[^/]+\.(tsx?|jsx?)$/i,/\/pages\/.*\/index\.(tsx?|jsx?)$/i,/\/app\/.*\/page\.(tsx?|jsx?)$/i,/\/app\/.*\/layout\.(tsx?|jsx?)$/i,/\/app\/api\/.*\/route\.(ts|js)$/i,/\/pages\/api\/.*\.(ts|js)$/i],Bi=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],Gf=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],Ji=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],Vf=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],qf=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],Kf=[/\/commands?\/[^/]+\.(ts|js|py|php)$/i,/\/cli\/[^/]+\.(ts|js|py|php)$/i,/\/bin\/[^/]+\.(ts|js|py|php)$/i,/cli\.(ts|js|py|php)$/i,/main\.(ts|js|py|php)$/i],Yf=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Xf=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],Qf=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],eh=[/\/stores?\//i,/\/slices?\//i,/\/reducers?\//i,/\/atoms?\//i,/\/selectors?\//i,/\.(store|slice|reducer|atom|selector)\.(ts|js)$/i,/.*Slice\.(ts|js)$/i,/.*Store\.(ts|js)$/i],th=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],nh=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],rh=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],Er=[/\.(model|entity|schema|repository|repo|dao|migration|query|mutation|resolver|connection|db)\.(ts|js)$/i,/queries\.(ts|js)$/i,/mutations\.(ts|js)$/i,/resolvers\.(ts|js)$/i,/connection\.(ts|js)$/i,/\/models?\//i,/\/entities?\//i,/\/repositories?\//i,/\/repos?\//i,/\/data\//i,/\/database\//i,/\/prisma\//i,/\/drizzle\//i,/\/api\/.*client\.(ts|js|tsx)$/i,/(^|\/)[A-Z0-9_-]*API\.(tsx?|js|jsx)$/],Gi=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],ih=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],oh=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var Vi,ah,qi,ch,uc=pe(()=>{"use strict";Vi=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],ah=[/views\.py$/i,/forms\.py$/i,/serializers\.py$/i,/admin\.py$/i,/apps\.py$/i,/tasks\.py$/i,/middlewares?\.py$/i,/signals?\.py$/i,/context_processors\.py$/i],qi=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],ch=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var Ki,uh,Yi,ph,pc=pe(()=>{"use strict";Ki=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],uh=[/\/services?\/.*\.php$/i,/\/providers?\/.*\.php$/i,/\/middleware\/.*\.php$/i,/\/jobs?\/.*\.php$/i,/\/listeners?\/.*\.php$/i,/\/events?\/.*\.php$/i,/\/observers?\/.*\.php$/i,/\/console\/commands\/.*\.php$/i,/\/actions?\/.*\.php$/i,/\/traits?\/.*\.php$/i,/\/concerns?\/.*\.php$/i,/\/contracts?\/.*\.php$/i],Yi=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],ph=["laravel","symfony","slim","cakephp","codeigniter"]});import mh from"path";function wn(n,e,r){let i=[],t="Unknown",o=0;r||(r=Cb(n,e));let{inDegree:s,outDegree:a}=r,c=(d,m,f,h)=>{for(let _ of d)if(_.test(n))return i.push(`${h}: ${_.source}`),t=m,o+=f,!0;return!1},l=!1;if(l||(l=c(Wi,"Entry",45,"Next.js entry")),l||(l=c(Vf,"Entry",40,"MCP handler")),l||(l=c(Kf,"Entry",40,"CLI command")),l||(l=c(Er,"Data",45,"Data layer/Repository")),l||(l=c(eh,"Data",35,"State management")),l||(l=c(Gf,"Logic",40,"React component")),l||(l=c(Ji,"Logic",35,"Logic pattern")),l||(l=c(Yf,"Logic",35,"Parser/AST")),l||(l=c(Xf,"Logic",35,"Core module")),l||(l=c(Qf,"Logic",30,"UI layer")),l||(l=c(rh,"Types",35,"Type definition")),l||(l=c(Vi,"Entry",40,"Python Entry")),l||(l=c(qi,"Data",40,"Python Data")),l||(l=c(ah,"Logic",35,"Python Logic")),l||(l=c(Ki,"Entry",40,"PHP Entry")),l||(l=c(Yi,"Data",40,"PHP Data")),l||(l=c(uh,"Logic",35,"PHP Logic")),l||(l=c(th,"Logic",35,"Hook/Context")),!l){for(let d of qf)if(d.test(n)){i.push(`MCP utility: ${d.source}`),/schemas?/i.test(n)?t="Types":/resources?/i.test(n)?t="Data":t="Utility",o+=35,l=!0;break}}l||c(nh,"Data",35,"Schema definition")&&(l=!0),l||(c(Er,"Data",30,"Path matches data pattern")||c(Gi,"Utility",25,"Path matches utility pattern")||c(Bi,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of dc)if(d.test(n)){i.push(`Test file: ${d.source}`),t="Test",o=50,l=!0;break}l||c(mc,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let d of Lb)d.test(n)&&(i.push(`Monorepo component: ${d.source}`),/\/apps\/[^/]+\/src\/pages\//i.test(n)&&(i.push("Monorepo App Entry"),t==="Unknown"&&(t="Entry"),o+=20),/\/packages\/[^/]+\/src\//i.test(n)&&(o+=10));let p=e.imports.getImportsForFile(n).map(d=>d.module_specifier.toLowerCase());for(let d of oh)if(p.some(m=>m.includes(d))){i.push(`Imports JS data library: ${d}`),(t==="Unknown"||t==="Data")&&(t="Data",o+=25);break}for(let d of ch)if(p.some(m=>m.includes(d))){i.push(`Imports Python framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of ph)if(p.some(m=>m.includes(d))){i.push(`Imports PHP framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of ih)if(p.some(m=>m.includes(d))){i.push(`Imports JS framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}if(s===0&&a>0&&(i.push("Entry point: nothing imports this file (in-degree=0)"),t==="Unknown"?(t="Entry",o+=30):t==="Entry"&&(o+=15)),s>5&&a<=2&&(i.push(`High reuse: ${s} files import this (candidate for Utility)`),t==="Unknown"?(t="Utility",o+=25):t==="Utility"&&(o+=10)),t==="Unknown"&&s>0&&a>0){let d=s/(s+a);d>.3&&d<.7&&(i.push(`Balanced traffic: in=${s}, out=${a} (likely Logic layer)`),t="Logic",o+=25)}return t==="Unknown"&&(i.push("No strong classification signals detected"),o=10),o=Math.min(o,100),{layer:t,confidence:o,signals:i}}function Cb(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function De(n,e){let r=n.files.getAllPaths().map(f=>({path:f})),i=new Map,t={Entry:[],Logic:[],Data:[],Utility:[],Infrastructure:[],Test:[],Types:[],Unknown:[]};for(let f of r){let h=wn(f.path,n);i.set(f.path,h),t[h.layer].push({path:f.path,classification:h})}let o={Entry:Nt(t.Entry,e),Logic:Nt(t.Logic,e),Data:Nt(t.Data,e),Utility:Nt(t.Utility,e),Infrastructure:Nt(t.Infrastructure,e),Test:Nt(t.Test,e),Types:Nt(t.Types,e),Unknown:Nt(t.Unknown,e)},s={};r.forEach(f=>{let h=mh.extname(f.path).toLowerCase();h&&(s[h]=(s[h]||0)+1)});let a={".ts":"TypeScript",".tsx":"Typescript (React)",".js":"JavaScript",".jsx":"JavaScript (React)",".py":"Python",".php":"PHP",".go":"Go",".rs":"Rust",".java":"Java",".cs":"C#",".rb":"Ruby",".vue":"Vue"},c={};Object.entries(s).forEach(([f,h])=>{let _=a[f];_&&(c[_]=(c[_]||0)+h)});let l=Object.entries(c).sort((f,h)=>h[1]-f[1]),u=l.length>0?l[0][0]:"Unknown",{pattern:p,patternConfidence:d,insights:m}=jb(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function Nt(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:mh.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function jb(n,e,r){let i=[],t="Unknown",o=0,s=n.Entry.count/e*100,a=n.Logic.count/e*100,c=n.Data.count/e*100,l=n.Utility.count/e*100,u=n.Unknown.count/e*100;s>5&&a>10&&c>5&&u<40?(t="Layered",o=60+Math.min(30,(100-u)/3),i.push(`Clear layer separation: Entry (${s.toFixed(1)}%), Logic (${a.toFixed(1)}%), Data (${c.toFixed(1)}%)`)):l>20?(t="Modular",o=50+l/2,i.push(`High shared module usage: ${l.toFixed(1)}% utility files`)):u>60&&(t="Monolithic",o=40+u/4,i.push(`Limited architectural structure: ${u.toFixed(1)}% files with unclear layer assignment`));let p=r.configs.countByKind("Service");return p>3&&(t="Microservices",o=55+p*5,i.push(`Detected ${p} service definitions (likely microservices)`)),n.Entry.count===0&&i.push("\u26A0\uFE0F No clear entry points detected - consider adding route/controller files"),n.Data.count===0&&i.push("\u26A0\uFE0F No data layer detected - repository may not use traditional ORM patterns"),l>30&&i.push(`High utility concentration (${l.toFixed(1)}%) - good reusability`),{pattern:t,patternConfidence:Math.min(100,o),insights:i}}var dc,mc,Lb,gt=pe(()=>{"use strict";lc();uc();pc();dc=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],mc=[/Dockerfile/i,/docker-compose/i,/\.ya?ml$/i,/nginx\.conf/i,/\/infra\//i,/\/deploy\//i,/\/k8s\//i,/\/kubernetes\//i,/\/terraform\//i,/\/ansible\//i,/package\.json/i,/tsconfig.*\.json/i,/\.env/i],Lb=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});var bh={};Me(bh,{HologramService:()=>re});var Ye,re,Oe=pe(()=>{"use strict";X();gt();J();Ye=b.child({module:"hologram"}),re=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=L.getInstance(e)}updateTopography(e){Ye.debug({repoPath:this.repoPath},"Updating topography snapshot");let r=Object.values(e.layers).reduce((o,s)=>o+s.count,0),i={};for(let[o,s]of Object.entries(e.layers)){let a=r>0?s.count/r*100:0;i[o]={count:s.count,percentage:Math.round(a*10)/10,topFiles:s.topFiles.slice(0,3).map(c=>({path:c.path,confidence:c.confidence}))}}let t={pattern:e.pattern,patternConfidence:e.patternConfidence,layerDistribution:i,insights:e.insights,updatedAt:Date.now()};this.repos.hologram.upsertSection("topography",JSON.stringify(t)),Ye.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=De(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){Ye.debug({repoPath:this.repoPath,count:e.length},"Updating gravity zones");let r={hotspots:e.slice(0,50),updatedAt:Date.now()};this.repos.hologram.upsertSection("gravity",JSON.stringify(r)),Ye.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){Ye.debug({repoPath:this.repoPath,count:e.length},"Updating ghost bridges");let r={bridges:e.slice(0,20),updatedAt:Date.now()};this.repos.hologram.upsertSection("ghosts",JSON.stringify(r)),Ye.info({repoPath:this.repoPath},"Ghost bridges updated")}getSnapshot(){let e=this.repos.hologram.getAllSections(),r={metadata:{repoPath:this.repoPath,lastUpdated:Date.now(),version:"1.0.0"}};for(let i of e)try{let t=JSON.parse(i.data);switch(i.section){case"topography":r.topography=t;break;case"gravity":r.gravity=t;break;case"ghosts":r.ghosts=t;break}}catch(t){Ye.error({repoPath:this.repoPath,section:i.section,error:t},"Failed to parse hologram section")}return r}getSection(e){let r=this.repos.hologram.getSection(e);if(!r)return null;try{return JSON.parse(r.data)}catch(i){return Ye.error({repoPath:this.repoPath,section:e,error:i},"Failed to parse section"),null}}computeGravityZones(){Ye.debug({repoPath:this.repoPath},"Computing gravity zones from import graph");let e=this.repos.files.getAllPaths(),r=new Map;for(let t of e){let o=wn(t,this.repos);if(o.layer==="Test"||o.layer==="Unknown")continue;let s=this.repos.exports.findByFile(t);if(s.length===0)continue;let a=this.repos.imports.countDependents(t),c=this.repos.imports.countByFile(t),l=a*2+c;if(l>0){let u=s.find(d=>d.kind!=="TsTypeAliasDeclaration"&&d.kind!=="TsInterfaceDeclaration")||s[0],p=`${t}::${u.name}`;r.set(p,{symbol:u.name,filePath:t,inDegree:a,outDegree:c,gravity:l})}}let i=Array.from(r.values()).sort((t,o)=>o.gravity-t.gravity).slice(0,50);return Ye.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),Ye.info({repoPath:this.repoPath},"Hologram cleared")}}});var Cv={};Me(Cv,{GraphExporterService:()=>ta});var Lv,ta,wm=pe(()=>{"use strict";X();J();Lv=b.child({module:"graph-exporter"}),ta=class{constructor(e){this.repoPath=e;this.repos=L.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;Lv.info({focusMissionId:t,depth:o,format:i,includeCompleted:r},"Generating mission graph");let a=this.buildMissionTree(t,r,o,s);return i==="json"?JSON.stringify(a,null,2):this.generateMermaidDiagram(a)}buildMissionTree(e,r,i,t){let o;if(e){let c=this.repos.missions.findById(e);o=c?[c]:[]}else o=this.repos.missions.findAll().filter(l=>!l.parent_id),r||(o=o.filter(l=>l.status!=="completed"));let s=0,a=[];for(let c of o){if(s>=t)break;let l=this.buildNode(c,r,i,1,{count:s,max:t});l&&(a.push(l),s+=this.countNodes(l))}return a}buildNode(e,r,i,t,o){if(t>i||o.count>=o.max)return null;let s;if(e.strategy_graph)try{let u=JSON.parse(e.strategy_graph);s=this.parseStrategySteps(u)}catch(u){Lv.debug({missionId:e.id,err:u},"Failed to parse strategy graph")}let a={id:e.id,name:e.name,status:e.status,goal:e.goal,branch:e.git_branch||void 0,children:[],steps:s},c=this.repos.missions.findByParentId(e.id),l=r?c:c.filter(u=>u.status!=="completed");for(let u of l){if(o.count>=o.max)break;let p=this.buildNode(u,r,i,t+1,o);p&&(a.children.push(p),o.count++)}return a}parseStrategySteps(e){let r=[];return Array.isArray(e)?e.map((i,t)=>({id:i.id||`step-${t}`,description:i.description||i.content||i.name||`Step ${t+1}`,status:i.status,dependencies:i.dependencies||i.deps})):e.steps&&Array.isArray(e.steps)?this.parseStrategySteps(e.steps):typeof e=="object"?Object.entries(e).map(([i,t])=>({id:i,description:t.description||t.content||i,status:t.status,dependencies:t.dependencies||t.deps})):r}countNodes(e){let r=1;for(let i of e.children)r+=this.countNodes(i);return r}generateMermaidDiagram(e){let r=["graph TD"];for(let i of e)this.addMermaidNode(i,r);return r.join(`
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
`)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function yi(n,e,r){let i=n.toLowerCase(),t=e.toLowerCase();return i.includes("components/")||i.endsWith(".tsx")?"Component":i.startsWith("use")||t.startsWith("use")?"Hook":i.includes("models/")||t.endsWith("model")?"Model":i.includes("services/")||i.includes("controllers/")||i.includes("handlers/")||i.includes("mcp/")||i.endsWith("service.ts")||i.endsWith("controller.ts")||i.endsWith("handler.ts")||t.endsWith("service")||t.endsWith("controller")||t.endsWith("handler")?"Service":i.includes("repositories/")||i.includes("repos/")||i.endsWith("repository.ts")||i.endsWith("repo.ts")||t.endsWith("repository")||t.endsWith("repo")?"Repository":r==="TsInterfaceDeclaration"||r==="TsTypeAliasDeclaration"?"Type Definition":"Other"}function dr(n){let e=[];return/\b(fetch|axios|superagent|got)\s*\(|import\s+.*\b(http|https|node-fetch)\b/i.test(n)&&e.push("Network"),(/\b(knex|prisma|typeorm|mongoose|sequelize|pg|mysql|sqlite3)\b/i.test(n)||/\b(SELECT\s+.*FROM|INSERT\s+INTO|UPDATE\s+.*SET|DELETE\s+FROM)\b/i.test(n)||/\.query\s*\(|\.execute\s*\(/i.test(n)&&/db|database|client|pool/i.test(n))&&e.push("Database"),(/\bfs\./i.test(n)||/\b(readFileSync|writeFileSync|readFile|writeFile|readdir)\b/.test(n)||/import\s+.*\bfs\b/.test(n))&&e.push("File System"),(/\b(localStorage|sessionStorage|indexedDB)\./.test(n)||/\bdocument\.cookie\b/.test(n))&&e.push("Browser Storage"),e}function nt(n,e){if(!n)return"";let r=n.replace(/^([\s\S]*?\*\/)?\s*/,"").replace(/^.*\} from ['"].*['"];?\s*/,"").replace(/^import .*['"];?\s*/,"").trim();if(e==="TsInterfaceDeclaration"||e==="TsTypeAliasDeclaration")return r;let i=0,t=0,o=r.length;for(let s=0;s<r.length;s++){let a=r[s];if(a==="(")i++;else if(a===")")i--;else if(a==="<")t++;else if(a===">")t--;else if(a==="{"){if(i===0&&t===0){o=s;break}}else if(a==="; "&&i===0&&t===0){o=s;break}else if(a==="="&&r[s+1]===">"&&i===0&&t===0){o=s+2;break}}return r.substring(0,o).trim()}function Zm(n){let e=[];for(let r of n)r.type==="ImportDeclaration"&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ImportDefaultSpecifier"?"default":i.type==="ImportNamespaceSpecifier"?"*":i.local?.value||i.imported?.value||"*").join("","")}),r.type==="ExportAllDeclaration"&&e.push({module:r.source.value,name:"*"}),r.type==="ExportNamedDeclaration"&&r.source&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ExportSpecifier"?i.orig.value:"*").join(", ")});return e}function Hm(n,e,r,i,t,o,s,a,c){let l=c??(p=>gi(p,r)),u=[];for(let p of n){if(p.type==="ExportDeclaration"){let d=p.declaration,m=d.type,f="";m==="VariableDeclaration"?f=d.declarations.map(S=>S.id.value).join("",""):f=d.id?.value||d.identifier?.value||"anonymous";let h=l(p.span.start-e),_=l(p.span.end-e),v=tt(h,o,i),y=a(p.span),k=[];if(p.type==="ExportDeclaration"&&(m==="ClassDeclaration"||m==="ClassExpression")){let S=d.body||[];for(let $ of S)if($.type==="ClassMethod"||$.type==="ClassProperty"){let E=$.key.value;if(!E)continue;let T=l($.span.start-e),P=l($.span.end-e),U=a($.span),I=tt(T,o,i);k.push({name:E,kind:$.type,signature:nt(U,$.type),line:le(T,t),endLine:le(P,t),doc:I,classification:$.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(m==="FunctionDeclaration"&&d.body?.type==="BlockStatement")k=Ha(d.body.stmts,e,r,i,t,o,a,l);else if(m==="VariableDeclaration"){for(let S of d.declarations)if(S.init&&(S.init.type==="ArrowFunctionExpression"||S.init.type==="FunctionExpression")&&S.init.body?.type==="BlockStatement"){k=Ha(S.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:f,kind:m,signature:nt(y,m),line:le(h,t),endLine:le(_,t),doc:v,classification:yi(s,f,m),capabilities:JSON.stringify(dr(y)),members:k})}if(p.type==="ExportNamedDeclaration"){for(let d of p.specifiers)if(d.type==="ExportSpecifier"){let m=l(p.span.start-e),f=l(p.span.end-e),h=tt(m,o,i);u.push({name:d.exported?.value||d.orig.value,kind:"ExportSpecifier",signature:`export { ${d.orig.value} }`,line:le(m,t),endLine:le(f,t),doc:h,classification:"Export mapping",capabilities:"[]"})}}if(p.type==="ExportDefaultDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=tt(d,o,i),h=a(p.span),_=[];if(p.decl.type==="ClassExpression"||p.decl.type==="ClassDeclaration"){let v=p.decl.body||[];for(let y of v)if(y.type==="ClassMethod"||y.type==="ClassProperty"){let k=y.key.value;if(!k)continue;let S=l(y.span.start-e),$=l(y.span.end-e),E=a(y.span),T=tt(S,o,i);_.push({name:k,kind:y.type,signature:nt(E,y.type),line:le(S,t),endLine:le($,t),doc:T,classification:y.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(p.decl.type==="FunctionExpression"||p.decl.type==="FunctionDeclaration"||p.decl.type==="ArrowFunctionExpression")&&p.decl.body?.type==="BlockStatement"&&(_=Ha(p.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:nt(h,"DefaultExport"),line:le(d,t),endLine:le(m,t),doc:f,classification:"Default Export",capabilities:JSON.stringify(dr(h)),members:_})}if(p.type==="ExportAllDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=p.source.value,h=tt(d,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${f}"`,line:le(d,t),endLine:le(m,t),doc:h,classification:"Re-export",capabilities:"[]"})}}return u}function Ha(n,e,r,i,t,o,s,a){let c=[];for(let l of n){if(l.type==="VariableDeclaration")for(let u of l.declarations){let p=[],d=m=>{if(m.type==="Identifier")p.push({name:m.value,span:m.span});else if(m.type==="ArrayPattern")for(let f of m.elements)f&&d(f);else if(m.type==="ObjectPattern")for(let f of m.properties)f.type==="AssignmentPatternProperty"?p.push({name:f.key.value,span:f.span}):f.type==="KeyValuePatternProperty"&&d(f.value)};d(u.id);for(let m of p){let f=a(m.span.start-e),h=a(m.span.end-e),_=s(m.span),v=tt(f,o,i);c.push({name:m.name,kind:"VariableDeclaration",signature:nt(_,"VariableDeclaration"),line:le(f,t),endLine:le(h,t),doc:v,classification:"Internal Variable",capabilities:"[]"})}}if(l.type==="FunctionDeclaration"){let u=l.identifier?.value||l.ident?.value||"anonymous",p=a(l.span.start-e),d=a(l.span.end-e),m=s(l.span),f=tt(p,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:nt(m,"FunctionDeclaration"),line:le(p,t),endLine:le(d,t),doc:f,classification:"Internal Function",capabilities:"[]"})}if(l.type==="ReturnStatement"&&l.argument?.type==="ObjectExpression")for(let u of l.argument.properties){let p="",d=u.span||u.key?.span||u.ident?.span;if(u.type==="KeyValueProperty"){let m=u.key;p=m?.value||m?.raw||(m?.type==="Identifier"?m.value:"")}else u.type==="MethodProperty"?p=u.key?.value||u.key?.raw||"":u.type==="ShorthandProperty"?p=u.ident?.value||"":u.type==="Identifier"&&(p=u.value||"");if(p&&d){let m=a(d.start-e),f=a(d.end-e),h=s(d),_=tt(m,o,i);c.push({name:p,kind:"ReturnProperty",signature:nt(h,"ReturnProperty"),line:le(m,t),endLine:le(f,t),doc:_,classification:"Return Member",capabilities:"[]"})}}if(l.type==="ExpressionStatement"&&l.expression.type==="CallExpression"){let u=l.expression;if(u.callee.type==="MemberExpression"&&(u.callee.property?.value==="on"||u.callee.property?.value==="once")){let p=u.arguments[0]?.expression?.value,d=u.arguments[1]?.expression;if(p&&d&&(d.type==="ArrowFunctionExpression"||d.type==="FunctionExpression")){let m=a(d.span.start-e),f=a(d.span.end-e),h=s(d.span);c.push({name:`on:${p}`,kind:d.type,signature:nt(h,d.type),line:le(m,t),endLine:le(f,t),doc:"",classification:"Event Handler",capabilities:"[]"})}}if(u.callee.type==="Identifier"&&u.callee.value==="addRoute"&&u.arguments.length>=3){let p=u.arguments[2].expression;if(p.type==="StringLiteral"){let d=p.value,m=a(u.span.start-e),f=a(u.span.end-e),h=s(u.span);c.push({name:d,kind:"HTTP Route",signature:nt(h,"HTTP Route"),line:le(m,t),endLine:le(f,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:d})})}}}}return c}function Wm(n,e,r,i,t,o){let s=o??(l=>gi(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=N_(l);if(u){let p=s(l.span.start-e);a.push({...u,line:le(p,i),snippet:t(l.span)})}}for(let u of Object.keys(l)){if(u==="span")continue;let p=l[u];Array.isArray(p)?p.forEach(c):typeof p=="object"&&c(p)}}}return n.forEach(c),a}function N_(n){let{callee:e,arguments:r}=n;if(!r||r.length===0)return null;if(e.type==="Identifier"&&e.value,e.type==="Identifier"&&e.value==="addRoute"&&r.length>=3){let i=r[2].expression;if(i.type==="StringLiteral")return{type:"api_route",name:i.value,direction:"consume"}}if(e.type==="MemberExpression"&&e.property?.type==="Identifier"){let i=e.property.value;if(i==="emit"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"produce"};if(i==="on"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"consume"};if(["get","post","put","delete","patch"].includes(i)&&r[0].expression.type==="StringLiteral"){let o=r[0].expression.value,s=e.object.type==="Identifier"?e.object.value:"";if(["axios","http","request","appApi","restApi","adminApi","client"].includes(s))return{type:"api_route",name:o,direction:"produce"};if(o.startsWith("/"))return{type:"api_route",name:o,direction:"consume"}}}return e.type==="Identifier"&&e.value==="fetch"&&r[0].expression.type==="StringLiteral"?{type:"api_route",name:r[0].expression.value,direction:"produce"}:null}function mr(n){let{classification:e,capabilities:r,exports:i,fileName:t}=n,o={Network:"API integration",Database:"data persistence","File System":"file I/O operations","Browser Storage":"client-side storage"},s=r.map(f=>o[f]).filter(Boolean).join(" and "),c={Component:(f,h)=>{let _=h.find(y=>y.kind==="FunctionDeclaration"||y.kind==="ClassDeclaration")?.name,v=_?`React component: ${_}`:"React UI component";return f?`${v} with ${f}`:v},Hook:(f,h)=>{let _=h.find(y=>y.name.startsWith("use"))?.name,v=_?`Custom React hook: ${_}`:"Custom React hook";return f?`${v} for ${f}`:v},Service:(f,h)=>{let v=`Service layer: ${h[0]?.name||"Service"}`;return f?`${v} handling ${f}`:v},Repository:(f,h)=>`Data repository: ${h[0]?.name||"Repository"} for ${f||"data access"}`,"Type Definition":(f,h)=>`Type definitions: ${h.slice(0,3).map(v=>v.name).join("")}${h.length>3?"...":""}`,Model:(f,h)=>`Data model: ${h[0]?.name||"Model"}`,"HTTP Route":(f,h)=>{let _=h.filter(v=>v.classification==="Service Boundary");return _.length>0?`API endpoints: ${_.slice(0,3).map(v=>v.name).join("")}`:"API route handler"},"Micro IR (PHP)":(f,h)=>{let _=h.some(y=>y.classification==="Service Boundary"),v=h.find(y=>y.kind==="ClassDeclaration")?.name;return _?"PHP controller with API routes":v?`PHP class: ${v}`:"PHP module"},"Micro IR (Python)":(f,h)=>{let _=h.some(y=>y.classification==="Service Boundary"),v=h.find(y=>y.kind==="ClassDeclaration")?.name;return _?"Python API handler with routes":v?`Python class: ${v}`:"Python module"},"Micro IR (Go/TS) ":(f,h)=>{let _=h.some(y=>y.kind==="TypeDeclaration"),v=h.filter(y=>y.kind==="FunctionDeclaration");return _&&v.length>0?`Go package: types and ${v.length} function(s)`:_?"Go package: type definitions":v.length>0?`Go package: ${v[0].name} and ${v.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(f,h)=>{let _=h.find(k=>k.kind==="TraitDeclaration")?.name,v=h.find(k=>k.kind==="StructDeclaration")?.name,y=h.filter(k=>k.kind==="FunctionDeclaration");return _?f.includes("Rust trait")?`Rust module: trait ${_}`:`Rust module: ${_}`:v?`Rust module: struct ${v}`:y.length>0?`Rust module: ${y.length} function(s)`:"Rust module"}}[e];if(c)return c(s,i);if(i.length===0)return t?`Module: ${t}`:"Module with no exports";let l=i.filter(f=>f.kind==="FunctionDeclaration"),u=i.filter(f=>f.kind==="ClassDeclaration"),p=i.filter(f=>f.kind==="TsInterfaceDeclaration"||f.kind==="TsTypeAliasDeclaration"),d=[];if(u.length>0&&d.push(`Class: ${u[0].name}`),l.length>0){let f=l.slice(0,2).map(h=>h.name).join("");d.push(`Functions: ${f}`)}p.length>0&&d.push(`Types: ${p.length}`);let m=d.length>0?d.join(" | "):`Module with ${i.length} export(s)`;return s?`${m} \u2014 ${s}`:m}function Bm(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&fe(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&fe(i,e);for(let t in i){if(t==="span"||t==="comments"||t==="interpreter")continue;let o=i[t];o&&typeof o=="object"&&(Array.isArray(o)?o.forEach(r):r(o))}}}return n.forEach(i=>r(i)),Array.from(e)}function fe(n,e){if(n){if(n.type==="TsTypeAnnotation"){fe(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&Jm(n.typeName,e),n.typeParams&&fe(n.typeParams,e)),n.type==="TsArrayType"&&fe(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>fe(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>fe(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>fe(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>fe(r.typeAnnotation,e)),n.typeAnnotation&&fe(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&fe(r.constraint,e),r.default&&fe(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>fe(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&fe(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(fe(n.objectType,e),fe(n.indexType,e)),n.type==="TsConditionalType"&&(fe(n.checkType,e),fe(n.extendsType,e),fe(n.trueType,e),fe(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&fe(r.typeAnnotation,e)})}}function Jm(n,e){n.type==="TsQualifiedName"?(n.left&&Jm(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import Qm from"path";import Ba from"path";J();vi();import Km from"path";import U_ from"fs";import{fileURLToPath as F_}from"url";import*as Gt from"web-tree-sitter";var dw=Km.dirname(F_(import.meta.url)),qm=b.child({module:"parser:tree-sitter"}),_i=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=Gt.Parser||Gt;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=yn("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!U_.existsSync(r))return qm.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await Gt.Language.load(r);return this.languages.set(e,i),i}catch(i){return qm.error({err:i,ext:e},"Failed to load language grammar"),null}}getLangName(e){switch(e.toLowerCase()){case".php":return"php";case".py":return"python";case".go":return"go";case".rs":return"rust";default:return""}}getQueries(e){switch(e.toLowerCase()){case".php":return`
|
|
544
|
+
`,e,r)}deleteSection(e){this.run("DELETE FROM hologram_snapshot WHERE section = ?",e)}deleteAll(){this.run("DELETE FROM hologram_snapshot")}hasSection(e){return(this.get("SELECT COUNT(*) as count FROM hologram_snapshot WHERE section = ?",e)?.count??0)>0}}});var z,ee=se(()=>{"use strict";ft();mh();fh();yh();Dc();Ih();Th();Rh();Nh();zh();z=class{static repositoryCache=new Map;static getInstance(e){let r=this.repositoryCache.get(e);if(r){let o=ke(e),s=r.files?.database,a=!r.intentLogs||!r.searchHistory||!r.missions||!r.hologram;if(s===o&&o.open&&!a)return r;this.repositoryCache.delete(e)}let i=ke(e),t={files:new oo(i),exports:new so(i),imports:new ao(i),missions:new Gr(i),intentLogs:new mo(i),configs:new fo(i),content:new ho(i),searchHistory:new go(i),hologram:new yo(i)};return this.repositoryCache.set(e,t),t}static closeInstance(e){this.repositoryCache.delete(e),Nc(e)}static clearCache(e){this.repositoryCache.delete(e)}}});var bo,vo,Uh,_o,Zh,Hh,Wh,Bh,Gh,Jh,Vh,qh,Kh,Yh,qr,xo,Xh,Qh,Uc=se(()=>{"use strict";bo=[/\/pages\/(?!_)[^/]+\.(tsx?|jsx?)$/i,/\/pages\/.*\/index\.(tsx?|jsx?)$/i,/\/app\/.*\/page\.(tsx?|jsx?)$/i,/\/app\/.*\/layout\.(tsx?|jsx?)$/i,/\/app\/api\/.*\/route\.(ts|js)$/i,/\/pages\/api\/.*\.(ts|js)$/i],vo=[/\.(routes?|router|controller|handler|endpoint|api)\.(ts|js|tsx|jsx)$/i,/\/routes?\//i,/\/controllers?\//i,/index\.(ts|js|tsx|jsx)$/i],Uh=[/\/components?\/.*\.(tsx|jsx)$/i,/\/features?\/.*\.(tsx|jsx)$/i,/\/views?\/.*\.(tsx|jsx)$/i,/\/screens?\/.*\.(tsx|jsx)$/i,/\/widgets?\/.*\.(tsx|jsx)$/i],_o=[/\.(service|usecase|interactor|manager|facade)\.(ts|js)$/i,/\/services?\//i,/\/usecases?\//i,/\/domain\//i,/\/business\//i],Zh=[/\/mcp\/handlers?\/[^/]+\.(ts|js)$/i,/\/mcp\/tools?\/[^/]+\.(ts|js)$/i,/\/mcp\/server\.(ts|js)$/i,/\/mcp\/index\.(ts|js)$/i],Hh=[/\/mcp\/utils?\.(ts|js)$/i,/\/mcp\/schemas?\.(ts|js)$/i,/\/mcp\/resources?\.(ts|js)$/i],Wh=[/\/commands?\/[^/]+\.(ts|js|py|php)$/i,/\/cli\/[^/]+\.(ts|js|py|php)$/i,/\/bin\/[^/]+\.(ts|js|py|php)$/i,/cli\.(ts|js|py|php)$/i,/main\.(ts|js|py|php)$/i],Bh=[/\/parser\/[^/]+\.(ts|js)$/i,/\/ast\/[^/]+\.(ts|js)$/i,/\.(parser|visitor|walker|transformer)\.(ts|js)$/i],Gh=[/\/core\/[^/]+\.(ts|js)$/i,/\/engine\/[^/]+\.(ts|js)$/i,/\/processing\/[^/]+\.(ts|js)$/i,/\/analysis\/[^/]+\.(ts|js)$/i,/\.(analyzer|processor|scanner|indexer|resolver)\.(ts|js)$/i],Jh=[/\/ui\/[^/]+\.(ts|js|tsx|jsx)$/i,/\/display\/[^/]+\.(ts|js)$/i,/\/output\/[^/]+\.(ts|js)$/i,/\.(formatter|renderer|printer)\.(ts|js)$/i],Vh=[/\/stores?\//i,/\/slices?\//i,/\/reducers?\//i,/\/atoms?\//i,/\/selectors?\//i,/\.(store|slice|reducer|atom|selector)\.(ts|js)$/i,/.*Slice\.(ts|js)$/i,/.*Store\.(ts|js)$/i],qh=[/\/hooks?\//i,/\/contexts?\//i,/\/providers?\//i,/use[A-Z].*\.(ts|js)$/,/.*Context\.(ts|tsx|js|jsx)$/i,/.*Provider\.(ts|tsx|js|jsx)$/i],Kh=[/\/schemas?\//i,/\/validations?\//i,/\.(schema|validation|validator)\.(ts|js)$/i],Yh=[/\.(types?|dto|interface|interfaces)\.(ts|js)$/i,/types\.ts$/i,/\/types?\//i,/\/dtos?\//i,/\/interfaces?\//i,/\/contracts?\//i,/\.d\.ts$/i],qr=[/\.(model|entity|schema|repository|repo|dao|migration|query|mutation|resolver|connection|db)\.(ts|js)$/i,/queries\.(ts|js)$/i,/mutations\.(ts|js)$/i,/resolvers\.(ts|js)$/i,/connection\.(ts|js)$/i,/\/models?\//i,/\/entities?\//i,/\/repositories?\//i,/\/repos?\//i,/\/data\//i,/\/database\//i,/\/prisma\//i,/\/drizzle\//i,/\/api\/.*client\.(ts|js|tsx)$/i,/(^|\/)[A-Z0-9_-]*API\.(tsx?|js|jsx)$/],xo=[/\.(util|utils|helper|helpers|lib|common|shared)\.(ts|js)$/i,/\/utils?\//i,/\/helpers?\//i,/\/lib\//i,/\/common\//i,/\/shared\//i],Xh=["express","fastify","koa","hapi","restify","next","nuxt","gatsby","remix","@nestjs/common","@nestjs/core","react-router","vue-router","@angular/router","zod","joi","yup","valibot","superstruct"],Qh=["prisma","@prisma/client","typeorm","sequelize","mongoose","drizzle-orm","knex","pg","mysql","sqlite","better-sqlite3","mongodb","redis","ioredis","zustand","redux","recoil","jotai","mobx"]});var So,tg,$o,ng,Zc=se(()=>{"use strict";So=[/urls\.py$/i,/wsgi\.py$/i,/asgi\.py$/i,/manage\.py$/i,/main\.py$/i,/app\.py$/i,/\/endpoints?\/.*\.py$/i,/\/commands?\/.*\.py$/i],tg=[/views\.py$/i,/forms\.py$/i,/serializers\.py$/i,/admin\.py$/i,/apps\.py$/i,/tasks\.py$/i,/middlewares?\.py$/i,/signals?\.py$/i,/context_processors\.py$/i],$o=[/models\.py$/i,/\/models\/.*\.py$/i,/\/migrations\/.*\.py$/i,/schema\.py$/i,/documents\.py$/i],ng=["django.urls","django.http","flask","fastapi","chalice","tornado"]});var wo,ig,ko,og,Hc=se(()=>{"use strict";wo=[/\/routes?\/.*\.php$/i,/\/controllers?\/.*\.php$/i,/index\.php$/i,/server\.php$/i,/artisan$/i,/console$/i],ig=[/\/services?\/.*\.php$/i,/\/providers?\/.*\.php$/i,/\/middleware\/.*\.php$/i,/\/jobs?\/.*\.php$/i,/\/listeners?\/.*\.php$/i,/\/events?\/.*\.php$/i,/\/observers?\/.*\.php$/i,/\/console\/commands\/.*\.php$/i,/\/actions?\/.*\.php$/i,/\/traits?\/.*\.php$/i,/\/concerns?\/.*\.php$/i,/\/contracts?\/.*\.php$/i],ko=[/\/models?\/.*\.php$/i,/\/eloquent\/.*\.php$/i,/\/migrations?\/.*\.php$/i,/\/seeders?\/.*\.php$/i,/\/factories?\/.*\.php$/i,/\/repositories?\/.*\.php$/i,/\/resources?\/.*\.php$/i],og=["laravel","symfony","slim","cakephp","codeigniter"]});import ag from"path";function Bt(n,e,r){let i=[],t="Unknown",o=0;r||(r=FS(n,e));let{inDegree:s,outDegree:a}=r,c=(d,m,f,h)=>{for(let v of d)if(v.test(n))return i.push(`${h}: ${v.source}`),t=m,o+=f,!0;return!1},l=!1;if(l||(l=c(bo,"Entry",45,"Next.js entry")),l||(l=c(Zh,"Entry",40,"MCP handler")),l||(l=c(Wh,"Entry",40,"CLI command")),l||(l=c(qr,"Data",45,"Data layer/Repository")),l||(l=c(Vh,"Data",35,"State management")),l||(l=c(Uh,"Logic",40,"React component")),l||(l=c(_o,"Logic",35,"Logic pattern")),l||(l=c(Bh,"Logic",35,"Parser/AST")),l||(l=c(Gh,"Logic",35,"Core module")),l||(l=c(Jh,"Logic",30,"UI layer")),l||(l=c(Yh,"Types",35,"Type definition")),l||(l=c(So,"Entry",40,"Python Entry")),l||(l=c($o,"Data",40,"Python Data")),l||(l=c(tg,"Logic",35,"Python Logic")),l||(l=c(wo,"Entry",40,"PHP Entry")),l||(l=c(ko,"Data",40,"PHP Data")),l||(l=c(ig,"Logic",35,"PHP Logic")),l||(l=c(qh,"Logic",35,"Hook/Context")),!l){for(let d of Hh)if(d.test(n)){i.push(`MCP utility: ${d.source}`),/schemas?/i.test(n)?t="Types":/resources?/i.test(n)?t="Data":t="Utility",o+=35,l=!0;break}}l||c(Kh,"Data",35,"Schema definition")&&(l=!0),l||(c(qr,"Data",30,"Path matches data pattern")||c(xo,"Utility",25,"Path matches utility pattern")||c(vo,"Entry",30,"Path matches entry pattern"))&&(l=!0);for(let d of Wc)if(d.test(n)){i.push(`Test file: ${d.source}`),t="Test",o=50,l=!0;break}l||c(Bc,"Infrastructure",40,"Infrastructure")&&(l=!0);for(let d of jS)d.test(n)&&(i.push(`Monorepo component: ${d.source}`),/\/apps\/[^/]+\/src\/pages\//i.test(n)&&(i.push("Monorepo App Entry"),t==="Unknown"&&(t="Entry"),o+=20),/\/packages\/[^/]+\/src\//i.test(n)&&(o+=10));let p=e.imports.getImportsForFile(n).map(d=>d.module_specifier.toLowerCase());for(let d of Qh)if(p.some(m=>m.includes(d))){i.push(`Imports JS data library: ${d}`),(t==="Unknown"||t==="Data")&&(t="Data",o+=25);break}for(let d of ng)if(p.some(m=>m.includes(d))){i.push(`Imports Python framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of og)if(p.some(m=>m.includes(d))){i.push(`Imports PHP framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}for(let d of Xh)if(p.some(m=>m.includes(d))){i.push(`Imports JS framework: ${d}`),(t==="Unknown"||t==="Entry")&&(t="Entry",o+=20);break}if(s===0&&a>0&&(i.push("Entry point: nothing imports this file (in-degree=0)"),t==="Unknown"?(t="Entry",o+=30):t==="Entry"&&(o+=15)),s>5&&a<=2&&(i.push(`High reuse: ${s} files import this (candidate for Utility)`),t==="Unknown"?(t="Utility",o+=25):t==="Utility"&&(o+=10)),t==="Unknown"&&s>0&&a>0){let d=s/(s+a);d>.3&&d<.7&&(i.push(`Balanced traffic: in=${s}, out=${a} (likely Logic layer)`),t="Logic",o+=25)}return t==="Unknown"&&(i.push("No strong classification signals detected"),o=10),o=Math.min(o,100),{layer:t,confidence:o,signals:i}}function FS(n,e){let r=e.imports.countDependents(n),i=e.imports.countByFile(n);return{inDegree:r,outDegree:i}}function He(n,e){let r=n.files.getAllPaths().map(f=>({path:f})),i=new Map,t={Entry:[],Logic:[],Data:[],Utility:[],Infrastructure:[],Test:[],Types:[],Unknown:[]};for(let f of r){let h=Bt(f.path,n);i.set(f.path,h),t[h.layer].push({path:f.path,classification:h})}let o={Entry:Wt(t.Entry,e),Logic:Wt(t.Logic,e),Data:Wt(t.Data,e),Utility:Wt(t.Utility,e),Infrastructure:Wt(t.Infrastructure,e),Test:Wt(t.Test,e),Types:Wt(t.Types,e),Unknown:Wt(t.Unknown,e)},s={};r.forEach(f=>{let h=ag.extname(f.path).toLowerCase();h&&(s[h]=(s[h]||0)+1)});let a={".ts":"TypeScript",".tsx":"Typescript (React)",".js":"JavaScript",".jsx":"JavaScript (React)",".py":"Python",".php":"PHP",".go":"Go",".rs":"Rust",".java":"Java",".cs":"C#",".rb":"Ruby",".vue":"Vue"},c={};Object.entries(s).forEach(([f,h])=>{let v=a[f];v&&(c[v]=(c[v]||0)+h)});let l=Object.entries(c).sort((f,h)=>h[1]-f[1]),u=l.length>0?l[0][0]:"Unknown",{pattern:p,patternConfidence:d,insights:m}=US(o,r.length,n);return{pattern:p,patternConfidence:d,layers:o,insights:m,primaryStack:u}}function Wt(n,e){return n.sort((r,i)=>i.classification.confidence-r.classification.confidence),{count:n.length,topFiles:n.slice(0,5).map(r=>({path:ag.relative(e,r.path),confidence:r.classification.confidence,signals:r.classification.signals.slice(0,2)}))}}function US(n,e,r){let i=[],t="Unknown",o=0,s=n.Entry.count/e*100,a=n.Logic.count/e*100,c=n.Data.count/e*100,l=n.Utility.count/e*100,u=n.Unknown.count/e*100;s>5&&a>10&&c>5&&u<40?(t="Layered",o=60+Math.min(30,(100-u)/3),i.push(`Clear layer separation: Entry (${s.toFixed(1)}%), Logic (${a.toFixed(1)}%), Data (${c.toFixed(1)}%)`)):l>20?(t="Modular",o=50+l/2,i.push(`High shared module usage: ${l.toFixed(1)}% utility files`)):u>60&&(t="Monolithic",o=40+u/4,i.push(`Limited architectural structure: ${u.toFixed(1)}% files with unclear layer assignment`));let p=r.configs.countByKind("Service");return p>3&&(t="Microservices",o=55+p*5,i.push(`Detected ${p} service definitions (likely microservices)`)),n.Entry.count===0&&i.push("\u26A0\uFE0F No clear entry points detected - consider adding route/controller files"),n.Data.count===0&&i.push("\u26A0\uFE0F No data layer detected - repository may not use traditional ORM patterns"),l>30&&i.push(`High utility concentration (${l.toFixed(1)}%) - good reusability`),{pattern:t,patternConfidence:Math.min(100,o),insights:i}}var Wc,Bc,jS,yt=se(()=>{"use strict";Uc();Zc();Hc();Wc=[/\.(test|spec)\.(ts|tsx|js|jsx)$/i,/tests?\.py$/i,/\/__tests__\//i,/\/tests?\//i,/\.e2e\.(ts|js)$/i,/\.integration\.(ts|js)$/i],Bc=[/Dockerfile/i,/docker-compose/i,/\.ya?ml$/i,/nginx\.conf/i,/\/infra\//i,/\/deploy\//i,/\/k8s\//i,/\/kubernetes\//i,/\/terraform\//i,/\/ansible\//i,/package\.json/i,/tsconfig.*\.json/i,/\.env/i],jS=[/\/apps\/[^/]+\//i,/\/services\/[^/]+\//i,/\/packages\/[^/]+\//i,/\/backends\/[^/]+\//i,/\/backends_python\/[^/]+\//i]});function c$(n){try{return JSON.stringify(n)}catch{return String(n)}}function bt(n){if(n instanceof Error)return n.message;if(typeof n=="string")return n;if(n&&typeof n=="object"&&"message"in n){let e=n.message;if(typeof e=="string"&&e.trim())return e}return c$(n)}function we(n){if(n instanceof Error){let e;return"cause"in n&&n.cause!==void 0&&(e=bt(n.cause)),{errorName:n.name||"Error",errorMessage:n.message,errorStack:n.stack,...e?{errorCause:e}:{}}}return n&&typeof n=="object"?{errorName:n.constructor?.name||"Object",errorMessage:bt(n)}:{errorName:typeof n,errorMessage:bt(n)}}var Gn=se(()=>{"use strict"});var $g={};Ze($g,{HologramService:()=>ce});var at,ce,We=se(()=>{"use strict";ee();yt();Q();Gn();at=$.child({module:"hologram"}),ce=class{repos;repoPath;constructor(e){this.repoPath=e,this.repos=z.getInstance(e)}updateTopography(e){at.debug({repoPath:this.repoPath},"Updating topography snapshot");let r=Object.values(e.layers).reduce((o,s)=>o+s.count,0),i={};for(let[o,s]of Object.entries(e.layers)){let a=r>0?s.count/r*100:0;i[o]={count:s.count,percentage:Math.round(a*10)/10,topFiles:s.topFiles.slice(0,3).map(c=>({path:c.path,confidence:c.confidence}))}}let t={pattern:e.pattern,patternConfidence:e.patternConfidence,layerDistribution:i,insights:e.insights,updatedAt:Date.now()};this.repos.hologram.upsertSection("topography",JSON.stringify(t)),at.info({repoPath:this.repoPath},"Topography snapshot updated")}refreshTopography(){let e=He(this.repos,this.repoPath);this.updateTopography(e)}updateGravityZones(e){at.debug({repoPath:this.repoPath,count:e.length},"Updating gravity zones");let r={hotspots:e.slice(0,50),updatedAt:Date.now()};this.repos.hologram.upsertSection("gravity",JSON.stringify(r)),at.info({repoPath:this.repoPath},"Gravity zones updated")}updateGhostBridges(e){at.debug({repoPath:this.repoPath,count:e.length},"Updating ghost bridges");let r={bridges:e.slice(0,20),updatedAt:Date.now()};this.repos.hologram.upsertSection("ghosts",JSON.stringify(r)),at.info({repoPath:this.repoPath},"Ghost bridges updated")}getSnapshot(){let e=this.repos.hologram.getAllSections(),r={metadata:{repoPath:this.repoPath,lastUpdated:Date.now(),version:"1.0.0"}};for(let i of e)try{let t=JSON.parse(i.data);switch(i.section){case"topography":r.topography=t;break;case"gravity":r.gravity=t;break;case"ghosts":r.ghosts=t;break}}catch(t){at.debug({repoPath:this.repoPath,section:i.section,...we(t)},"Skipping malformed hologram section")}return r}getSection(e){let r=this.repos.hologram.getSection(e);if(!r)return null;try{return JSON.parse(r.data)}catch(i){return at.debug({repoPath:this.repoPath,section:e,...we(i)},"Skipping malformed hologram section"),null}}computeGravityZones(){at.debug({repoPath:this.repoPath},"Computing gravity zones from import graph");let e=this.repos.files.getAllPaths(),r=new Map;for(let t of e){let o=Bt(t,this.repos);if(o.layer==="Test"||o.layer==="Unknown")continue;let s=this.repos.exports.findByFile(t);if(s.length===0)continue;let a=this.repos.imports.countDependents(t),c=this.repos.imports.countByFile(t),l=a*2+c;if(l>0){let u=s.find(d=>d.kind!=="TsTypeAliasDeclaration"&&d.kind!=="TsInterfaceDeclaration")||s[0],p=`${t}::${u.name}`;r.set(p,{symbol:u.name,filePath:t,inDegree:a,outDegree:c,gravity:l})}}let i=Array.from(r.values()).sort((t,o)=>o.gravity-t.gravity).slice(0,50);return at.info({repoPath:this.repoPath,count:i.length},"Gravity zones computed"),i}isInitialized(){return this.repos.hologram.getAllSections().length>0}clear(){this.repos.hologram.deleteAll(),at.info({repoPath:this.repoPath},"Hologram cleared")}}});import u$ from"better-sqlite3";import Vn from"path";import wg from"fs";import p$ from"os";import d$ from"crypto";var kg,To,m$,Eg,Xc,Ro,Ig=se(()=>{"use strict";Q();ft();kg=$.child({module:"fusion-connection"}),To=5,m$=1,Eg=["files","exports","imports","configs","schema_migrations"],Xc=3,Ro=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),kg.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=Vn.dirname(this.fusionDbPath);wg.existsSync(r)||wg.mkdirSync(r,{recursive:!0}),this.fusionDb=new u$(this.fusionDbPath),this.fusionDb.pragma("journal_mode = WAL"),this.fusionDb.pragma("busy_timeout = 5000"),this.initFusionSchema();for(let i of e.repoPaths)this.attachRepo(i)}getFusionDbPath(e){let r=p$.homedir(),i=Vn.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return Vn.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
|
|
545
|
+
CREATE TABLE IF NOT EXISTS fused_repos (
|
|
546
|
+
alias TEXT PRIMARY KEY,
|
|
547
|
+
repo_path TEXT NOT NULL UNIQUE,
|
|
548
|
+
db_path TEXT NOT NULL,
|
|
549
|
+
schema_version INTEGER NOT NULL,
|
|
550
|
+
attached_at REAL DEFAULT (unixepoch()),
|
|
551
|
+
last_validated_at REAL
|
|
552
|
+
);
|
|
553
|
+
|
|
554
|
+
CREATE TABLE IF NOT EXISTS fused_metadata (
|
|
555
|
+
key TEXT PRIMARY KEY,
|
|
556
|
+
value TEXT NOT NULL,
|
|
557
|
+
updated_at REAL DEFAULT (unixepoch())
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
CREATE TABLE IF NOT EXISTS virtual_edges (
|
|
561
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
562
|
+
source_repo TEXT NOT NULL,
|
|
563
|
+
source_file_path TEXT NOT NULL,
|
|
564
|
+
source_symbol_id INTEGER,
|
|
565
|
+
target_repo TEXT NOT NULL,
|
|
566
|
+
target_file_path TEXT NOT NULL,
|
|
567
|
+
target_symbol_id INTEGER,
|
|
568
|
+
relationship TEXT NOT NULL,
|
|
569
|
+
metadata TEXT,
|
|
570
|
+
confidence REAL DEFAULT 1.0,
|
|
571
|
+
created_at REAL DEFAULT (unixepoch()),
|
|
572
|
+
updated_at REAL DEFAULT (unixepoch()),
|
|
573
|
+
UNIQUE(source_repo, source_file_path, target_repo, target_file_path, relationship)
|
|
574
|
+
);
|
|
575
|
+
|
|
576
|
+
CREATE INDEX IF NOT EXISTS idx_virtual_edges_source ON virtual_edges(source_repo, source_file_path);
|
|
577
|
+
CREATE INDEX IF NOT EXISTS idx_virtual_edges_target ON virtual_edges(target_repo, target_file_path);
|
|
578
|
+
`),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(m$.toString())}attachRepo(e){let r=Vn.resolve(e);if(this.attachedRepos.has(r))return;if(!rt(r))throw new Error(`Repository "${r}" is not indexed. Run shadow_recon_onboard({ repoPath: "${r}" }) then shadow_sync_trace({ repoPath: "${r}" }).`);let i=ke(r),t=i.name;this.validateSchemaCompatibility(i,r);let o=this.getSchemaVersion(i),s=this.generateAlias(r);for(let a=1;a<=Xc;a++)try{this.fusionDb.exec(`ATTACH DATABASE '${t}' AS ${s}`);let c={alias:s,repoPath:r,dbPath:t,schemaVersion:o,attached:!0};this.attachedRepos.set(r,c),this.fusionDb.prepare(`INSERT OR REPLACE INTO fused_repos (alias, repo_path, db_path, schema_version, attached_at, last_validated_at)
|
|
579
|
+
VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(c){if(this.isLockContentionError(c)&&a<Xc){kg.warn({repoPath:r,attempt:a,maxAttempts:Xc},"Attach failed due to lock contention; retrying");continue}throw c}}checkHealth(){let e=[];for(let r of this.attachedRepos.values())try{this.fusionDb.prepare(`SELECT 1 FROM ${r.alias}.files LIMIT 1`).get(),e.push({alias:r.alias,repoPath:r.repoPath,accessible:!0})}catch(i){e.push({alias:r.alias,repoPath:r.repoPath,accessible:!1,error:i instanceof Error?i.message:String(i)})}return{healthy:e.every(r=>r.accessible),repos:e}}detachRepo(e){let r=Vn.resolve(e),i=this.attachedRepos.get(r);i&&(this.fusionDb.exec(`DETACH DATABASE ${i.alias}`),this.attachedRepos.delete(r),this.fusionDb.prepare("DELETE FROM fused_repos WHERE repo_path = ?").run(r))}refreshRepo(e){this.detachRepo(e),this.attachRepo(e)}refreshAll(){let e=Array.from(this.attachedRepos.keys());for(let r of e)this.refreshRepo(r)}validateSchemas(){let e=Array.from(this.attachedRepos.values()).map(r=>{let i=ke(r.repoPath),t=Eg.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=To&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:To,repos:e}}getAttachedRepos(){return Array.from(this.attachedRepos.values())}prepare(e){return this.fusionDb.prepare(e)}exec(e){this.fusionDb.exec(e)}close(){for(let e of this.attachedRepos.values())try{this.fusionDb.exec(`DETACH DATABASE ${e.alias}`)}catch{}this.attachedRepos.clear(),this.fusionDb.open&&this.fusionDb.close()}generateAlias(e){let r=Vn.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=d$.createHash("sha256").update(e).digest("hex").substring(0,6);return`repo_${r}_${i}`}getSchemaVersion(e){try{return e.prepare("SELECT MAX(version) as version FROM schema_migrations").get()?.version||0}catch{return 0}}validateSchemaCompatibility(e,r){let i=this.getSchemaVersion(e);if(i<To)throw new Error(`Schema version mismatch for ${r}. Expected >= ${To}, got ${i}.`);let t=Eg.filter(o=>!this.checkTableExists(e,o));if(t.length>0)throw new Error(`Missing tables in ${r}: ${t.join(", ")}`)}checkTableExists(e,r){try{return!!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(r)}catch{return!1}}isLockContentionError(e){let r=e instanceof Error?e.message.toLowerCase():String(e).toLowerCase();return r.includes("locked")||r.includes("busy")}get nameValue(){return this.name}get dbPath(){return this.fusionDbPath}}});function Qc(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function f$(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function h$(n,e){let r=Qc(n),i=Qc(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function g$(n){Kt.info("Starting HTTP gap detection scan");let e=n.getAttachedRepos();if(e.length<2)return Kt.warn("Need at least 2 repos for cross-repo dependency detection"),0;let r=[];for(let o of e)try{let s=`
|
|
580
|
+
SELECT id, name, file_path, capabilities
|
|
581
|
+
FROM ${o.alias}.exports
|
|
582
|
+
WHERE kind = 'HTTP Route'
|
|
583
|
+
`,a=n.executeRawQuery(s);for(let c of a){let l=f$(c.capabilities)||c.name;l&&l.startsWith("/")&&r.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,symbolId:c.id,routePath:l})}}catch(s){Kt.warn({repo:o.alias,error:s},"Failed to query backend routes")}Kt.debug({count:r.length},"Found backend routes");let i=[];for(let o of e)try{let s=`
|
|
584
|
+
SELECT file_path, name
|
|
585
|
+
FROM ${o.alias}.event_synapses
|
|
586
|
+
WHERE type = 'api_route' AND direction = 'produce'
|
|
587
|
+
`,a=n.executeRawQuery(s);for(let c of a){let l=Qc(c.name);l&&l.startsWith("/")&&i.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,routePath:l})}}catch(s){Kt.warn({repo:o.alias,error:s},"Failed to query frontend API calls")}Kt.debug({count:i.length},"Found frontend API calls");let t=0;for(let o of i)for(let s of r)if(o.repoPath!==s.repoPath&&h$(o.routePath,s.routePath))try{n.addVirtualEdge({sourceRepo:o.repoPath,sourceFilePath:o.filePath,targetRepo:s.repoPath,targetFilePath:s.filePath,targetSymbolId:s.symbolId,relationship:"api_call",metadata:{frontendPath:o.routePath,backendPath:s.routePath,method:s.method},confidence:1}),t++}catch(a){Kt.debug({source:o.filePath,target:s.filePath,error:a},"Skipped duplicate edge")}return Kt.info({edgesCreated:t,backendRoutes:r.length,frontendCalls:i.length},"HTTP gap detection scan completed"),t}function Tg(n){let e=g$(n);return{httpGaps:e,totalEdges:e}}var Kt,Rg=se(()=>{"use strict";Q();Kt=$.child({module:"edge-scanner"})});var y$,Po,Pg=se(()=>{"use strict";Rg();Q();y$=$.child({module:"fusion-index-service"}),Po=class{constructor(e){this.connection=e}executeFederatedQuery(e,...r){return this.connection.prepare(e).all(...r).map(o=>{let{_repo_alias:s,_repo_path:a,...c}=o;return{repo:s,repoPath:a,data:c}})}executeRawQuery(e,...r){return this.connection.prepare(e).all(...r)}buildAdvancedQuery(e){let r=this.connection.getAttachedRepos();if(r.length===0)throw new Error("No repositories attached");let{table:i,tableAlias:t,columns:o,joins:s,where:a,groupBy:c,having:l,orderBy:u,limit:p,offset:d}=e,m=t||i.charAt(0),f=o.join(", "),v=r.map(y=>{let b=`${y.alias}.${i} ${m}`,_="";s&&s.length>0&&(_=s.map(N=>{let L=N.alias||N.table.charAt(0);return`${N.type} JOIN ${y.alias}.${N.table} ${L} ON ${N.on}`}).join(`
|
|
588
|
+
`));let x=a?`WHERE ${a}`:"",k=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",I=l?`HAVING ${l}`:"";return`SELECT '${y.alias}' as _repo_alias, '${y.repoPath}' as _repo_path, ${f} FROM ${b} ${_} ${x} ${k} ${I}`.trim()}).join(`
|
|
589
|
+
UNION ALL
|
|
590
|
+
`);return u&&(v=`SELECT * FROM (${v}) AS federated_results ORDER BY ${u}`),p!==void 0&&(v+=` LIMIT ${p}`),d!==void 0&&(v+=` OFFSET ${d}`),v}buildFtsQuery(e,r,i,t,o=50){let s=this.connection.getAttachedRepos();if(s.length===0)throw new Error("No repositories attached");let a=i.replace(/"/g,'""'),c=t.map(u=>`c.${u}`).join(", ");return`${s.map(u=>`
|
|
591
|
+
SELECT '${u.alias}' as _repo_alias, '${u.repoPath}' as _repo_path, ${c}, bm25(${u.alias}.${e}) as _fts_rank
|
|
592
|
+
FROM ${u.alias}.${e} fts
|
|
593
|
+
JOIN ${u.alias}.${r} c ON fts.rowid = c.id
|
|
594
|
+
WHERE ${u.alias}.${e} MATCH '"${a}"'`).join(`
|
|
595
|
+
UNION ALL
|
|
596
|
+
`)} ORDER BY _fts_rank LIMIT ${o}`}buildCrossRepoImportsQuery(){let e=this.connection.getAttachedRepos();if(e.length<2)throw new Error("Cross-repo analysis requires at least 2 attached repositories");let r=[];for(let i of e)for(let t of e)i.alias!==t.alias&&r.push(`
|
|
597
|
+
SELECT
|
|
598
|
+
'${i.alias}' as source_repo, '${i.repoPath}' as source_repo_path,
|
|
599
|
+
i.file_path as source_file, i.module_specifier, i.imported_symbols,
|
|
600
|
+
'${t.alias}' as target_repo, '${t.repoPath}' as target_repo_path,
|
|
601
|
+
f.path as target_file
|
|
602
|
+
FROM ${i.alias}.imports i
|
|
603
|
+
JOIN ${t.alias}.files f ON i.resolved_path = f.path
|
|
604
|
+
WHERE i.resolved_path IS NOT NULL`);return r.join(`
|
|
605
|
+
UNION ALL
|
|
606
|
+
`)}buildUnionQuery(e,r,i){let t=this.connection.getAttachedRepos();if(t.length===0)throw new Error("No repositories attached");let o=r.join(", "),s=i?` WHERE ${i}`:"";return t.map(a=>`SELECT '${a.alias}' as _repo_alias, '${a.repoPath}' as _repo_path, ${o} FROM ${a.alias}.${e}${s}`).join(`
|
|
607
|
+
UNION ALL
|
|
608
|
+
`)}searchExports(e,r=50){let i=this.buildUnionQuery("exports",["id","name","kind","file_path","signature"],"name LIKE ?")+` LIMIT ${r*this.connection.getAttachedRepos().length}`,t=Array(this.connection.getAttachedRepos().length).fill(`%${e}%`);return this.executeFederatedQuery(i,...t)}searchFiles(e,r=50){let i=this.buildUnionQuery("files",["path","classification","content_hash"],"path LIKE ?")+` LIMIT ${r*this.connection.getAttachedRepos().length}`,t=Array(this.connection.getAttachedRepos().length).fill(`%${e}%`);return this.executeFederatedQuery(i,...t)}getVirtualEdges(e,r){let i="SELECT * FROM virtual_edges WHERE 1=1",t=[];return e&&(i+=" AND source_repo = ?",t.push(e)),r&&(i+=" AND target_repo = ?",t.push(r)),this.connection.prepare(i).all(...t)}addVirtualEdge(e){return this.connection.prepare(`
|
|
609
|
+
INSERT INTO virtual_edges
|
|
610
|
+
(source_repo, source_file_path, source_symbol_id, target_repo, target_file_path, target_symbol_id, relationship, metadata, confidence, updated_at)
|
|
611
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, unixepoch())
|
|
612
|
+
`).run(e.sourceRepo,e.sourceFilePath,e.sourceSymbolId||null,e.targetRepo,e.targetFilePath,e.targetSymbolId||null,e.relationship,e.metadata?JSON.stringify(e.metadata):null,e.confidence??1).lastInsertRowid}scanEdges(){return y$.info({name:this.connection.nameValue},"Starting edge scan"),Tg(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}}});var Cg={};Ze(Cg,{FusedIndexManager:()=>Yr,closeFusedIndex:()=>zg,getFusedIndex:()=>No,listFusedIndexes:()=>zo});import b$ from"path";function No(n){let e=qn.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>b$.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),qn.delete(n.name)}let r=new Yr(n);return qn.set(n.name,r),r}function zg(n){let e=qn.get(n);e&&(e.close(),qn.delete(n))}function zo(){return Array.from(qn.keys())}var Ng,Yr,qn,Xr=se(()=>{"use strict";Q();Ig();Pg();Ng=$.child({module:"fused-index"}),Yr=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new Ro(e),this.service=new Po(this.connection)}attachRepo(e){this.connection.attachRepo(e)}detachRepo(e){this.connection.detachRepo(e)}refreshRepo(e){this.connection.refreshRepo(e)}getAttachedRepos(){return this.connection.getAttachedRepos()}checkHealth(){return this.connection.checkHealth()}close(){this.connection.close(),Ng.info({name:this.configName},"Fused index closed")}getStatus(){let e=this.service.executeRawQuery("SELECT COUNT(*) as count FROM virtual_edges");return{name:this.connection.nameValue,path:this.connection.dbPath,attachedRepos:this.connection.getAttachedRepos().length,repos:this.connection.getAttachedRepos(),virtualEdgesCount:e[0]?.count||0}}searchExports(e,r=50){return this.service.searchExports(e,r)}searchFiles(e,r=50){return this.service.searchFiles(e,r)}getVirtualEdges(e,r){return this.service.getVirtualEdges(e,r)}addVirtualEdge(e){return this.service.addVirtualEdge(e)}scanEdges(){return this.service.scanEdges()}buildUnionQuery(e,r,i){return this.service.buildUnionQuery(e,r,i)}executeFederatedQuery(e,...r){return this.service.executeFederatedQuery(e,...r)}executeRawQuery(e,...r){return this.service.executeRawQuery(e,...r)}buildAdvancedQuery(e){return this.service.buildAdvancedQuery(e)}buildFtsQuery(e,r,i,t,o){return this.service.buildFtsQuery(e,r,i,t,o)}buildCrossRepoImportsQuery(){return this.service.buildCrossRepoImportsQuery()}refreshAll(){this.connection.refreshAll()}validateSchemas(){return Ng.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},qn=new Map});var qv={};Ze(qv,{GraphExporterService:()=>Ta});var Vv,Ta,of=se(()=>{"use strict";ee();Q();Vv=$.child({module:"graph-exporter"}),Ta=class{constructor(e){this.repoPath=e;this.repos=z.getInstance(e)}repos;async generateGraph(e={}){let{includeCompleted:r=!0,format:i="mermaid",focusMissionId:t,depth:o=10,limit:s=100}=e;Vv.info({focusMissionId:t,depth:o,format:i,includeCompleted:r},"Generating mission graph");let a=this.buildMissionTree(t,r,o,s);return i==="json"?JSON.stringify(a,null,2):this.generateMermaidDiagram(a)}buildMissionTree(e,r,i,t){let o;if(e){let c=this.repos.missions.findById(e);o=c?[c]:[]}else o=this.repos.missions.findAll().filter(l=>!l.parent_id),r||(o=o.filter(l=>l.status!=="completed"));let s=0,a=[];for(let c of o){if(s>=t)break;let l=this.buildNode(c,r,i,1,{count:s,max:t});l&&(a.push(l),s+=this.countNodes(l))}return a}buildNode(e,r,i,t,o){if(t>i||o.count>=o.max)return null;let s;if(e.strategy_graph)try{let u=JSON.parse(e.strategy_graph);s=this.parseStrategySteps(u)}catch(u){Vv.debug({missionId:e.id,err:u},"Failed to parse strategy graph")}let a={id:e.id,name:e.name,status:e.status,goal:e.goal,branch:e.git_branch||void 0,children:[],steps:s},c=this.repos.missions.findByParentId(e.id),l=r?c:c.filter(u=>u.status!=="completed");for(let u of l){if(o.count>=o.max)break;let p=this.buildNode(u,r,i,t+1,o);p&&(a.children.push(p),o.count++)}return a}parseStrategySteps(e){let r=[];return Array.isArray(e)?e.map((i,t)=>({id:i.id||`step-${t}`,description:i.description||i.content||i.name||`Step ${t+1}`,status:i.status,dependencies:i.dependencies||i.deps})):e.steps&&Array.isArray(e.steps)?this.parseStrategySteps(e.steps):typeof e=="object"?Object.entries(e).map(([i,t])=>({id:i,description:t.description||t.content||i,status:t.status,dependencies:t.dependencies||t.deps})):r}countNodes(e){let r=1;for(let i of e.children)r+=this.countNodes(i);return r}generateMermaidDiagram(e){let r=["graph TD"];for(let i of e)this.addMermaidNode(i,r);return r.join(`
|
|
613
|
+
`)}addMermaidNode(e,r,i){let t=`M${e.id}`,o=this.getStatusIcon(e.status),s=this.getStatusClass(e.status),a=`${o} ${e.name}`;if(r.push(` ${t}["${this.escapeMermaid(a)}"]:::${s}`),i&&r.push(` ${i} --> ${t}`),e.steps&&e.steps.length>0&&e.steps.length<=10)for(let c of e.steps){let l=`S${e.id}_${c.id}`,u=c.status||"pending",p=this.getStatusIcon(u),d=this.getStatusClass(u),m=`${p} ${c.description}`;if(r.push(` ${l}["${this.escapeMermaid(m)}"]:::${d}`),r.push(` ${t} -.-> ${l}`),c.dependencies&&c.dependencies.length>0)for(let f of c.dependencies){let h=`S${e.id}_${f}`;r.push(` ${h} --> ${l}`)}}for(let c of e.children)this.addMermaidNode(c,r,t);i||(r.push(""),r.push(" classDef completed fill:#90EE90,stroke:#2E8B57,stroke-width:2px"),r.push(" classDef inProgress fill:#87CEEB,stroke:#4682B4,stroke-width:2px"),r.push(" classDef planned fill:#FFE4B5,stroke:#DAA520,stroke-width:2px"),r.push(" classDef suspended fill:#D3D3D3,stroke:#808080,stroke-width:2px"),r.push(" classDef failed fill:#FFB6C1,stroke:#DC143C,stroke-width:2px"),r.push(" classDef pending fill:#FFF8DC,stroke:#B8860B,stroke-width:1px"))}getStatusIcon(e){return{completed:"\u2713","in-progress":"\u26A1",planned:"\u{1F4CB}",suspended:"\u23F8",failed:"\u2717",pending:"\u25CB",verifying:"\u{1F50D}"}[e]||"\u25CB"}getStatusClass(e){return{completed:"completed","in-progress":"inProgress",planned:"planned",suspended:"suspended",failed:"failed",pending:"pending",verifying:"inProgress"}[e]||"pending"}escapeMermaid(e){return e.replace(/"/g,"#quot;").replace(/\n/g," ").replace(/\[/g,"#91;").replace(/]/g,"#93;").slice(0,100)}}});import hx from"fast-glob";import $f from"fs";import gx from"ignore";import wf from"path";var Fi=["**/node_modules/**","**/.git/**","**/dist/**","**/build/**","**/vendor/**","**/.next/**","**/.cache/**","**/coverage/**","**/*.min.js"],Sf=["**/*.{ts,tsx,yaml,yml,php,py,go}","**/*.prisma","**/*.{graphql,gql}","**/Dockerfile*","**/.env*","**/package.json","**/lerna.json","**/turbo.json","**/pnpm-workspace.yaml"],de={MAX_DEPTH:10,MIN_DEPTH:1,MAX_LIMIT:500,MIN_LIMIT:1,MAX_QUERY_LENGTH:500,DEFAULT_DEPTH:3,DEFAULT_LIMIT:10},Ne={FILTERED_QUERY_LIMIT_MULTIPLIER:3,SCORE_BASE:1e3,EXACT_MATCH_BONUS:500,RECENT_FILE_BOOST:80,OLDER_FILE_BOOST:30,RECENT_FILE_THRESHOLD_DAYS:7,OLDER_FILE_THRESHOLD_DAYS:30,FUZZY_MATCH_LIMIT:30,ENABLE_LEXICAL_SCORING:process.env.ENABLE_LEXICAL_SCORING!=="false",LEXICAL_WEIGHT:parseFloat(process.env.LEXICAL_WEIGHT??String(.4)),GRAVITY_STRUCTURAL_WEIGHT:.5},_c={SECONDS_PER_DAY:86400,SECONDS_PER_YEAR:31536e3},Ui={DEFAULT_CONCURRENCY:parseInt(process.env.INDEX_CONCURRENCY??String(5),10)};async function xc(n,e=[]){let r=gx(),i=wf.join(n,".gitignore");return $f.existsSync(i)&&r.add($f.readFileSync(i,"utf8")),e.length>0&&r.add(e),(await hx(Sf,{cwd:n,absolute:!0,ignore:Fi,stats:!0})).filter(s=>{let a=wf.relative(n,s.path);return!r.ignores(a)}).map(s=>({path:s.path,mtime:s.stats.mtimeMs}))}import Zf from"fs";function kf(n){let e=n.split(`
|
|
614
|
+
`),r=[],i=0;for(let t of e)r.push(i),i+=t.length+1;return r}function fe(n,e){for(let r=0;r<e.length;r++)if(e[r+1]>n||r===e.length-1)return r+1;return 1}function Zi(n,e){return e.slice(0,n).toString("utf8").length}function Ef(n){if(n.toString("utf8").length===n.length)return i=>i;let r=new Map;return i=>{let t=r.get(i);return t===void 0&&(t=n.slice(0,i).toString("utf8").length,r.set(i,t)),t}}function If(n,e,r){let i=n.start-e,t=n.end-e;return i<0||t>r.length?"":r.slice(i,t).toString("utf8")}function Tf(n){let e=[],r=/\/\*\*[\s\S]*?\*\//g,i;for(;(i=r.exec(n))!==null;)e.push({start:i.index,end:i.index+i[0].length,text:i[0]});return e}function dt(n,e,r){for(let i of e){if(i.start===n)return i.text;if(i.start>n&&i.start<n+50){let t=r.substring(n,i.start);if(/^\s*$/.test(t))return i.text}if(i.end<=n&&i.end>n-50){let t=r.substring(i.end,n);if(/^\s*$/.test(t))return i.text}}return""}function Rf(n){if(!n)return"";let r=n.replace(/\/\*\*|\*\/|\*/g,"").trim().split(`
|
|
615
|
+
`)[0].trim();return r.length>200?r.substring(0,197)+"...":r}function Hi(n,e,r){let i=n.toLowerCase(),t=e.toLowerCase();return i.includes("components/")||i.endsWith(".tsx")?"Component":i.startsWith("use")||t.startsWith("use")?"Hook":i.includes("models/")||t.endsWith("model")?"Model":i.includes("services/")||i.includes("controllers/")||i.includes("handlers/")||i.includes("mcp/")||i.endsWith("service.ts")||i.endsWith("controller.ts")||i.endsWith("handler.ts")||t.endsWith("service")||t.endsWith("controller")||t.endsWith("handler")?"Service":i.includes("repositories/")||i.includes("repos/")||i.endsWith("repository.ts")||i.endsWith("repo.ts")||t.endsWith("repository")||t.endsWith("repo")?"Repository":r==="TsInterfaceDeclaration"||r==="TsTypeAliasDeclaration"?"Type Definition":"Other"}function Ar(n){let e=[];return/\b(fetch|axios|superagent|got)\s*\(|import\s+.*\b(http|https|node-fetch)\b/i.test(n)&&e.push("Network"),(/\b(knex|prisma|typeorm|mongoose|sequelize|pg|mysql|sqlite3)\b/i.test(n)||/\b(SELECT\s+.*FROM|INSERT\s+INTO|UPDATE\s+.*SET|DELETE\s+FROM)\b/i.test(n)||/\.query\s*\(|\.execute\s*\(/i.test(n)&&/db|database|client|pool/i.test(n))&&e.push("Database"),(/\bfs\./i.test(n)||/\b(readFileSync|writeFileSync|readFile|writeFile|readdir)\b/.test(n)||/import\s+.*\bfs\b/.test(n))&&e.push("File System"),(/\b(localStorage|sessionStorage|indexedDB)\./.test(n)||/\bdocument\.cookie\b/.test(n))&&e.push("Browser Storage"),e}function Ke(n,e){if(!n)return"";let r=n.trimStart();for(;/^\/\*[\s\S]*?\*\//.test(r);)r=r.replace(/^\/\*[\s\S]*?\*\/\s*/,"");for(;/^\/\/[^\n]*\n/.test(r);)r=r.replace(/^\/\/[^\n]*\n\s*/,"");if(r=r.replace(/^(?:import[^\n]*\n)+/,"").replace(/^(?:export\s+\{[^}]*\}\s+from\s+['"][^'"]+['"];?\s*\n?)+/,"").trim(),e==="TsInterfaceDeclaration"||e==="TsTypeAliasDeclaration")return r;let i=0,t=0,o=r.length;for(let a=0;a<r.length;a++){let c=r[a];if(c==="(")i++;else if(c===")")i--;else if(c==="<")t++;else if(c===">")t--;else if(c==="{"){if(i===0&&t===0){o=a;break}}else if(c===";"&&i===0&&t===0){o=a;break}else if(c==="="&&r[a+1]===">"&&i===0&&t===0){o=a+2;break}}let s=r.substring(0,o).trim();return s.length>500?s.slice(0,497)+"...":s}function Pf(n){let e=[];for(let r of n)r.type==="ImportDeclaration"&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ImportDefaultSpecifier"?"default":i.type==="ImportNamespaceSpecifier"?"*":i.local?.value||i.imported?.value||"*").join(", ")}),r.type==="ExportAllDeclaration"&&e.push({module:r.source.value,name:"*"}),r.type==="ExportNamedDeclaration"&&r.source&&e.push({module:r.source.value,name:r.specifiers.map(i=>i.type==="ExportSpecifier"?i.orig.value:"*").join(", ")});return e}function yx(n,e){for(let r of n){if((r.type==="FunctionDeclaration"||r.type==="ClassDeclaration")&&(r.identifier?.value||r.id?.value)===e)return r.span;if(r.type==="VariableDeclaration"){for(let i of r.declarations)if(i.id?.type==="Identifier"&&i.id.value===e)return i.span||r.span}if((r.type==="TsTypeAliasDeclaration"||r.type==="TsInterfaceDeclaration"||r.type==="TsEnumDeclaration")&&(r.id?.value||r.identifier?.value)===e)return r.span;if(r.type==="ExportDeclaration"){let i=r.declaration;if(!i)continue;if((i.type==="FunctionDeclaration"||i.type==="ClassDeclaration")&&(i.identifier?.value||i.id?.value)===e)return i.span||r.span;if(i.type==="VariableDeclaration"){for(let t of i.declarations)if(t.id?.type==="Identifier"&&t.id.value===e)return t.span||i.span||r.span}}}return null}function Nf(n,e,r,i,t,o,s,a,c){let l=c??(p=>Zi(p,r)),u=[];for(let p of n){if(p.type==="ExportDeclaration"){let d=p.declaration,m=d.type,f="";m==="VariableDeclaration"?f=d.declarations.map(x=>x.id.value).join("",""):f=d.id?.value||d.identifier?.value||"anonymous";let h=l(p.span.start-e),v=l(p.span.end-e),y=dt(h,o,i),b=a(p.span),_=[];if(p.type==="ExportDeclaration"&&(m==="ClassDeclaration"||m==="ClassExpression")){let x=d.body||[];for(let k of x)if(k.type==="ClassMethod"||k.type==="ClassProperty"){let I=k.key.value;if(!I)continue;let N=l(k.span.start-e),L=l(k.span.end-e),C=a(k.span),S=dt(N,o,i);_.push({name:I,kind:k.type,signature:Ke(C,k.type),line:fe(N,t),endLine:fe(L,t),doc:S,classification:k.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else if(m==="FunctionDeclaration"&&d.body?.type==="BlockStatement")_=Sc(d.body.stmts,e,r,i,t,o,a,l);else if(m==="VariableDeclaration"){for(let x of d.declarations)if(x.init&&(x.init.type==="ArrowFunctionExpression"||x.init.type==="FunctionExpression")&&x.init.body?.type==="BlockStatement"){_=Sc(x.init.body.stmts,e,r,i,t,o,a,l);break}}u.push({name:f,kind:m,signature:Ke(b,m),line:fe(h,t),endLine:fe(v,t),doc:y,classification:Hi(s,f,m),capabilities:JSON.stringify(Ar(b)),members:_})}if(p.type==="ExportNamedDeclaration"){for(let d of p.specifiers)if(d.type==="ExportSpecifier"){let m=d.orig.value,f=d.exported?.value||m,v=yx(n,m)||p.span,y=l(v.start-e),b=l(v.end-e),_=dt(y,o,i);u.push({name:f,kind:"ExportSpecifier",signature:`export { ${m} }`,line:fe(y,t),endLine:fe(b,t),doc:_,classification:"Export mapping",capabilities:"[]"})}}if(p.type==="ExportDefaultDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=dt(d,o,i),h=a(p.span),v=[];if(p.decl.type==="ClassExpression"||p.decl.type==="ClassDeclaration"){let y=p.decl.body||[];for(let b of y)if(b.type==="ClassMethod"||b.type==="ClassProperty"){let _=b.key.value;if(!_)continue;let x=l(b.span.start-e),k=l(b.span.end-e),I=a(b.span),N=dt(x,o,i);v.push({name:_,kind:b.type,signature:Ke(I,b.type),line:fe(x,t),endLine:fe(k,t),doc:N,classification:b.type==="ClassMethod"?"Method":"Property",capabilities:"[]"})}}else(p.decl.type==="FunctionExpression"||p.decl.type==="FunctionDeclaration"||p.decl.type==="ArrowFunctionExpression")&&p.decl.body?.type==="BlockStatement"&&(v=Sc(p.decl.body.stmts,e,r,i,t,o,a,l));u.push({name:"default",kind:"DefaultExport",signature:Ke(h,"DefaultExport"),line:fe(d,t),endLine:fe(m,t),doc:f,classification:"Default Export",capabilities:JSON.stringify(Ar(h)),members:v})}if(p.type==="ExportAllDeclaration"){let d=l(p.span.start-e),m=l(p.span.end-e),f=p.source.value,h=dt(d,o,i);u.push({name:"*",kind:"ExportAllDeclaration",signature:`export * from "${f}"`,line:fe(d,t),endLine:fe(m,t),doc:h,classification:"Re-export",capabilities:"[]"})}}return u}function Sc(n,e,r,i,t,o,s,a){let c=[];for(let l of n){if(l.type==="VariableDeclaration")for(let u of l.declarations){let p=[],d=f=>{if(f.type==="Identifier")p.push({name:f.value,span:f.span});else if(f.type==="ArrayPattern")for(let h of f.elements)h&&d(h);else if(f.type==="ObjectPattern")for(let h of f.properties)h.type==="AssignmentPatternProperty"?p.push({name:h.key.value,span:h.span}):h.type==="KeyValuePatternProperty"&&d(h.value)};d(u.id);let m=u.init&&(u.init.type==="ArrowFunctionExpression"||u.init.type==="FunctionExpression");for(let f of p){let h=m?u.init.span||u.span||f.span:u.span||f.span,v=m?u.init.type:"VariableDeclaration",y=m?"Internal Function":"Internal Variable",b=a(h.start-e),_=a(h.end-e),x=s(h),k=dt(b,o,i);c.push({name:f.name,kind:v,signature:Ke(x,v),line:fe(b,t),endLine:fe(_,t),doc:k,classification:y,capabilities:"[]"})}}if(l.type==="FunctionDeclaration"){let u=l.identifier?.value||l.ident?.value||"anonymous",p=a(l.span.start-e),d=a(l.span.end-e),m=s(l.span),f=dt(p,o,i);c.push({name:u,kind:"FunctionDeclaration",signature:Ke(m,"FunctionDeclaration"),line:fe(p,t),endLine:fe(d,t),doc:f,classification:"Internal Function",capabilities:"[]"})}if(l.type==="ReturnStatement"&&l.argument?.type==="ObjectExpression")for(let u of l.argument.properties){let p="",d=u.span||u.key?.span||u.ident?.span;if(u.type==="KeyValueProperty"){let m=u.key;p=m?.value||m?.raw||(m?.type==="Identifier"?m.value:"")}else u.type==="MethodProperty"?p=u.key?.value||u.key?.raw||"":u.type==="ShorthandProperty"?p=u.ident?.value||"":u.type==="Identifier"&&(p=u.value||"");if(p&&d){let m=a(d.start-e),f=a(d.end-e),h=s(d),v=dt(m,o,i);c.push({name:p,kind:"ReturnProperty",signature:Ke(h,"ReturnProperty"),line:fe(m,t),endLine:fe(f,t),doc:v,classification:"Return Member",capabilities:"[]"})}}if(l.type==="ExpressionStatement"&&l.expression.type==="CallExpression"){let u=l.expression;if(u.callee.type==="MemberExpression"&&(u.callee.property?.value==="on"||u.callee.property?.value==="once")){let p=u.arguments[0]?.expression?.value,d=u.arguments[1]?.expression;if(p&&d&&(d.type==="ArrowFunctionExpression"||d.type==="FunctionExpression")){let m=a(d.span.start-e),f=a(d.span.end-e),h=s(d.span);c.push({name:`on:${p}`,kind:d.type,signature:Ke(h,d.type),line:fe(m,t),endLine:fe(f,t),doc:"",classification:"Event Handler",capabilities:"[]"})}}if(u.callee.type==="Identifier"&&u.callee.value==="addRoute"&&u.arguments.length>=3){let p=u.arguments[2].expression;if(p.type==="StringLiteral"){let d=p.value,m=a(u.span.start-e),f=a(u.span.end-e),h=s(u.span);c.push({name:d,kind:"HTTP Route",signature:Ke(h,"HTTP Route"),line:fe(m,t),endLine:fe(f,t),doc:"",classification:"Service Boundary",capabilities:JSON.stringify({path:d})})}}}}return c}function zf(n,e,r,i,t,o){let s=o??(l=>Zi(l,r)),a=[];function c(l){if(!(!l||typeof l!="object")){if(l.type==="CallExpression"){let u=bx(l);if(u){let p=s(l.span.start-e);a.push({...u,line:fe(p,i),snippet:t(l.span)})}}for(let u of Object.keys(l)){if(u==="span")continue;let p=l[u];Array.isArray(p)?p.forEach(c):typeof p=="object"&&c(p)}}}return n.forEach(c),a}function bx(n){let{callee:e,arguments:r}=n;if(!r||r.length===0)return null;if(e.type==="Identifier"&&e.value,e.type==="Identifier"&&e.value==="addRoute"&&r.length>=3){let i=r[2].expression;if(i.type==="StringLiteral")return{type:"api_route",name:i.value,direction:"consume"}}if(e.type==="MemberExpression"&&e.property?.type==="Identifier"){let i=e.property.value;if(i==="emit"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"produce"};if(i==="on"&&r[0].expression.type==="StringLiteral")return{type:"socket_event",name:r[0].expression.value,direction:"consume"};if(["get","post","put","delete","patch"].includes(i)&&r[0].expression.type==="StringLiteral"){let o=r[0].expression.value,s=e.object.type==="Identifier"?e.object.value:"";if(["axios","http","request","appApi","restApi","adminApi","client"].includes(s))return{type:"api_route",name:o,direction:"produce"};if(o.startsWith("/"))return{type:"api_route",name:o,direction:"consume"}}}return e.type==="Identifier"&&e.value==="fetch"&&r[0].expression.type==="StringLiteral"?{type:"api_route",name:r[0].expression.value,direction:"produce"}:null}function Dr(n){let{classification:e,capabilities:r,exports:i,fileName:t}=n,o={Network:"API integration",Database:"data persistence","File System":"file I/O operations","Browser Storage":"client-side storage"},s=r.map(f=>o[f]).filter(Boolean).join(" and "),c={Component:(f,h)=>{let v=h.find(b=>b.kind==="FunctionDeclaration"||b.kind==="ClassDeclaration")?.name,y=v?`React component: ${v}`:"React UI component";return f?`${y} with ${f}`:y},Hook:(f,h)=>{let v=h.find(b=>b.name.startsWith("use"))?.name,y=v?`Custom React hook: ${v}`:"Custom React hook";return f?`${y} for ${f}`:y},Service:(f,h)=>{let y=`Service layer: ${h[0]?.name||"Service"}`;return f?`${y} handling ${f}`:y},Repository:(f,h)=>`Data repository: ${h[0]?.name||"Repository"} for ${f||"data access"}`,"Type Definition":(f,h)=>`Type definitions: ${h.slice(0,3).map(y=>y.name).join("")}${h.length>3?"...":""}`,Model:(f,h)=>`Data model: ${h[0]?.name||"Model"}`,"HTTP Route":(f,h)=>{let v=h.filter(y=>y.classification==="Service Boundary");return v.length>0?`API endpoints: ${v.slice(0,3).map(y=>y.name).join("")}`:"API route handler"},"Micro IR (PHP)":(f,h)=>{let v=h.some(b=>b.classification==="Service Boundary"),y=h.find(b=>b.kind==="ClassDeclaration")?.name;return v?"PHP controller with API routes":y?`PHP class: ${y}`:"PHP module"},"Micro IR (Python)":(f,h)=>{let v=h.some(b=>b.classification==="Service Boundary"),y=h.find(b=>b.kind==="ClassDeclaration")?.name;return v?"Python API handler with routes":y?`Python class: ${y}`:"Python module"},"Micro IR (Go/TS) ":(f,h)=>{let v=h.some(b=>b.kind==="TypeDeclaration"),y=h.filter(b=>b.kind==="FunctionDeclaration");return v&&y.length>0?`Go package: types and ${y.length} function(s)`:v?"Go package: type definitions":y.length>0?`Go package: ${y[0].name} and ${y.length} function(s)`:"Go module"},"Micro IR (Rust/TS) ":(f,h)=>{let v=h.find(_=>_.kind==="TraitDeclaration")?.name,y=h.find(_=>_.kind==="StructDeclaration")?.name,b=h.filter(_=>_.kind==="FunctionDeclaration");return v?f.includes("Rust trait")?`Rust module: trait ${v}`:`Rust module: ${v}`:y?`Rust module: struct ${y}`:b.length>0?`Rust module: ${b.length} function(s)`:"Rust module"}}[e];if(c)return c(s,i);if(i.length===0)return t?`Module: ${t}`:"Module with no exports";let l=i.filter(f=>f.kind==="FunctionDeclaration"),u=i.filter(f=>f.kind==="ClassDeclaration"),p=i.filter(f=>f.kind==="TsInterfaceDeclaration"||f.kind==="TsTypeAliasDeclaration"),d=[];if(u.length>0&&d.push(`Class: ${u[0].name}`),l.length>0){let f=l.slice(0,2).map(h=>h.name).join("");d.push(`Functions: ${f}`)}p.length>0&&d.push(`Types: ${p.length}`);let m=d.length>0?d.join(" | "):`Module with ${i.length} export(s)`;return s?`${m} \u2014 ${s}`:m}function Cf(n){let e=new Set;function r(i){if(!(!i||typeof i!="object")){i.typeAnnotation&&ve(i.typeAnnotation,e),(i.type==="TsTypeReference"||i.type==="TsTypeAnnotation")&&ve(i,e);for(let t in i){if(t==="span"||t==="comments"||t==="interpreter")continue;let o=i[t];o&&typeof o=="object"&&(Array.isArray(o)?o.forEach(r):r(o))}}}return n.forEach(i=>r(i)),Array.from(e)}function ve(n,e){if(n){if(n.type==="TsTypeAnnotation"){ve(n.typeAnnotation,e);return}n.type==="TsTypeReference"&&(n.typeName?.type==="Identifier"&&e.add(n.typeName.value),n.typeName?.type==="TsQualifiedName"&&Af(n.typeName,e),n.typeParams&&ve(n.typeParams,e)),n.type==="TsArrayType"&&ve(n.elementType,e),n.type==="TsUnionType"&&n.types?.forEach(r=>ve(r,e)),n.type==="TsIntersectionType"&&n.types?.forEach(r=>ve(r,e)),n.type==="TsTupleType"&&n.elemTypes?.forEach(r=>ve(r.ty,e)),(n.type==="TsFunctionType"||n.type==="TsConstructorType")&&(n.params?.forEach(r=>ve(r.typeAnnotation,e)),n.typeAnnotation&&ve(n.typeAnnotation,e)),n.type==="TsTypeParameterDeclaration"&&n.params?.forEach(r=>{r.constraint&&ve(r.constraint,e),r.default&&ve(r.default,e)}),n.type==="TsTypeParameterInstantiation"&&n.params?.forEach(r=>ve(r,e)),n.type==="TsMappedType"&&n.typeAnnotation&&ve(n.typeAnnotation,e),n.type==="TsIndexedAccessType"&&(ve(n.objectType,e),ve(n.indexType,e)),n.type==="TsConditionalType"&&(ve(n.checkType,e),ve(n.extendsType,e),ve(n.trueType,e),ve(n.falseType,e)),n.type==="TsTypeLiteral"&&n.members?.forEach(r=>{r.typeAnnotation&&ve(r.typeAnnotation,e)})}}function Af(n,e){n.type==="TsQualifiedName"?(n.left&&Af(n.left,e),n.right?.value&&e.add(n.right.value)):n.type==="Identifier"&&e.add(n.value)}import Hf from"path";import wc from"path";Q();Ln();import Mf from"path";import Ix from"fs";import{fileURLToPath as Tx}from"url";import*as pn from"web-tree-sitter";var GT=Mf.dirname(Tx(import.meta.url)),Of=$.child({module:"parser:tree-sitter"}),Wi=class{parser=null;languages=new Map;async ensureInitialized(){if(this.parser)return;let e=pn.Parser||pn;await e.init(),this.parser=new e}async getLanguage(e){if(this.languages.has(e))return this.languages.get(e);let r=nt("resources","grammars",`tree-sitter-${this.getLangName(e)}.wasm`);if(!Ix.existsSync(r))return Of.warn({grammarPath:r},"Grammar WASM not found"),null;try{let i=await pn.Language.load(r);return this.languages.set(e,i),i}catch(i){return Of.error({err:i,ext:e},"Failed to load language grammar"),null}}getLangName(e){switch(e.toLowerCase()){case".php":return"php";case".py":return"python";case".go":return"go";case".rs":return"rust";default:return""}}getQueries(e){switch(e.toLowerCase()){case".php":return`
|
|
463
616
|
(function_definition name: (name) @name) @func
|
|
464
617
|
(class_declaration name: (name) @name) @class
|
|
465
618
|
(interface_declaration name: (name) @name) @interface
|
|
@@ -483,230 +636,180 @@ ORDER BY dc.depth, dc.consumer_path;
|
|
|
483
636
|
(trait_item name: (_type_identifier) @name) @trait
|
|
484
637
|
(type_item name: (_type_identifier) @name) @type
|
|
485
638
|
(use_declaration argument: (_) @name) @import
|
|
486
|
-
`;default:return""}}mapKind(e,r){if(e==="import")return"ImportDeclaration";if(r===".php"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration";if(e==="interface")return"InterfaceDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="method")return"MethodDeclaration"}if(r===".py"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration"}if(r===".go"){if(e==="func")return"FunctionDeclaration";if(e==="type")return"TypeDeclaration"}if(r===".rs"){if(e==="func")return"FunctionDeclaration";if(e==="struct")return"StructDeclaration";if(e==="enum")return"EnumDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="type")return"TypeDeclaration"}return"Unknown"}mapClassification(e){return e==="import"?"Dependency":e==="func"||e==="method"?"Function":e==="class"||e==="interface"||e==="trait"||e==="struct"||e==="enum"||e==="type"?"Class":"Other"}async parse(e,r){await this.ensureInitialized();let i=
|
|
487
|
-
`),a=this.getQueries(i);if(!a)return[];let l=new
|
|
488
|
-
`),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,h=r?"api":"",
|
|
489
|
-
`).trim(),capabilities:JSON.stringify(
|
|
490
|
-
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let
|
|
491
|
-
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let
|
|
492
|
-
`).trim();if(
|
|
493
|
-
`),o=[{indent:-1,name:"root",type:"root"}],s=[],a=/^class\s+([a-zA-Z0-9_]+)/,c=/^async\s+def\s+([a-zA-Z0-9_]+)|^def\s+([a-zA-Z0-9_]+)/,l=/^(?:from\s+([a-zA-Z0-9_\.]+)\s+import|import\s+([a-zA-Z0-9_\.]+))/,u=/^@(.*)/;function p(
|
|
494
|
-
`).trim()),h=[]}else h.push(
|
|
495
|
-
`).length;t.push({name:u.name||"anonymous",kind:u.kind||"Unknown",classification:u.classification||"Other",signature:u.signature||l[0],line:p,endLine:p,doc:"",capabilities:JSON.stringify(u.meta||{})})}}let a=mr({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(c=>({name:c.name,kind:c.kind,classification:c.classification})),fileName:Ba.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:a||"Module",parseStatus:t.length>0?"success":"partial"}}};J();var Ga=new Si;async function fr(n){let e=Qm.extname(n);if(Ga.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await Xm.promises.readFile(n,"utf-8");return{...await Ga.parse(n,o),content:o}}catch(o){return b.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await Xm.promises.readFile(n)}catch(o){return{exports:[],imports:[],classification:"Error",summary:"",content:"",parseStatus:"failed",parseError:`File read error: ${o.message}`}}let i=r.toString("utf8"),t=Cm(i);try{let o=n.endsWith(".tsx"),s=n.endsWith(".d.ts")||n.endsWith(".d.tsx"),a,c={syntax:"typescript",tsx:o,decorators:!0,comments:!0};if(s)try{a=Ja.parseSync(i,c)}catch{a=Ja.parseSync(i,{...c,isModule:!1})}else a=Ja.parseSync(i,c);let l=a.span.start,u=jm(r),p=Um(i),d=S=>Mm(S,l,r),m=Zm(a.body),f=Bm(a.body);f.length>0&&b.debug({filePath:n,count:f.length},"Extracted type references"),f.forEach(S=>{m.push({module:"__type_reference__",name:S})});let h=Hm(a.body,l,r,i,t,p,n,d,u),_=Wm(a.body,l,r,t,d,u),v=yi(n,"","Module"),y=p.length>0&&p[0].start===0?p[0].text:h.find(S=>S.doc)?.doc||"",k=Fm(y);if(!k&&h.length>0){let S=dr(i);k=mr({classification:v,capabilities:S,exports:h.map($=>({name:$.name,kind:$.kind,classification:$.classification})),fileName:Qm.basename(n)})}return{exports:h,imports:m,events:_,classification:v,summary:k,content:i,parseStatus:"success"}}catch(o){b.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await Ga.parse(n,i);return{...s,content:i,classification:s.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return b.error({filePath:n,error:s.message},"All parsing strategies failed"),{exports:[],imports:[],classification:"Error",summary:"",content:i,parseStatus:"failed",parseError:`All parsing strategies failed: ${s.message}`}}}}function H_(n,e=500){let r=[],i=[],t=0;return n.forEach(o=>{let s=o.doc?.split(/\s+/).length||0;t+s>e&&(r.push(i),i=[],t=0),i.push(o),t+=s}),i.length&&r.push(i),r}import $i from"path";var W_=50;function hr(n,e,r,i){let t={name:$i.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=$i.relative(e,o.path).split($i.sep),c=t;for(let l=0;l<a.length;l++){let u=a[l];if(i!==void 0&&l>=i)return;let p=l===a.length-1;if(i===1&&l===0&&p)return;let d=i!==void 0&&l===i-1&&!p,m=$i.join(e,...a.slice(0,l+1)),f=c.children?.find(h=>h.name===u);if(!f){if(c.children&&c.children.length>=W_){c.children.find(v=>v.type==="truncated")||c.children.push({name:"... (truncated) ",type:"truncated",path:"",children:void 0});return}f={name:u,type:p?"file":"directory",path:m,children:p||d?void 0:[],summary:p?{classification:o.classification,summaryText:o.summary,exports:o.exports,imports:o.imports,chunks:o.chunks}:void 0},f.summary&&(r==="structure"||r==="signatures")&&(delete f.summary.chunks,delete f.summary.imports),c.children?.push(f)}c=f}}),t}J();import fc from"p-limit";var Va=class{startTime=Date.now();indexRuns=0;indexCacheHits=0;lastIndexDurationMs=null;lastIndexCompletedAt=null;lastRunPhases=[];queryCount=0;lastQueryLatencyMs=null;recentLatencySumMs=0;recentLatencyCount=0;recentLatencies=[];searchHistoryFailureCount=0;recordIndexStart(){this.indexRuns+=1}recordIndexCacheHit(){this.indexCacheHits+=1}recordIndexEnd(e){this.lastIndexDurationMs=e,this.lastIndexCompletedAt=Date.now()}recordIndexPhase(e,r){this.lastRunPhases.push({phase:e,durationMs:r})}clearIndexPhases(){this.lastRunPhases=[]}recordQueryStart(){let e=performance.now();return()=>{this.queryCount+=1;let r=performance.now()-e;if(this.lastQueryLatencyMs=r,this.recentLatencies.push(r),this.recentLatencies.length>100){let i=this.recentLatencies.shift();this.recentLatencySumMs=this.recentLatencySumMs-i+r}else this.recentLatencySumMs+=r,this.recentLatencyCount=this.recentLatencies.length}}recordSearchHistoryFailure(){this.searchHistoryFailureCount+=1}getSnapshot(){let e=this.recentLatencies.length,r=e>0?this.recentLatencies.reduce((i,t)=>i+t,0)/e:null;return{index:{runs:this.indexRuns,cacheHits:this.indexCacheHits,lastDurationMs:this.lastIndexDurationMs,lastCompletedAt:this.lastIndexCompletedAt,lastRunPhases:[...this.lastRunPhases]},query:{count:this.queryCount,lastLatencyMs:this.lastQueryLatencyMs,recentLatencySumMs:this.recentLatencySumMs,recentLatencyCount:e,avgLatencyMs:r,searchHistoryFailures:this.searchHistoryFailureCount},uptimeMs:Date.now()-this.startTime}}reset(){this.indexRuns=0,this.indexCacheHits=0,this.lastIndexDurationMs=null,this.lastIndexCompletedAt=null,this.lastRunPhases=[],this.queryCount=0,this.lastQueryLatencyMs=null,this.recentLatencySumMs=0,this.recentLatencyCount=0,this.recentLatencies=[],this.searchHistoryFailureCount=0}},mt=new Va;function B_(){return mt}function ef(){mt.recordIndexStart()}function ki(){mt.recordIndexCacheHit()}function tf(n){mt.recordIndexEnd(n)}function gr(n,e){mt.recordIndexPhase(n,e)}function nf(){mt.clearIndexPhases()}function Vt(){return mt.recordQueryStart()}function rt(){mt.recordSearchHistoryFailure()}function qa(){return mt.getSnapshot()}Et();import hc from"path";import Mb from"fs";import Ub from"os";import qe from"path";import xn from"fs";import{loadConfig as rb,createMatchPath as ib}from"tsconfig-paths";import It from"path";import _r from"fs";var Tt=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function uf(n){let e;try{e=_r.statSync(n).isDirectory()?n:It.dirname(n)}catch(r){throw r.code==="ENOENT"?new Tt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Tt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Tt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==It.dirname(e);){let r=It.join(e,"tsconfig.json");if(_r.existsSync(r))return e;e=It.dirname(e)}return null}function pf(n){let e;try{e=_r.statSync(n).isDirectory()?n:It.dirname(n)}catch(r){throw r.code==="ENOENT"?new Tt("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Tt("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Tt("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==It.dirname(e);){let r=It.join(e,"package.json");if(_r.existsSync(r))try{if(JSON.parse(_r.readFileSync(r,"utf8")).workspaces)return e}catch{}e=It.dirname(e)}return null}import vn from"path";import Kt from"fs";function df(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=vn.join(n,o);if(!Kt.existsSync(s))continue;let a=Kt.readdirSync(s);for(let c of a){let l=vn.join(s,c,"package.json");if(Kt.existsSync(l))try{let u=JSON.parse(Kt.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:vn.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function mf(n){let e=new Map;try{let r=JSON.parse(Kt.readFileSync(n,"utf8")),i={...r.dependencies,...r.devDependencies};for(let[t,o]of Object.entries(i))if(typeof o=="string"&&o.startsWith("file:")){let s=o.substring(5),a=vn.dirname(n),c=vn.resolve(a,s),l=vn.join(c,"package.json");if(Kt.existsSync(l))try{let u=JSON.parse(Kt.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import ff from"path";import Ve from"fs";var tb=[".ts",".tsx",".d.ts",".js",".jsx"];function Ue(n){let e=ff.extname(n);if(e===".js"||e===".jsx"){let r=n.slice(0,-e.length),i=e===".jsx"?[".tsx",".ts"]:[".ts",".tsx"];for(let t of i){let o=r+t;if(Ve.existsSync(o)&&Ve.statSync(o).isFile())return o}if(Ve.existsSync(n)&&Ve.statSync(n).isFile())return n}if(Ve.existsSync(n)&&Ve.statSync(n).isFile())return n;for(let r of tb){let i=n+r;if(Ve.existsSync(i)&&Ve.statSync(i).isFile())return i}if(Ve.existsSync(n)&&Ve.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=ff.join(n,"index"+r);if(Ve.existsSync(i))return i}return""}import _n from"path";import nb from"fs";function Pi(n,e,r){if(n.startsWith(".")){let t=_n.dirname(e),o=_n.resolve(t,n),s=Ue(o);return s?{resolved:!0,resolvedPath:s}:{resolved:!1,error:`File not found at relative path: ${o}`,suggestion:"Check if the file exists and has a supported extension (.ts, .tsx, .js, .jsx)"}}let i=bn(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Ue(o);return s?{resolved:!0,resolvedPath:s}:{resolved:!1,error:`Path alias matched to '${o}' but file does not exist`,suggestion:"Check if the target file exists or if the alias mapping in tsconfig.json is correct"}}}if(!n.startsWith("@")){let o=_n.resolve(i.baseUrl,n),s=Ue(o);if(s)return{resolved:!0,resolvedPath:s}}let t=i.workspacePackages.get(n);if(t){let o=_n.join(t.path,"src/index.ts");if(nb.existsSync(o))return{resolved:!0,resolvedPath:o};let s=_n.join(t.path,t.main),a=Ue(s);return a?{resolved:!0,resolvedPath:a}:{resolved:!1,error:`Workspace package '${n}' found at ${t.path} but entry point not found`,suggestion:`Check main field in ${_n.join(t.path,"package.json")}`}}}else return{resolved:!1,error:"No tsconfig.json found",suggestion:"Ensure a tsconfig.json exists in the project root or parent directories"};return n.startsWith("@")?{resolved:!1,error:`Path alias '${n}' not found in tsconfig.json paths`,suggestion:'Check tsconfig.json "paths" configuration'}:{resolved:!1,error:"Module not found (treated as external) ",suggestion:"Install dependency or check import path"}}var Ri=new Map;function bn(n){let e=uf(n);if(!e)return null;if(Ri.has(e))return Ri.get(e)||null;let r=rb(e);if(r.resultType==="failed")return Ri.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?qe.dirname(i.configFileAbsolutePath):e);let o=ib(t,i.paths,i.mainFields,i.addMatchAll),s=pf(e),a=new Map;if(s){let p=qe.join(s,"package.json");if(xn.existsSync(p))try{let d=JSON.parse(xn.readFileSync(p,"utf8"));a=df(s,d)}catch{}}let c=qe.join(e,"package.json");xn.existsSync(c)&&mf(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=qe.join(e,"package.json");if(xn.existsSync(u))try{let p=JSON.parse(xn.readFileSync(u,"utf8"));if(p.imports){for(let[d,m]of Object.entries(p.imports))if(typeof m=="string"||typeof m=="object"&&m!==null){let f=m;Array.isArray(m)&&(f=m[0]),typeof f=="object"&&(f=f.default||f.node),typeof f=="string"&&l.imports.set(d,f)}}}catch{}return Ri.set(e,l),l}function Pt(n,e,r){if(!n)return"";if(n.includes(".")&&!n.startsWith(".")&&!n.startsWith("/")&&!n.endsWith(".js")&&!n.endsWith(".ts")&&!n.endsWith(".json")){let t=n.split(".")[0];if(t&&t!==n){let o=Pt(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=qe.dirname(e),o=qe.resolve(t,n);return Ue(o)}let i=bn(e);if(i){let t=i.matchPath(n);if(t)return Ue(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=qe.resolve(i.baseUrl,n),a=Ue(s);if(a)return a}for(let[s,a]of i.imports.entries())if(s.includes("*")){let c="^"+s.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",l=new RegExp(c),u=n.match(l);if(u){let p=u[1],d=a.replace("*",p),m=qe.resolve(i.baseUrl,d);return Ue(m)}}else if(s===n){let c=qe.resolve(i.baseUrl,a);return Ue(c)}let o=i.workspacePackages.get(n);if(o){let s=qe.join(o.path,"src/index.ts");if(xn.existsSync(s))return s;let a=qe.join(o.path,o.main),c=Ue(a);if(c)return c}}return""}import ob from"fs";import sb from"path";import gf from"js-yaml";function hf(n){let e=sb.basename(n),r=ob.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...ub(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...pb(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...mb(r,n),content:r}:e==="turbo.json"?{...fb(r,n),content:r}:e==="pnpm-workspace.yaml"?{...hb(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",ab(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",cb(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",lb(r,i)):e==="package.json"&&(t="Project Manifest",db(r,i)),{configs:i,classification:t,content:r})}function ab(n,e){let r=n.split(`
|
|
496
|
-
`);for(let i of r){let t=i.trim();if(t.startsWith("FROM "))e.push({key:"base_image",value:t.substring(5).trim(),kind:"Image"});else if(t.startsWith("EXPOSE "))e.push({key:"port",value:t.substring(7).trim(),kind:"Port"});else if(t.startsWith("ENV ")){let o=t.substring(4).trim().split(/\s+|=/);if(o[0]){let s=o[0],a=o.slice(1).join("= ").trim()||"undefined",c="Env";(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function cb(n,e){try{let r=gf.load(n);if(!r||typeof r!="object")return;if(r.services&&typeof r.services=="object")for(let[t,o]of Object.entries(r.services)){if(!o||typeof o!="object")continue;let s=o;if(e.push({key:`service:${t}`,value:t,kind:"Service"}),s.image&&e.push({key:`service:${t}:image`,value:String(s.image),kind:"Image"}),Array.isArray(s.ports)&&s.ports.forEach(a=>{e.push({key:`service:${t}:port`,value:String(a),kind:"Port"})}),s.environment){if(Array.isArray(s.environment))s.environment.forEach(a=>{let[c,...l]=a.split("= ");c&&l.length>0&&e.push({key:`service:${t}:env:${c}`,value:l.join("= "),kind:"Env"})});else if(typeof s.environment=="object")for(let[a,c]of Object.entries(s.environment))e.push({key:`service:${t}:env:${a}`,value:String(c),kind:"Env"})}if(Array.isArray(s.depends_on))s.depends_on.forEach(a=>{e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})});else if(s.depends_on&&typeof s.depends_on=="object")for(let a of Object.keys(s.depends_on))e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})}let i=(t,o="")=>{if(!(!t||typeof t!="object"||Array.isArray(t)))for(let[s,a]of Object.entries(t)){let c=o?`${o}.${s}`:s;if(r.services&&(c.startsWith("services.")||c==="services")){a&&typeof a=="object"&&!Array.isArray(a)&&i(a,c);continue}if(a&&typeof a=="object"&&!Array.isArray(a))i(a,c);else if(a!=null){let l=String(a);if(l==="[object Object]"||l.includes("[object Object]"))continue;let u="Env",p=/^[a-z0-9_-]+$/i.test(l),d=l.includes("://");s.toLowerCase().includes("service")&&(p||d)&&(u="Service"),s.toLowerCase().includes("image")&&(u="Image"),s.toLowerCase().includes("port")&&(u="Port"),(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&d&&(u="Service"),e.push({key:c,value:l.length>200?l.substring(0,197)+"...":l,kind:u})}}};i(r)}catch{let i=n.match(/^\s{2}([a-z0-9_-]+):/gm);i&&i.forEach(t=>{let o=t.trim().replace(" : ","");o!=="services"&&o!=="version"&&o!=="volumes"&&o!=="networks"&&e.push({key:"service",value:o,kind:"Service"})})}}function lb(n,e){let r=n.split(`
|
|
497
|
-
`);for(let i of r){let t=i.trim();if(t
|
|
498
|
-
`)
|
|
499
|
-
`).
|
|
500
|
-
`).some(
|
|
501
|
-
`).
|
|
502
|
-
`).filter(Boolean).forEach(o=>
|
|
503
|
-
`).
|
|
504
|
-
`).filter(
|
|
505
|
-
`).filter(Boolean);
|
|
506
|
-
`)
|
|
639
|
+
`;default:return""}}mapKind(e,r){if(e==="import")return"ImportDeclaration";if(r===".php"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration";if(e==="interface")return"InterfaceDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="method")return"MethodDeclaration"}if(r===".py"){if(e==="func")return"FunctionDeclaration";if(e==="class")return"ClassDeclaration"}if(r===".go"){if(e==="func")return"FunctionDeclaration";if(e==="type")return"TypeDeclaration"}if(r===".rs"){if(e==="func")return"FunctionDeclaration";if(e==="struct")return"StructDeclaration";if(e==="enum")return"EnumDeclaration";if(e==="trait")return"TraitDeclaration";if(e==="type")return"TypeDeclaration"}return"Unknown"}mapClassification(e){return e==="import"?"Dependency":e==="func"||e==="method"?"Function":e==="class"||e==="interface"||e==="trait"||e==="struct"||e==="enum"||e==="type"?"Class":"Other"}async parse(e,r){await this.ensureInitialized();let i=Mf.extname(e).toLowerCase(),t=await this.getLanguage(i);if(!t||!this.parser)return[];this.parser.setLanguage(t);let o=this.parser.parse(r),s=r.split(`
|
|
640
|
+
`),a=this.getQueries(i);if(!a)return[];let l=new pn.Query(t,a).matches(o.rootNode),u=[];for(let p of l){let d=p.captures.find(h=>h.name==="name")?.node,m=p.captures[0].node,f=p.captures[0].name;if(d){let h=m.startPosition.row+1,v=m.endPosition.row+1,y=s[m.startPosition.row].trim();u.push({name:d.text,kind:this.mapKind(f,i),classification:this.mapClassification(f),signature:y,line:h,endLine:v,doc:"",capabilities:"{}"})}}return u}};var Bi=class{parse(e,r=!1){let i=[],t=[],o=e.split(`
|
|
641
|
+
`),s="",a="",c=0,l=0,u=-1,p=-1,d=[],m=[],f=!1,h=r?"api":"",v="",y=/^namespace\s+([a-zA-Z0-9_\\]+);/,b=/^(?:abstract\s+)?(?:readonly\s+)?class\s+([a-zA-Z0-9_]+)/,_=/^interface\s+([a-zA-Z0-9_]+)/,x=/^trait\s+([a-zA-Z0-9_]+)/,k=/^(?:public|protected|private|static|\s)*function\s+([a-zA-Z0-9_]+)\s*\(/,I=/^use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/,N=/^#\[([a-zA-Z0-9_\\]+)(?:\((.*)\))?\]/,L=/(?:Route::|router->|\$router->|->)(get|post|put|delete|patch|match)\s*\(\s*(?:uri\s*:\s*)?['"]([^'"]+)['"]/,C=/->prefix\s*\(\s*(?:prefix\s*:\s*)?['"]([^'"]+)['"]/;for(let S=0;S<o.length;S++){let R=o[S].trim();if(!R)continue;let A=(R.match(/{/g)||[]).length,H=(R.match(/}/g)||[]).length,W=l;if(l+=A-H,a&&l<=p){let B=i.find(X=>X.name===a&&X.line===c);B&&(B.endLine=S+1),a="",p=-1}if(s&&l<=u){let B=i.find(X=>X.name===s&&(X.kind==="ClassDeclaration"||X.kind==="TraitDeclaration"||X.kind==="InterfaceDeclaration"));B&&(B.endLine=S+1),s="",u=-1}let O=R.match(C);if(O&&(h=O[1]),R.includes("});")&&(h=""),R.startsWith("/**")){f=!0,m=[];continue}if(f){R.endsWith("*/")?f=!1:m.push(R.replace(/^\*\s?/,""));continue}let K=R.match(N);if(K){d.push(K[1]);continue}let D=R.match(y);if(D){v=D[1]||"",d=[],m=[];continue}let M=R.match(b);if(M){s=M[1],u=l-A;let B={attributes:d};v&&(B.namespace=v),i.push({name:s,kind:"ClassDeclaration",classification:"Class",signature:`class ${s}`,line:S+1,endLine:S+1,doc:m.join(`
|
|
642
|
+
`).trim(),capabilities:JSON.stringify(B),members:[]}),d=[],m=[];continue}let V=R.match(_);if(V){let B=V[1];s=B,u=l-A,i.push({name:B,kind:"InterfaceDeclaration",classification:"Interface",signature:`interface ${B}`,line:S+1,endLine:S+1,doc:m.join(`
|
|
643
|
+
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let J=R.match(x);if(J){let B=J[1];s=B,u=l-A,i.push({name:B,kind:"TraitDeclaration",classification:"Trait",signature:`trait ${B}`,line:S+1,endLine:S+1,doc:m.join(`
|
|
644
|
+
`).trim(),capabilities:JSON.stringify({attributes:d}),members:[]}),d=[],m=[];continue}let P=R.match(k);if(P){let B=P[1],X=!!s;a=B,c=S+1,p=l-A;let me=!1,Se={};for(let $e of d)$e.toLowerCase().includes("route")&&(me=!0,Se={type:"route",method:"GET",path:"/"});let Ie=m.join(`
|
|
645
|
+
`).trim();if(me){let $e=Se.path||"/";i.push({name:$e,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${B}`,line:S+1,endLine:S+1,doc:Ie,capabilities:JSON.stringify({type:"route",handler:s?`${s}@${B}`:B,...Se})}),t.push({type:"api_route",name:$e,direction:"consume",line:S+1,snippet:R})}i.push({name:B,kind:X?"MethodDeclaration":"FunctionDeclaration",classification:X?"Method":"Function",signature:`${X?s+":: ":""}${B}`,line:S+1,endLine:S+1,doc:Ie,capabilities:JSON.stringify({attributes:d})}),d=[],m=[];continue}let E=R.match(I);if(E){let B=E[1]||"",X=E[2]||B.split("\\").pop()||"";i.push({name:X,kind:"ImportSpecifier",classification:"Dependency",signature:`use ${B}`,line:S+1,endLine:S+1,doc:"",capabilities:JSON.stringify({type:"use",namespace:B})}),d=[],m=[];continue}let G=R.match(L);if(G){let B=G[1].toUpperCase(),X=G[2];if(R.includes("Route::")||R.includes("router->")||R.includes("action")||R.includes(",")&&!R.includes("view(")){if(h){let be=h.startsWith("/")?h:`/${h}`,ut=X.startsWith("/")?X:`/${X}`;X=(be+ut).replace(/\/+/g,"/")}let Se=null,Ie=R.match(/\[\s*([a-zA-Z0-9_]+)::class\s*,\s*['"]([^'"]+)['"]\s*\]/);if(Ie)Se=`${Ie[1]}@${Ie[2]}`;else if(R.includes("::class")){let be=R.match(/([a-zA-Z0-9_]+)::class/);be&&(Se=be[1])}let $e=R;!R.endsWith(");")&&S+1<o.length&&($e+=" "+o[S+1].trim(),!$e.endsWith(");")&&S+2<o.length&&($e+=" "+o[S+2].trim())),i.push({name:X,kind:"HTTP Route",classification:"Service Boundary",signature:$e,line:S+1,endLine:S+1,doc:"",capabilities:JSON.stringify({type:"route",method:B,path:X,handler:Se})}),t.push({type:"api_route",name:X,direction:"consume",line:S+1,snippet:$e,method:B,url:X}),m=[];continue}}let Y=/(?:\$client|client|Http)::(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)|(?:\$client|client)->(request|get|post|put|delete|patch)\s*\(\s*([^,)]+)/,re=R.match(Y);if(re){let B=(re[1]||re[3]).toUpperCase(),X=(re[2]||re[4]).trim();(X.startsWith("'")&&X.endsWith("'")||X.startsWith('"')&&X.endsWith('"'))&&(X=X.substring(1,X.length-1)),t.push({type:"api_route",name:X,direction:"produce",line:S+1,snippet:R,method:B,url:X})}!R.startsWith("#[")&&!R.startsWith("//")&&!R.startsWith("*")&&!f&&(d=[],m=[])}return{nodes:i,events:t}}};var Gi=class{currentRoutePrefix="";parse(e){this.currentRoutePrefix="";let r=[],i=[],t=e.split(`
|
|
646
|
+
`),o=[{indent:-1,name:"root",type:"root"}],s=[],a=/^class\s+([a-zA-Z0-9_]+)/,c=/^async\s+def\s+([a-zA-Z0-9_]+)|^def\s+([a-zA-Z0-9_]+)/,l=/^(?:from\s+([a-zA-Z0-9_\.]+)\s+import|import\s+([a-zA-Z0-9_\.]+))/,u=/^@(.*)/;function p(y){return y.trim().split(/[.(]/)[0]?.trim()||y}function d(y){let b=y.decorators.map(x=>p(x.raw)),_={decorators:y.decorators,decoratorNames:b};return y.async===!0&&(_.async=!0),JSON.stringify(_)}let m=!1,f="",h=[],v=[];for(let y=0;y<t.length;y++){let b=t[y],_=b.trim();if(!_||_.startsWith("#"))continue;let x=/^([a-zA-Z0-9_]+)\s*=\s*(?:APIRouter|Blueprint)\s*\(\s*(?:prefix\s*=\s*)?['"]([^'"]+)['"]/,k=_.match(x);if(k&&(this.currentRoutePrefix=k[2]),m){if(_.endsWith(f)||_.includes(f)){m=!1;let M=_.replace(f,"").trim();M&&h.push(M);let V=o[o.length-1];V.node&&(V.node.doc=h.join(`
|
|
647
|
+
`).trim()),h=[]}else h.push(_);continue}let I=b.search(/\S/),N=b.trim(),L=N.match(/^(['"]{3})/);if(L){let M=L[1],V=o[o.length-1];if(V.node&&!V.node.doc){if(N.substring(3).includes(M)){let J=N.replace(new RegExp(M,"g"),"").trim();V.node.doc=J}else{m=!0,f=M;let J=N.substring(3).trim();J&&h.push(J)}continue}}for(;o.length>1&&o[o.length-1].indent>=I;)o.pop();let C=o[o.length-1],S=N.match(u);if(S){s.push({raw:S[1].trim(),line:y+1});continue}let R=N.match(a);if(R){let M=R[1],V={name:M,kind:"ClassDeclaration",classification:"Class",signature:`class ${M}`,line:y+1,endLine:y+1,doc:"",capabilities:d({decorators:s}),members:[]};v.push(V),C.node?(C.node.members||(C.node.members=[]),C.node.members.push(V)):r.push(V),o.push({indent:I,name:M,type:"class",node:V}),s=[];continue}let A=N.match(c);if(A){let M=!!A[1],V=A[1]||A[2],J=C.type==="class",P=!1,E={};for(let X of s)if(X.raw.match(/(?:app|router)\.(get|post|put|delete|patch)/)){P=!0;let Se=["get","post","put","delete","patch"].find(be=>X.raw.toLowerCase().includes(`.${be}`))?.toUpperCase()||"GET",Ie=X.raw.match(/['"]([^'"]+)['"]/),$e=Ie?Ie[1]:"/";if(this.currentRoutePrefix){let be=this.currentRoutePrefix.endsWith("/")?this.currentRoutePrefix.slice(0,-1):this.currentRoutePrefix,ut=$e.startsWith("/")?$e:`/${$e}`;$e=be+ut}E={type:"route",method:Se,path:$e}}if(P){let X=E.path||"",me={name:X||V,kind:"HTTP Route",classification:"Service Boundary",signature:`Function: ${V}`,line:y+1,endLine:y+1,doc:"",capabilities:JSON.stringify({handler:J?`${C.name}.${V}`:V,async:M,...E})};v.push(me),r.push(me),i.push({type:"api_route",name:X,direction:"consume",line:y+1,snippet:N})}let G=s.some(X=>X.raw==="staticmethod"),Y=s.some(X=>X.raw==="classmethod"),re=`${M?"async ":""}${J?(G?"@staticmethod ":Y?"@classmethod ":"")+C.name+".":""}${V}`,B={name:V,kind:M&&J?"AsyncMethodDeclaration":M?"AsyncFunctionDeclaration":J?"MethodDeclaration":"FunctionDeclaration",classification:J?G||Y?"Static Method":"Method":"Function",signature:re,line:y+1,endLine:y+1,doc:"",capabilities:d({decorators:s,async:M}),members:[]};v.push(B),C.node?(C.node.members||(C.node.members=[]),C.node.members.push(B)):r.push(B),o.push({indent:I,name:V,type:"function",node:B}),s=[];continue}let H=/^(?:path|re_path|url)\s*\(\s*['"]([^'"]+)['"]/,W=N.match(H);if(W){let M=W[1].replace(/^\^/,""),V={name:M,kind:"HTTP Route",classification:"Service Boundary",signature:N.trim(),line:y+1,endLine:y+1,doc:"",capabilities:JSON.stringify({type:"route",method:"GET",path:M})};v.push(V),r.push(V),i.push({type:"api_route",name:M,direction:"consume",line:y+1,snippet:N});continue}let O=/(?:requests|httpx|client|http)\.(get|post|put|delete|patch|request)\s*\(\s*(?:url\s*:\s*)?([^,)]+)/,K=N.match(O);if(K){let M=K[1].toUpperCase(),V=K[2].trim();(V.startsWith("'")&&V.endsWith("'")||V.startsWith('"')&&V.endsWith('"'))&&(V=V.substring(1,V.length-1)),i.push({type:"api_route",name:V,direction:"produce",line:y+1,snippet:N,method:M,url:V})}let D=N.match(l);if(D){let M=D[1]||D[2],V={name:M,kind:"ImportSpecifier",classification:"Dependency",signature:`import ${M}`,line:y+1,endLine:y+1,doc:"",capabilities:JSON.stringify({type:"import",module:M})};v.push(V),r.push(V),s=[];continue}s=[],C.node&&(C.node.endLine=y+1)}return{nodes:v,events:i}}};function Rx(n,e){let r=0,i=!1;for(let t=e;t<n.length;t++){let o=n[t];for(let s of o)if(s==="{")r++,i=!0;else if(s==="}"&&(r--,i&&r<=0))return t+1;if(!i&&t>e&&/[;}]$/.test(o.trim()))return t+1}return Math.min(n.length,e+41)}var jf=[{extension:[".php"],rules:[]},{extension:[".py"],rules:[]},{extension:[".go"],rules:[{regex:/func\s+([a-zA-Z0-9_]+)\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function",signature:n[0]})},{regex:/func\s+\([^\)]+\)\s+([a-zA-Z0-9_]+)\(/g,onMatch:n=>({name:n[1],kind:"MethodDeclaration",classification:"Method",signature:n[0]})},{regex:/import\s+['"]([^'"]+)['"]/g,onMatch:n=>({name:n[1],kind:"ImportSpecifier",classification:"Dependency",signature:n[0],meta:{type:"import",path:n[1]}})}]},{extension:[".rs"],rules:[{regex:/fn\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function",signature:n[0]})},{regex:/struct\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"StructDeclaration",classification:"Class",signature:n[0]})},{regex:/enum\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"EnumDeclaration",classification:"Class",signature:n[0]})},{regex:/trait\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"TraitDeclaration",classification:"Class",signature:n[0]})},{regex:/use\s+([a-zA-Z0-9_:]+(?:\s+as\s+[a-zA-Z0-9_]+)?);/g,onMatch:n=>({name:n[1].trim(),kind:"ImportDeclaration",classification:"Dependency",signature:n[0],meta:{type:"import",path:n[1].trim()}})}]},{extension:[".ts",".tsx",".js",".jsx",".mjs",".cjs"],rules:[{regex:/(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z0-9_]+)\s*\(/g,onMatch:n=>({name:n[1],kind:"FunctionDeclaration",classification:"Function"})},{regex:/(?:export\s+)?class\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"ClassDeclaration",classification:"Class"})},{regex:/(?:export\s+)?interface\s+([a-zA-Z0-9_]+)/g,onMatch:n=>({name:n[1],kind:"InterfaceDeclaration",classification:"Interface"})},{regex:/(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=/g,onMatch:n=>({name:n[1],kind:"VariableDeclaration",classification:"Constant"})},{regex:/import\s+.*\s+from\s+['"]([^'"]+)['"]/g,onMatch:n=>({name:n[1],kind:"ImportDeclaration",classification:"Dependency",meta:{path:n[1]}})}]}];function Px(n,e){let r=[];if(n===".go"&&e.some(i=>i.kind==="TypeDeclaration")&&r.push("Go type"),n===".rs"&&(e.some(i=>i.kind==="TraitDeclaration")&&r.push("Rust trait"),e.some(i=>i.kind==="StructDeclaration")&&r.push("Rust struct"),e.some(i=>i.kind==="EnumDeclaration")&&r.push("Rust enum")),n===".py"){for(let i of e)if(i.capabilities)try{if(JSON.parse(i.capabilities).decoratorNames?.length){r.push("Python decorators");break}}catch{}e.some(i=>i.kind==="AsyncFunctionDeclaration"||i.kind==="AsyncMethodDeclaration")&&r.push("Async")}return r}var Ji=class{phpParser=new Bi;pythonParser=new Gi;treeSitterParser=new Wi;supports(e){return jf.some(r=>r.extension.includes(e.toLowerCase()))}async parse(e,r){let i=wc.extname(e).toLowerCase(),t=[],o=[];if(i===".php"||i===".py"||i===".go"||i===".rs"){if(i===".py"){let l=this.pythonParser.parse(r);t=l.nodes,o=l.events}else if(i===".php"){let l=e.toLowerCase().endsWith("api.php"),u=this.phpParser.parse(r,l);t=u.nodes,o=u.events}else try{t=await this.treeSitterParser.parse(e,r)}catch{}if(t.length>0){let l=i===".php"?"Micro IR (PHP/TS) ":i===".py"?"Micro IR (Python/TS) ":i===".go"?"Micro IR (Go/TS) ":"Micro IR (Rust/TS) ",u=t.filter(f=>f.classification!=="Dependency"),p=t.filter(f=>f.classification==="Dependency"),d=Px(i,t),m=Dr({classification:l,capabilities:d,exports:u.map(f=>({name:f.name,kind:f.kind,classification:f.classification})),fileName:wc.basename(e)});return{exports:u,imports:p.map(f=>({module:f.name,name:f.name,kind:f.kind,classification:f.classification})),events:o,classification:l,summary:m||`${i.substring(1).toUpperCase()} module`,parseStatus:"success"}}}let s=jf.find(l=>l.extension.includes(i));if(!s)return{exports:[],imports:[],classification:"Unknown",summary:"",parseStatus:"failed",parseError:`Unsupported file extension: ${i}`};let a=r.split(`
|
|
648
|
+
`);for(let l of s.rules){l.regex.lastIndex=0;let u;for(;(u=l.regex.exec(r))!==null;){let p=l.onMatch(u),d=r.substring(0,u.index).split(`
|
|
649
|
+
`).length,m=Rx(a,d-1);t.push({name:p.name||"anonymous",kind:p.kind||"Unknown",classification:p.classification||"Other",signature:p.signature||u[0],line:d,endLine:m,doc:"",capabilities:JSON.stringify(p.meta||{})})}}let c=Dr({classification:`Micro IR (${i.substring(1).toUpperCase()})`,capabilities:[],exports:t.map(l=>({name:l.name,kind:l.kind,classification:l.classification})),fileName:wc.basename(e)});return{exports:t,imports:[],classification:`Micro IR (${i.substring(1).toUpperCase()})`,summary:c||"Module",parseStatus:t.length>0?"success":"partial"}}};Q();import*as kc from"@swc/core";function Ff(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.parse=="function"&&typeof e.parseSync=="function"}function Nx(){if(Ff(kc))return kc;let n=kc;if(Ff(n.default))return n.default;throw new Error("SWC runtime unavailable: couldn't resolve parse/parseSync from @swc/core exports")}var Uf=Nx();function Lr(n,e,r){return Uf.parse(n,e,r)}function Vi(n,e,r){return Uf.parseSync(n,e,r)}var Ec=new Ji;async function On(n){let e=Hf.extname(n);if(Ec.supports(e)&&e!==".ts"&&e!==".tsx")try{let o=await Zf.promises.readFile(n,"utf-8");return{...await Ec.parse(n,o),content:o}}catch(o){return $.error({filePath:n,error:o.message},"HeuristicParser failed"),{exports:[],imports:[],classification:"Unknown",summary:"",content:"",parseStatus:"failed",parseError:o.message}}let r;try{r=await Zf.promises.readFile(n)}catch(o){return{exports:[],imports:[],classification:"Error",summary:"",content:"",parseStatus:"failed",parseError:`File read error: ${o.message}`}}let i=r.toString("utf8"),t=kf(i);try{let o=n.endsWith(".tsx"),s=n.endsWith(".d.ts")||n.endsWith(".d.tsx"),a,c={syntax:"typescript",tsx:o,decorators:!0,comments:!0};if(s)try{a=Vi(i,c)}catch{a=Vi(i,{...c,isModule:!1})}else a=Vi(i,c);let l=a.span.start,u=Ef(r),p=Tf(i),d=k=>If(k,l,r),m=Pf(a.body),f=Cf(a.body);f.length>0&&$.debug({filePath:n,count:f.length},"Extracted type references"),f.forEach(k=>{m.push({module:"__type_reference__",name:k})});let h=Nf(a.body,l,r,i,t,p,n,d,u),v=zf(a.body,l,r,t,d,u),y=Hi(n,"","Module"),_=p.length>0&&i.slice(0,p[0].start).trim().length===0?p[0].text:h.find(k=>k.doc)?.doc||"",x=Rf(_);if(!x&&h.length>0){let k=Ar(i);x=Dr({classification:y,capabilities:k,exports:h.map(I=>({name:I.name,kind:I.kind,classification:I.classification})),fileName:Hf.basename(n)})}return{exports:h,imports:m,events:v,classification:y,summary:x,content:i,parseStatus:"success"}}catch(o){$.warn({filePath:n,error:o.message},"SWC parsing failed, using heuristic fallback");try{let s=await Ec.parse(n,i);return{...s,content:i,classification:s.classification+" (Degraded)",parseStatus:"partial",parseError:`SWC failed, used heuristic fallback: ${o.message}`}}catch(s){return $.error({filePath:n,error:s.message},"All parsing strategies failed"),{exports:[],imports:[],classification:"Error",summary:"",content:i,parseStatus:"failed",parseError:`All parsing strategies failed: ${s.message}`}}}}function zx(n,e=500){let r=[],i=[],t=0;return n.forEach(o=>{let s=o.doc?.split(/\s+/).length||0;t+s>e&&(r.push(i),i=[],t=0),i.push(o),t+=s}),i.length&&r.push(i),r}import qi from"path";var Cx=50;function Or(n,e,r,i){let t={name:qi.basename(e)||e,type:"directory",path:e,children:[]};return n.forEach(o=>{let a=qi.relative(e,o.path).split(qi.sep),c=t;for(let l=0;l<a.length;l++){let u=a[l];if(i!==void 0&&l>=i)return;let p=l===a.length-1;if(i===1&&l===0&&p)return;let d=i!==void 0&&l===i-1&&!p,m=qi.join(e,...a.slice(0,l+1)),f=c.children?.find(h=>h.name===u);if(!f){if(c.children&&c.children.length>=Cx){c.children.find(y=>y.type==="truncated")||c.children.push({name:"... (truncated) ",type:"truncated",path:"",children:void 0});return}f={name:u,type:p?"file":"directory",path:m,children:p||d?void 0:[],summary:p?{classification:o.classification,summaryText:o.summary,exports:o.exports,imports:o.imports,chunks:o.chunks}:void 0},f.summary&&(r==="structure"||r==="signatures")&&(delete f.summary.chunks,delete f.summary.imports),c.children?.push(f)}c=f}}),t}Q();import Jc from"p-limit";var Ic=class{startTime=Date.now();indexRuns=0;indexCacheHits=0;lastIndexDurationMs=null;lastIndexCompletedAt=null;lastRunPhases=[];queryCount=0;lastQueryLatencyMs=null;recentLatencySumMs=0;recentLatencyCount=0;recentLatencies=[];searchHistoryFailureCount=0;recordIndexStart(){this.indexRuns+=1}recordIndexCacheHit(){this.indexCacheHits+=1}recordIndexEnd(e){this.lastIndexDurationMs=e,this.lastIndexCompletedAt=Date.now()}recordIndexPhase(e,r){this.lastRunPhases.push({phase:e,durationMs:r})}clearIndexPhases(){this.lastRunPhases=[]}recordQueryStart(){let e=performance.now();return()=>{this.queryCount+=1;let r=performance.now()-e;if(this.lastQueryLatencyMs=r,this.recentLatencies.push(r),this.recentLatencies.length>100){let i=this.recentLatencies.shift();this.recentLatencySumMs=this.recentLatencySumMs-i+r}else this.recentLatencySumMs+=r,this.recentLatencyCount=this.recentLatencies.length}}recordSearchHistoryFailure(){this.searchHistoryFailureCount+=1}getSnapshot(){let e=this.recentLatencies.length,r=e>0?this.recentLatencies.reduce((i,t)=>i+t,0)/e:null;return{index:{runs:this.indexRuns,cacheHits:this.indexCacheHits,lastDurationMs:this.lastIndexDurationMs,lastCompletedAt:this.lastIndexCompletedAt,lastRunPhases:[...this.lastRunPhases]},query:{count:this.queryCount,lastLatencyMs:this.lastQueryLatencyMs,recentLatencySumMs:this.recentLatencySumMs,recentLatencyCount:e,avgLatencyMs:r,searchHistoryFailures:this.searchHistoryFailureCount},uptimeMs:Date.now()-this.startTime}}reset(){this.indexRuns=0,this.indexCacheHits=0,this.lastIndexDurationMs=null,this.lastIndexCompletedAt=null,this.lastRunPhases=[],this.queryCount=0,this.lastQueryLatencyMs=null,this.recentLatencySumMs=0,this.recentLatencyCount=0,this.recentLatencies=[],this.searchHistoryFailureCount=0}},It=new Ic;function Ax(){return It}function Wf(){It.recordIndexStart()}function Ki(){It.recordIndexCacheHit()}function Bf(n){It.recordIndexEnd(n)}function Mr(n,e){It.recordIndexPhase(n,e)}function Gf(){It.clearIndexPhases()}function dn(){return It.recordQueryStart()}function mt(){It.recordSearchHistoryFailure()}function Tc(){return It.getSnapshot()}ft();import Vc from"path";import KS from"fs";import YS from"os";import ot from"path";import Fn from"fs";import{loadConfig as eS,createMatchPath as tS}from"tsconfig-paths";import Ft from"path";import Fr from"fs";var Ut=class extends Error{constructor(r,i,t){super(i);this.code=r;this.cause=t;this.name="FileSystemError"}};function Qf(n){let e;try{e=Fr.statSync(n).isDirectory()?n:Ft.dirname(n)}catch(r){throw r.code==="ENOENT"?new Ut("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Ut("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Ut("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Ft.dirname(e);){let r=Ft.join(e,"tsconfig.json");if(Fr.existsSync(r))return e;e=Ft.dirname(e)}return null}function eh(n){let e;try{e=Fr.statSync(n).isDirectory()?n:Ft.dirname(n)}catch(r){throw r.code==="ENOENT"?new Ut("FILE_NOT_FOUND",`Start path does not exist: ${n}`,r):r.code==="EACCES"||r.code==="EPERM"?new Ut("PERMISSION_DENIED",`Permission denied accessing: ${n}`,r):new Ut("UNKNOWN",`Failed to access path: ${n}`,r)}for(;e!==Ft.dirname(e);){let r=Ft.join(e,"package.json");if(Fr.existsSync(r))try{if(JSON.parse(Fr.readFileSync(r,"utf8")).workspaces)return e}catch{}e=Ft.dirname(e)}return null}import Mn from"path";import hn from"fs";function th(n,e){let r=new Map,i=e.workspaces||[];for(let t of i){let o=t.replace("/*",""),s=Mn.join(n,o);if(!hn.existsSync(s))continue;let a=hn.readdirSync(s);for(let c of a){let l=Mn.join(s,c,"package.json");if(hn.existsSync(l))try{let u=JSON.parse(hn.readFileSync(l,"utf8"));u.name&&r.set(u.name,{name:u.name,path:Mn.dirname(l),main:u.main||"dist/index.js"})}catch{}}}return r}function nh(n){let e=new Map;try{let r=JSON.parse(hn.readFileSync(n,"utf8")),i={...r.dependencies,...r.devDependencies};for(let[t,o]of Object.entries(i))if(typeof o=="string"&&o.startsWith("file:")){let s=o.substring(5),a=Mn.dirname(n),c=Mn.resolve(a,s),l=Mn.join(c,"package.json");if(hn.existsSync(l))try{let u=JSON.parse(hn.readFileSync(l,"utf8"));e.set(t,{name:t,path:c,main:u.main||"dist/index.js"})}catch{}}}catch{}return e}import rh from"path";import it from"fs";var Gx=[".ts",".tsx",".d.ts",".js",".jsx"];function Le(n){let e=rh.extname(n);if(e===".js"||e===".jsx"){let r=n.slice(0,-e.length),i=e===".jsx"?[".tsx",".ts"]:[".ts",".tsx"];for(let t of i){let o=r+t;if(it.existsSync(o)&&it.statSync(o).isFile())return o}if(it.existsSync(n)&&it.statSync(n).isFile())return n}if(it.existsSync(n)&&it.statSync(n).isFile())return n;for(let r of Gx){let i=n+r;if(it.existsSync(i)&&it.statSync(i).isFile())return i}if(it.existsSync(n)&&it.statSync(n).isDirectory())for(let r of[".ts",".tsx",".js",".jsx"]){let i=rh.join(n,"index"+r);if(it.existsSync(i))return i}return""}import Zt from"path";import Jx from"fs";import{builtinModules as Vx,createRequire as qx}from"node:module";var ih=new Set(Vx.map(n=>n.replace(/^node:/,"")));function Kx(n){let e=n.replace(/^node:/,""),r=e.split("/")[0]||e;return ih.has(e)||ih.has(r)}function Yx(n){return/^@[^/]+\/[^/]+/.test(n)}function oh(n){return!!(n.startsWith("#")||n.startsWith("@/")||n.startsWith("~/")||n.startsWith("@")&&!Yx(n))}function Xx(n,e){try{return qx(e).resolve(n)}catch{return null}}function Qx(n,e,r){if(!e||e.size===0)return null;for(let[i,t]of e.entries()){if(i.includes("*")){let o="^"+i.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",s=new RegExp(o),a=n.match(s);if(!a)continue;let c=a[1],l=t.replace("*",c),u=Zt.resolve(r,l);return Le(u)}if(i===n){let o=Zt.resolve(r,t);return Le(o)}}return null}function no(n,e,r){if(n.startsWith(".")){let t=Zt.dirname(e),o=Zt.resolve(t,n),s=Le(o);return s?{resolved:!0,kind:"relative",resolvedPath:s,actionable:!1}:{resolved:!1,kind:"relative",error:`File not found at relative path: ${o}`,suggestion:"Check if the file exists and has a supported extension (.ts, .tsx, .js, .jsx)",actionable:!0}}if(Kx(n))return{resolved:!0,kind:"builtin",resolvedPath:n,actionable:!1};let i=jn(e);if(i){if(i.matchPath){let o=i.matchPath(n);if(o){let s=Le(o);return s?{resolved:!0,kind:"alias",resolvedPath:s,actionable:!1}:{resolved:!1,kind:"alias",error:`Path alias matched to '${o}' but file does not exist`,suggestion:"Check if the target file exists or if the alias mapping in tsconfig.json is correct",actionable:!0}}}if(!n.startsWith("@")&&!n.startsWith("#")){let o=Zt.resolve(i.baseUrl,n),s=Le(o);if(s)return{resolved:!0,kind:"workspace-package",resolvedPath:s,actionable:!1}}if(n.startsWith("#")){let o=Qx(n,i.imports,i.baseUrl);if(o)return{resolved:!0,kind:"alias",resolvedPath:o,actionable:!1}}let t=i.workspacePackages.get(n);if(t){let o=Zt.join(t.path,"src/index.ts");if(Jx.existsSync(o))return{resolved:!0,kind:"workspace-package",resolvedPath:o,actionable:!1};let s=Zt.join(t.path,t.main),a=Le(s);return a?{resolved:!0,kind:"workspace-package",resolvedPath:a,actionable:!1}:{resolved:!1,kind:"workspace-package",error:`Workspace package '${n}' found at ${t.path} but entry point not found`,suggestion:`Check main field in ${Zt.join(t.path,"package.json")}`,actionable:!0}}}else if(oh(n))return{resolved:!1,kind:"alias",error:"No tsconfig.json found for alias-style import",suggestion:'Ensure tsconfig.json exists and defines the expected "paths" aliases',actionable:!0};if(!n.startsWith("/")&&!n.startsWith(".")){let t=Xx(n,e);if(t)return{resolved:!0,kind:"external-package",resolvedPath:t,actionable:!1}}return n.startsWith("#")?{resolved:!1,kind:"alias",error:`Package import alias '${n}' not found in package.json "imports"`,suggestion:'Check package.json "imports" configuration for this alias',actionable:!0}:oh(n)?{resolved:!1,kind:"alias",error:`Path alias '${n}' not found in tsconfig.json paths`,suggestion:'Check tsconfig.json "paths" configuration',actionable:!0}:{resolved:!1,kind:"missing",error:`Module '${n}' could not be resolved`,suggestion:"Install dependency or check import path",actionable:!0}}var ro=new Map;function jn(n){let e=Qf(n);if(!e)return null;if(ro.has(e))return ro.get(e)||null;let r=eS(e);if(r.resultType==="failed")return ro.set(e,null),null;let i=r,t=i.absoluteBaseUrl;!t&&i.paths&&Object.keys(i.paths).length>0&&(t=i.configFileAbsolutePath?ot.dirname(i.configFileAbsolutePath):e);let o=tS(t,i.paths,i.mainFields,i.addMatchAll),s=eh(e),a=new Map;if(s){let p=ot.join(s,"package.json");if(Fn.existsSync(p))try{let d=JSON.parse(Fn.readFileSync(p,"utf8"));a=th(s,d)}catch{}}let c=ot.join(e,"package.json");Fn.existsSync(c)&&nh(c).forEach((d,m)=>a.set(m,d));let l={baseUrl:t||"",paths:i.paths,matchPath:o,workspacePackages:a,imports:new Map},u=ot.join(e,"package.json");if(Fn.existsSync(u))try{let p=JSON.parse(Fn.readFileSync(u,"utf8"));if(p.imports){for(let[d,m]of Object.entries(p.imports))if(typeof m=="string"||typeof m=="object"&&m!==null){let f=m;Array.isArray(m)&&(f=m[0]),typeof f=="object"&&(f=f.default||f.node),typeof f=="string"&&l.imports.set(d,f)}}}catch{}return ro.set(e,l),l}function Ht(n,e,r){if(!n)return"";if(n.includes(".")&&!n.startsWith(".")&&!n.startsWith("/")&&!n.endsWith(".js")&&!n.endsWith(".ts")&&!n.endsWith(".json")){let t=n.split(".")[0];if(t&&t!==n){let o=Ht(t,e,r);if(o)return o}}if(n.startsWith(".")){let t=ot.dirname(e),o=ot.resolve(t,n);return Le(o)}let i=jn(e);if(i){let t=i.matchPath(n);if(t)return Le(t);if(!n.startsWith("@")||n.startsWith("@/")){let s=ot.resolve(i.baseUrl,n),a=Le(s);if(a)return a}for(let[s,a]of i.imports.entries())if(s.includes("*")){let c="^"+s.replace(/[\\^$+.()|[\]{}]/g,"\\$&").replace(/\*/g,"(.*)")+"$",l=new RegExp(c),u=n.match(l);if(u){let p=u[1],d=a.replace("*",p),m=ot.resolve(i.baseUrl,d);return Le(m)}}else if(s===n){let c=ot.resolve(i.baseUrl,a);return Le(c)}let o=i.workspacePackages.get(n);if(o){let s=ot.join(o.path,"src/index.ts");if(Fn.existsSync(s))return s;let a=ot.join(o.path,o.main),c=Le(a);if(c)return c}}return""}import nS from"fs";import rS from"path";import ah from"js-yaml";function sh(n){let e=rS.basename(n),r=nS.readFileSync(n,"utf8"),i=[];if(e.endsWith(".prisma"))return{...aS(r,n),content:r};if(e.endsWith(".graphql")||e.endsWith(".gql"))return{...cS(r,n),content:r};let t="Configuration";return e==="lerna.json"?{...uS(r,n),content:r}:e==="turbo.json"?{...pS(r,n),content:r}:e==="pnpm-workspace.yaml"?{...dS(r,n),content:r}:(e.includes("Dockerfile")?(t="Infrastructure (Docker) ",iS(r,i)):e.endsWith(".yaml")||e.endsWith(".yml")?(t="Infrastructure (YAML) ",oS(r,i)):e.startsWith(".env")?(t="Configuration (Env) ",sS(r,i)):e==="package.json"&&(t="Project Manifest",lS(r,i)),{configs:i,classification:t,content:r})}function iS(n,e){let r=n.split(`
|
|
650
|
+
`);for(let i of r){let t=i.trim();if(t.startsWith("FROM "))e.push({key:"base_image",value:t.substring(5).trim(),kind:"Image"});else if(t.startsWith("EXPOSE "))e.push({key:"port",value:t.substring(7).trim(),kind:"Port"});else if(t.startsWith("ENV ")){let o=t.substring(4).trim().split(/\s+|=/);if(o[0]){let s=o[0],a=o.slice(1).join("= ").trim()||"undefined",c="Env";(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function oS(n,e){try{let r=ah.load(n);if(!r||typeof r!="object")return;if(r.services&&typeof r.services=="object")for(let[t,o]of Object.entries(r.services)){if(!o||typeof o!="object")continue;let s=o;if(e.push({key:`service:${t}`,value:t,kind:"Service"}),s.image&&e.push({key:`service:${t}:image`,value:String(s.image),kind:"Image"}),Array.isArray(s.ports)&&s.ports.forEach(a=>{e.push({key:`service:${t}:port`,value:String(a),kind:"Port"})}),s.environment){if(Array.isArray(s.environment))s.environment.forEach(a=>{let[c,...l]=a.split("= ");c&&l.length>0&&e.push({key:`service:${t}:env:${c}`,value:l.join("= "),kind:"Env"})});else if(typeof s.environment=="object")for(let[a,c]of Object.entries(s.environment))e.push({key:`service:${t}:env:${a}`,value:String(c),kind:"Env"})}if(Array.isArray(s.depends_on))s.depends_on.forEach(a=>{e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})});else if(s.depends_on&&typeof s.depends_on=="object")for(let a of Object.keys(s.depends_on))e.push({key:`service:${t}:depends_on`,value:a,kind:"Dependency"})}let i=(t,o="")=>{if(!(!t||typeof t!="object"||Array.isArray(t)))for(let[s,a]of Object.entries(t)){let c=o?`${o}.${s}`:s;if(r.services&&(c.startsWith("services.")||c==="services")){a&&typeof a=="object"&&!Array.isArray(a)&&i(a,c);continue}if(a&&typeof a=="object"&&!Array.isArray(a))i(a,c);else if(a!=null){let l=String(a);if(l==="[object Object]"||l.includes("[object Object]"))continue;let u="Env",p=/^[a-z0-9_-]+$/i.test(l),d=l.includes("://");s.toLowerCase().includes("service")&&(p||d)&&(u="Service"),s.toLowerCase().includes("image")&&(u="Image"),s.toLowerCase().includes("port")&&(u="Port"),(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&d&&(u="Service"),e.push({key:c,value:l.length>200?l.substring(0,197)+"...":l,kind:u})}}};i(r)}catch{let i=n.match(/^\s{2}([a-z0-9_-]+):/gm);i&&i.forEach(t=>{let o=t.trim().replace(" : ","");o!=="services"&&o!=="version"&&o!=="volumes"&&o!=="networks"&&e.push({key:"service",value:o,kind:"Service"})})}}function sS(n,e){let r=n.split(`
|
|
651
|
+
`);for(let i of r){let t=i.trim();if(t&&!t.startsWith("#")){let o=t.split("=");if(o[0]){let s=o[0].trim(),a=o.slice(1).join("=");a=a.trim().replace(/^['"](.*)['"]$/,"$1");let c="Env",l=a.includes("://");(s.endsWith("_URI")||s.endsWith("_URL")||s.endsWith("_HOST"))&&l&&(c="Service"),e.push({key:s,value:a,kind:c})}}}}function aS(n,e){let r=[],i="Contract (Prisma) ",t=/^model\s+(\w+)/gm,o;for(;(o=t.exec(n))!==null;)r.push({key:"model",value:o[1],kind:"Database Model"});let s=/^enum\s+(\w+)/gm;for(;(o=s.exec(n))!==null;)r.push({key:"enum",value:o[1],kind:"Database Enum"});let a=/provider\s*=\s*"([^"]+)"/,c=n.match(a);return c&&r.push({key:"datasource_provider",value:c[1],kind:"Database Config"}),{classification:i,configs:r,content:n}}function cS(n,e){let r=[],i="Contract (GraphQL) ",t=/^(?:type|input|interface|enum)\s+(\w+)/gm,o;for(;(o=t.exec(n))!==null;){let s=o[0],a="GraphQL Type";s.startsWith("input")&&(a="GraphQL Input"),s.startsWith("interface")&&(a="GraphQL Interface"),s.startsWith("enum")&&(a="GraphQL Enum"),r.push({key:"type_definition",value:o[1],kind:a})}return{classification:i,configs:r,content:n}}function lS(n,e){try{let r=JSON.parse(n);if(r.name&&e.push({key:"name",value:r.name,kind:"Service"}),r.description&&e.push({key:"description",value:r.description,kind:"Env"}),r.workspaces){let o=Array.isArray(r.workspaces)?r.workspaces.join("",""):JSON.stringify(r.workspaces);e.push({key:"workspaces",value:o,kind:"Env"})}if(r.scripts){let o=["start","dev","build","test","docker"];for(let s of Object.keys(r.scripts))o.some(a=>s.includes(a))&&e.push({key:`script:${s}`,value:r.scripts[s],kind:"Env"})}let i={...r.dependencies,...r.devDependencies},t=["react","vue","svelte","angular","next","nuxt","express","fastify","nestjs","remix","vite","webpack","tailwindcss","database"];for(let o of Object.keys(i))if(t.some(s=>o.includes(s))){let s=i[o].replace(/[\^~]/,"");e.push({key:`dep:${o}`,value:s,kind:"Dependency"})}}catch{}}function uS(n,e){let r=[],i="Monorepo (Lerna) ";try{let t=JSON.parse(n);r.push({key:"monorepo_type",value:"lerna",kind:"Monorepo"}),t.version&&r.push({key:"lerna_version",value:t.version,kind:"Monorepo"}),t.packages&&(Array.isArray(t.packages)?t.packages:[t.packages]).forEach(s=>{r.push({key:"package_glob",value:s,kind:"Monorepo"})}),t.npmClient&&r.push({key:"npm_client",value:t.npmClient,kind:"Monorepo"})}catch{}return{configs:r,classification:i,content:n}}function pS(n,e){let r=[],i="Monorepo (Turborepo) ";try{let t=JSON.parse(n);if(r.push({key:"monorepo_type",value:"turborepo",kind:"Monorepo"}),t.pipeline)for(let o of Object.keys(t.pipeline)){r.push({key:`pipeline:${o}`,value:o,kind:"Monorepo"});let s=t.pipeline[o];s.dependsOn&&r.push({key:`pipeline:${o}:depends_on`,value:s.dependsOn.join("",""),kind:"Dependency"})}if(t.tasks)for(let o of Object.keys(t.tasks))r.push({key:`task:${o}`,value:o,kind:"Monorepo"})}catch{}return{configs:r,classification:i,content:n}}function dS(n,e){let r=[],i="Monorepo (pnpm) ";try{let t=ah.load(n);r.push({key:"monorepo_type",value:"pnpm",kind:"Monorepo"}),t&&t.packages&&(Array.isArray(t.packages)?t.packages:[t.packages]).forEach(s=>{r.push({key:"package_glob",value:s,kind:"Monorepo"})})}catch{}return{configs:r,classification:i,content:n}}Q();import ch from"fs";import mS from"path";import lh from"js-yaml";var uh={ignore:[],include:[],maxDepth:10},fS=[{name:".liquid-shadow.yaml",parse:n=>lh.load(n)??{}},{name:".liquid-shadow.yml",parse:n=>lh.load(n)??{}},{name:".ls.json",parse:n=>JSON.parse(n)},{name:".liquid-shadow.json",parse:n=>JSON.parse(n)},{name:".ls.rc",parse:n=>JSON.parse(n)},{name:".liquid-shadow.rc",parse:n=>JSON.parse(n)}];function io(n){for(let{name:e,parse:r}of fS){let i=mS.join(n,e);if(ch.existsSync(i))try{let t=ch.readFileSync(i,"utf8"),o=r(t);return $.debug({repoPath:n,configFile:e},"Loaded repository configuration"),{...uh,...o}}catch(t){$.error({repoPath:n,file:e,err:t},"Failed to parse configuration file")}}return uh}ee();Oe();import{execSync as Rt}from"child_process";import Jr from"path";import Lc from"fs";function ge(n){try{if(!Lc.existsSync(Jr.join(n,".git")))return null;let e=Rt("git rev-parse --abbrev-ref HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return e==="HEAD"?Rt("git rev-parse --short HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():e.replace(/[\/\\:*"<>|?]/g,"-")}catch{return null}}function Me(n){try{return Lc.existsSync(Jr.join(n,".git"))?Rt("git rev-parse HEAD",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim():null}catch{return null}}function Vr(n,e=50){try{let r=Rt(`git rev-list --max-count=${e} HEAD`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return r?r.split(`
|
|
652
|
+
`):[]}catch{return[]}}function Oc(n,e,r){try{return Rt(`git merge-tree --write-tree ${e} ${r}`,{cwd:n,stdio:["ignore","ignore","ignore"]}),!1}catch{return!0}}var Ah=new Set([".ts",".tsx",".yaml",".yml",".php",".py",".go",".prisma",".graphql",".gql"]),Dh=new Set(["package.json","lerna.json","turbo.json","pnpm-workspace.yaml"]),Lh=new Set(["node_modules",".git","dist","build","vendor",".next",".cache","coverage"]);function Ch(n){let e=n.split("/");for(let t of e)if(Lh.has(t))return!1;if(n.endsWith(".min.js"))return!1;let r=Jr.basename(n);if(r.startsWith("Dockerfile")||r.startsWith(".env")||Dh.has(r))return!0;let i=Jr.extname(r).toLowerCase();return Ah.has(i)}function RS(n){let e=n.trim(),r=e.indexOf(" -> ");if(r!==-1)return e.substring(r+4);let i=e.split(/\s+/);return i.length>=2?i[i.length-1]:e}function Mc(n,e){try{if(!Lc.existsSync(Jr.join(n,".git")))return!0;let r=Me(n);if(!r)return!0;if(e&&e!==r){let t=Rt(`git diff --name-only ${e} ${r}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(t&&t.split(`
|
|
653
|
+
`).some(o=>o&&Ch(o)))return!0}let i=Rt("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();return i?i.split(`
|
|
654
|
+
`).some(t=>t?Ch(RS(t)):!1):!1}catch{return!0}}function jc(n,e){let r=new Set;try{let i=Rt(`git diff --name-only ${e}`,{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();i&&i.split(`
|
|
655
|
+
`).filter(Boolean).forEach(o=>r.add(o));let t=Rt("git status --porcelain",{cwd:n,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();t&&t.split(`
|
|
656
|
+
`).filter(Boolean).forEach(o=>{let s=o.trim().split(/\s+/);s.length>=2&&r.add(s[s.length-1])})}catch{}return r}ee();Q();import{execSync as Oh}from"child_process";var yn=$.child({module:"nano-repair"}),ze=class{intentLogs;exports;missions;repoPath;constructor(e){let{intentLogs:r,exports:i,missions:t}=z.getInstance(e);this.intentLogs=r,this.exports=i,this.missions=t,this.repoPath=e}detectAndRepairShifts(){let e=this.intentLogs.findRepairableOrphans();if(e.length===0)return{repaired:0,failed:0};yn.info({count:e.length},"Detected orphaned intent logs. Attempting recovery...");let r=0,i=0;for(let t of e){let o=this.exports.findByNameAndFile(t.symbol_name,t.file_path);if(o.length>0){let a=o.find(c=>c.signature===t.signature)||o[0];this.intentLogs.update(t.id,{symbol_id:a.id}),yn.info({logId:t.id,symbol:t.symbol_name},"Relinked symbol in same file"),r++;continue}let s=this.exports.findByNameGlobal(t.symbol_name);if(s.length>0){let a=s.filter(c=>c.file_path!==t.file_path);if(a.length>0){let c=a.find(l=>l.signature===t.signature)||a[0];this.intentLogs.update(t.id,{symbol_id:c.id,file_path:c.file_path}),yn.info({logId:t.id,symbol:t.symbol_name,oldPath:t.file_path,newPath:c.file_path},"Detected Nano-Repair Shift (file move)"),r++;continue}}i++}return r>0&&yn.info({repaired:r,failed:i},"Nano-Repair recovery complete"),{repaired:r,failed:i}}syncLifecycle(e={}){let r=e.enableContextPivot===!0,i=e.enableMergeSentinel===!0,t="HEAD";try{t=Oh("git rev-parse --abbrev-ref HEAD",{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return{suspended:0,resumed:0,completed:0,contextPivotEnabled:r,mergeSentinelEnabled:i}}if(!t)return{suspended:0,resumed:0,completed:0,contextPivotEnabled:r,mergeSentinelEnabled:i};let o=0,s=0;if(r){let c=this.missions.findActive();for(let l of c)l.git_branch&&l.git_branch!==t&&(this.missions.updateStatus(l.id,"suspended"),yn.info({missionId:l.id,branch:l.git_branch,current:t},"Context Pivot: Suspended mission"),o++);s=this.missions.resumeByBranch(t)}let a=0;if(i){let c=[];try{c=Oh(`git branch --merged "${t}"`,{cwd:this.repoPath,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
|
|
657
|
+
`).map(u=>u.trim().replace(/^\* /,"")).filter(u=>u&&u!==t)}catch{}if(c.length>0){let l=this.missions.findMergedMissions(t,c);for(let u of l)this.missions.updateStatus(u.id,"completed"),yn.info({missionId:u.id,branch:u.git_branch},"Merge Sentinel: Auto-completed mission"),a++}}return(o>0||s>0||a>0)&&yn.info({suspended:o,resumed:s,completed:a},"Git-Native Lifecycle Sync complete"),{suspended:o,resumed:s,completed:a,contextPivotEnabled:r,mergeSentinelEnabled:i}}};Q();Ln();import{Worker as PS}from"node:worker_threads";import{cpus as NS}from"node:os";import{fileURLToPath as zS}from"node:url";import{dirname as CS,join as AS}from"node:path";import{existsSync as DS}from"node:fs";var Mh=zS(import.meta.url),LS=CS(Mh),OS=Mh.endsWith(".ts");function MS(){if(OS)return null;let n=AS(LS,"worker.js");return DS(n)?n:nt("dist/logic/parser/worker.js")}var Fc=class{workers=[];taskQueue=[];pendingTasks=new Map;taskIdCounter=0;initialized=!1;initPromise;shutdownRequested=!1;numWorkers;initTimeout;constructor(e={}){this.numWorkers=e.numWorkers??Math.max(1,Math.min(4,NS().length-1)),this.initTimeout=e.initTimeout??3e4}async initialize(){if(!this.initialized)return this.initPromise?this.initPromise:(this.initPromise=this._doInitialize(),this.initPromise)}async _doInitialize(){let e;try{$.info({numWorkers:this.numWorkers},"Initializing parser worker pool");let r=new Promise((i,t)=>{e=setTimeout(()=>t(new Error(`Parser pool initialization timed out after ${this.initTimeout}ms`)),this.initTimeout)});if(await Promise.race([this._initializeWorkers(),r]),e&&clearTimeout(e),this.shutdownRequested){this.initialized=!1,this.initPromise=void 0;return}this.initialized=!0,$.info({numWorkers:this.workers.length},"Parser worker pool ready")}catch(r){throw e&&clearTimeout(e),this.initPromise=void 0,this.initialized=!1,await this.shutdown(),r}}async _initializeWorkers(){let e=MS();if(!e)throw new Error("Parser worker pool not available in development mode (tsx). Use main-thread fallback.");$.debug({workerPath:e},"Resolved parser worker path");let r=[];for(let i=0;i<this.numWorkers;i++)r.push(this.createWorker(e,i));await Promise.all(r)}async createWorker(e,r){return new Promise((i,t)=>{let o=setTimeout(()=>{t(new Error(`Parser worker ${r} initialization timed out`))},this.initTimeout),s=new PS(e,{execArgv:process.execArgv}),a={worker:s,busy:!1,currentTaskId:null};s.on("message",c=>{if(c.type==="ready"){if(clearTimeout(o),this.shutdownRequested){s.terminate().catch(()=>{}),i();return}this.workers.push(a),$.debug({workerIndex:r},"Parser worker ready"),i()}else c.type==="result"&&c.id?this.handleTaskComplete(a,c.id,c.result):c.type==="error"&&c.id&&this.handleTaskError(a,c.id,new Error(c.error||"Unknown error"))}),s.on("error",c=>{if(clearTimeout(o),$.error({err:c,workerIndex:r},"Parser worker error"),a.currentTaskId&&this.handleTaskError(a,a.currentTaskId,c),!this.initialized){t(c);return}let l=this.workers.indexOf(a);l!==-1&&this.workers.splice(l,1),!this.shutdownRequested&&this.initialized&&this.createWorker(e,r).catch(u=>{$.error({err:u},"Failed to replace crashed parser worker")})}),s.on("exit",c=>{c!==0&&!this.shutdownRequested&&$.warn({workerIndex:r,code:c},"Parser worker exited unexpectedly")})})}handleTaskComplete(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.resolve(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}handleTaskError(e,r,i){let t=this.pendingTasks.get(r);t&&(this.pendingTasks.delete(r),t.reject(i)),e.busy=!1,e.currentTaskId=null,this.processQueue()}processQueue(){if(this.taskQueue.length===0)return;let e=this.workers.find(i=>!i.busy);if(!e)return;let r=this.taskQueue.shift();r&&(e.busy=!0,e.currentTaskId=r.id,this.pendingTasks.set(r.id,r),e.worker.postMessage({type:"parse",id:r.id,filePath:r.filePath}))}async parseFile(e){return this.initialized||await this.initialize(),new Promise((r,i)=>{let o={id:`parse_${++this.taskIdCounter}`,filePath:e,resolve:r,reject:i};this.taskQueue.push(o),this.processQueue()})}get workerCount(){return this.workers.length}get busyWorkers(){return this.workers.filter(e=>e.busy).length}get queueSize(){return this.taskQueue.length}get isInitialized(){return this.initialized}async shutdown(){if(this.shutdownRequested=!0,this.initPromise)try{await this.initPromise}catch{}if(!this.initialized&&this.workers.length===0){this.shutdownRequested=!1,this.initPromise=void 0;return}$.info({numWorkers:this.workers.length},"Shutting down parser worker pool");let e=this.workers.map(r=>new Promise(i=>{r.worker.postMessage({type:"shutdown"}),r.worker.once("exit",()=>i()),setTimeout(()=>{r.worker.terminate().then(()=>i())},5e3)}));await Promise.all(e),this.workers=[],this.taskQueue=[],this.pendingTasks.clear(),this.initialized=!1,this.shutdownRequested=!1,this.initPromise=void 0,$.info("Parser worker pool shutdown complete")}},Hn=null;function jh(n){return Hn||(Hn=new Fc(n)),Hn}async function Fh(){Hn&&(await Hn.shutdown(),Hn=null)}ee();Q();yt();Uc();Zc();Hc();import{execSync as cg}from"child_process";var Eo=$.child({module:"heritage-analyzer"}),bn=class{repos;repoPath;constructor(e){this.repos=z.getInstance(e),this.repoPath=e}analyzeHeritage(e=20){try{Eo.info({limit:e},"Analyzing repository heritage...");let r=cg(`git log -n ${e} --pretty=format:"%H|%at|%an|%s"`,{cwd:this.repoPath,encoding:"utf-8"});if(!r)return;let i=r.split(`
|
|
658
|
+
`).filter(Boolean);for(let t of i){let[o,s,a,c]=t.split("|"),l=this.analyzeCommitImpact(o);if(l.significant){let u=Array.from(l.layers).join(", "),p=`Heritage: ${c} (by ${a}). Touched ${l.fileCount} files across [${u}].`;this.repos.intentLogs.importHeritage(p,o,parseInt(s,10),.7),Eo.debug({sha:o,subject:c},"Logged heritage move")}}Eo.info("Heritage analysis complete.")}catch(r){Eo.warn({err:r.message},"Failed to run heritage analysis")}}analyzeCommitImpact(e){let r=new Set,i=0;try{let o=cg(`git diff-tree --no-commit-id --name-only -r ${e}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
|
|
659
|
+
`).filter(Boolean);i=o.length;for(let c of o){let l=this.classifyPathOnly(c);l!=="Unknown"&&r.add(l)}let s=r.has("Entry")||r.has("Data")||r.has("Infrastructure"),a=r.size>=2||i>5;return{significant:s||a,layers:r,fileCount:i}}catch{return{significant:!1,layers:r,fileCount:0}}}classifyPathOnly(e){let r=e.startsWith("/")?e:"/"+e;return Wc.some(i=>i.test(r))?"Test":vo.some(i=>i.test(r))||bo.some(i=>i.test(r))?"Entry":qr.some(i=>i.test(r))?"Data":xo.some(i=>i.test(r))?"Utility":So.some(i=>i.test(r))?"Entry":$o.some(i=>i.test(r))?"Data":wo.some(i=>i.test(r))?"Entry":ko.some(i=>i.test(r))?"Data":Bc.some(i=>i.test(r))?"Infrastructure":/\.(service|logic|usecase|interactor|manager)\.(ts|js|php|py)$/i.test(r)||_o.some(i=>i.test(r))?"Logic":"Unknown"}};ft();Ln();import{spawn as ZS}from"node:child_process";import Gc from"node:os";import{resolve as HS}from"node:path";import{existsSync as lg}from"node:fs";import{fileURLToPath as WS}from"node:url";import{dirname as BS}from"node:path";var ug=WS(import.meta.url),GS=BS(ug),JS=Gc.constants.priority.PRIORITY_LOWEST??Gc.constants.priority.PRIORITY_LOW;function VS(){if(ug.endsWith(".ts"))return null;let n=HS(GS,"../../entry/ember/index.js");if(lg(n))return n;let e=nt("dist/entry/ember/index.js");return lg(e)?e:null}function pg(n){try{let r=ke(n).prepare("SELECT key, value FROM ember_state WHERE key IN ('status','progress','pid')").all(),i=new Map(r.map(t=>[t.key,t.value??""]));return{status:i.get("status")??"idle",progress:i.get("progress")??"0/0",pid:i.get("pid")??null}}catch{return{status:"idle",progress:"0/0",pid:null}}}function qS(n,e){let r=ke(n);r.transaction(()=>{let i=r.prepare("INSERT OR REPLACE INTO ember_state (key, value, updated_at) VALUES (?, ?, unixepoch())");i.run("pid",String(e)),i.run("status","running"),i.run("repo_path",n)})()}function dg(n){let{pid:e}=pg(n);if(!e)return!1;let r=parseInt(e,10);if(!Number.isFinite(r)||r<=0)return!1;try{return process.kill(r,0),!0}catch{return!1}}function mg(n){let e=VS();if(!e)return;let r=ZS(process.execPath,[e,n],{detached:!0,stdio:"ignore",env:{...process.env,EMBER_MODE:"1"}});if(r.pid!=null){try{Gc.setPriority(r.pid,JS)}catch{}r.unref(),qS(n,r.pid)}}function Wn(n){let{status:e,progress:r}=pg(n);return{status:e,progress:r}}var XS=YS.cpus().length||4,QS=Ui.DEFAULT_CONCURRENCY;function gg(n,e=[]){if(!Array.isArray(n))return e;for(let r of n)!r||typeof r!="object"||(e.push(r),Array.isArray(r.members)&&r.members.length>0&&gg(r.members,e));return e}function fg(n){if(typeof n!="number"||!Number.isFinite(n))return null;let e=Math.trunc(n);return e>0?e:null}function yg(n){let e=typeof n?.content=="string"&&n.content.length>0?n.content.split(`
|
|
660
|
+
`).length:0,r=gg(n?.exports),i=0,t=0,o=0,s=0;for(let a of r){let c=fg(a?.line??a?.start_line),l=fg(a?.endLine??a?.end_line??c);if(!c||!l||l<c||e>0&&l>e){t++;continue}i++,l>c&&s++,e>0&&c===e&&l===e&&o++}return{total:r.length,valid:i,invalid:t,eofCollapsed:o,multiLine:s,lineCount:e}}function e$(n){let e=yg(n);if(e.total===0||e.lineCount===0)return!1;if(e.invalid>0)return!0;let r=e.eofCollapsed/e.total;return e.eofCollapsed>=3&&r>=.5||e.total>=2&&e.eofCollapsed===e.total}function hg(n){let e=yg(n);return e.valid*2+e.multiLine*2-e.eofCollapsed*3-e.invalid*4}async function te(n,e=QS,r=!1,i=!0,t){let o=z.getInstance(n),s=o.files.database,a=io(n),c=a.concurrency??e;if(Wf(),!r&&rt(n)){let y=jr(n),b=Me(n);if(y&&!Mc(n,y))return Ki(),$.debug({repoPath:n,commit:b},"Index is current, skipping re-index (fast-path)"),s}jn(n);let l=o.files.findAll(),u=new Map(l.map(y=>[y.path,{mtime:y.mtime,hash:y.content_hash}])),p=Date.now();t?.({phase:"scan",current:0,total:0,message:"Scanning repository..."});let d=await xc(n,a.ignore),m=new Map(d.map(y=>[y.path,y.mtime])),f=l.filter(y=>!m.has(y.path)).map(y=>y.path),h=l.length===0,v=[];if(r||h)v.push(...d);else{let y=d.filter(k=>{let I=u.get(k.path);return!I||I.mtime!==k.mtime}),b=Jc(c*4),_=y.map(k=>b(async()=>{let I=u.get(k.path);if(!I||!I.hash)return k;try{let N=await KS.promises.readFile(k.path,"utf8");return Pc(N,I.hash)?k:(o.files.updateMtime(k.path,k.mtime),null)}catch{return null}})),x=await Promise.all(_);v.push(...x.filter(k=>k!==null))}if(f.length===0&&v.length===0){Ki();let y=Me(n);return to(n,y||void 0),s}if(h?$.info({totalFiles:d.length},"Starting initial repository indexing..."):$.info({toDelete:f.length,toProcess:v.length},"Syncing repository updates..."),f.length>0&&o.files.deletePaths(f),v.length>0){Gf(),i?(Wr(!0),gn().initialize().catch(()=>{})):Wr(!1);let y=/\.(ts|tsx|php|py|go|js|jsx|mjs|cjs)$/,b=[],_=[];for(let O of v)y.test(Vc.basename(O.path))?b.push(O):_.push(O);let x=0,k=v.length,I=!1,N=jh();try{await N.initialize(),I=!0,$.info({workers:N.workerCount},"Parser worker pool active")}catch(O){$.warn({err:O},"Parser worker pool failed to initialize, falling back to main-thread parsing"),I=!1}let L=async(O,K)=>{let D=K;if(I&&e$(K))try{let J=await On(O.path);hg(J)>hg(K)&&($.warn({filePath:O.path},"Detected suspicious worker parse ranges; using main-thread parse output"),D=J)}catch(J){$.warn({filePath:O.path,err:J instanceof Error?J.message:String(J)},"Main-thread parse retry failed after suspicious worker parse")}let M=D.imports?.map(J=>({...J,resolved_path:Ht(J.module,O.path,n)})),V=D.content?fn(D.content):null;return x++,(x%50===0||x===k)&&$.info({completed:x,total:k},"Parsing files..."),t?.({phase:"parse",current:x,total:k,message:`Parsing ${Vc.basename(O.path)}`}),{meta:O,...D,imports:M,embedding:null,kind:"code",contentHash:V}},C;if(I)C=b.map(O=>N.parseFile(O.path).then(K=>L(O,K),K=>(x++,$.error({path:O.path,error:K},"Worker parse failed"),{meta:O,exports:[],imports:[],content:"",kind:"error"})));else{let O=h?Math.max(c,Math.min(XS-1,16)):c,K=Jc(O);C=b.map(D=>K(async()=>{try{let M=await On(D.path);return L(D,M)}catch(M){return x++,$.error({path:D.path,error:M},"Failed to parse file"),{meta:D,exports:[],imports:[],content:"",kind:"error"}}}))}let S=Jc(c),R=_.map(O=>S(async()=>{try{let K=sh(O.path),D=K.content?fn(K.content):null;return x++,(x%50===0||x===k)&&$.info({completed:x,total:k},"Parsing configs..."),t?.({phase:"parse",current:x,total:k,message:`Parsing config ${Vc.basename(O.path)}`}),{meta:O,...K,embedding:null,kind:"config",contentHash:D}}catch(K){return x++,$.error({path:O.path,error:K},"Failed to parse config"),{meta:O,exports:[],imports:[],content:"",kind:"error"}}}));$.info({total:k,codeFiles:b.length,configFiles:_.length,useParserPool:I},"Phase 1: Parsing all files...");let A=Date.now(),H=(await Promise.all([...C,...R])).filter(Boolean),W=Date.now()-A;if(Mr("parse",W),$.info({count:H.length,time:`${(W/1e3).toFixed(1)}s`},"Phase 1 complete"),I&&Fh().catch(()=>{}),s.pragma("synchronous = NORMAL"),s.pragma("cache_size = -64000"),i){let O=[];H.forEach((E,G)=>{"summary"in E&&E.summary&&O.push({fileIdx:G,text:E.summary})}),$.info("Phase 2+3: Generating file-summary embeddings + persisting in parallel..."),t?.({phase:"embed",current:0,total:H.length,message:"Generating embeddings..."});let K=Date.now(),D=(async()=>{let E=[];return O.length>0&&($.info({count:O.length}," \u2192 Generating file summary embeddings..."),E=await po(O.map(G=>G.text),256),$.info({count:O.length}," \u2713 File summaries complete")),E})();t?.({phase:"persist",current:0,total:H.length,message:"Saving to database..."});let M=Date.now();o.files.batchSaveIndexResults(H,n,fn,Ht);let V=Date.now()-M;Mr("persist",V),$.info({time:`${(V/1e3).toFixed(1)}s`},"Structural persist complete");let J=await D,P=Date.now()-K;if(Mr("embed",P),$.info({time:`${(P/1e3).toFixed(1)}s`},"File-summary embeddings complete"),J.length>0){let E=s.prepare("UPDATE files SET embedding = ? WHERE path = ?"),G=s.transaction(re=>{for(let B of re)E.run(B.embedding?JSON.stringify(B.embedding):null,B.path)}),Y=O.map((re,B)=>({path:H[re.fileIdx].meta.path,embedding:J[B]}));G(Y),$.info({count:Y.length},"File embedding column updated")}}else{t?.({phase:"persist",current:0,total:H.length,message:"Saving to database..."});let O=Date.now();o.files.batchSaveIndexResults(H,n,fn,Ht),Mr("persist",Date.now()-O)}s.pragma("synchronous = FULL"),s.pragma("cache_size = -2000")}if(h||v.length>0){let y=Me(n);to(n,y||void 0)}if(i&&!dg(n)&&mg(n),(v.length>0||f.length>0)&&new ze(n).detectAndRepairShifts(),h||i)try{new bn(n).analyzeHeritage(50)}catch(y){$.warn({err:y.message},"Heritage sync deferred")}return Bf(Date.now()-p),t?.({phase:"complete",current:v.length,total:v.length,message:"Indexing complete"}),s}Q();import bg from"path";import t$ from"ignore";import vg from"fs";ee();async function qc(n,e=Ui.DEFAULT_CONCURRENCY,r="detailed",i,t){$.info({repo:n,level:r,subPath:i},"Ensuring cache is up-to-date..."),await te(n,e);let{files:o,exports:s,imports:a}=z.getInstance(n),c=i?o.findInSubPath(n,i):o.findAll(),l=io(n),u=t$(),p=bg.join(n,".gitignore");if(vg.existsSync(p)&&u.add(vg.readFileSync(p,"utf8")),l.ignore&&l.ignore.length>0&&u.add(l.ignore),u.add(Fi),c=c.filter(b=>{let _=bg.relative(n,b.path);return!u.ignores(_)}),$.info({count:c.length},"Fetching data from DB..."),r==="lite"){let b=c.map(_=>({path:_.path,mtime:_.mtime}));return Or(b,n,r,t)}if(r==="summaries"){let b=c.map(_=>({path:_.path,mtime:_.mtime,classification:_.classification||void 0,summary:_.summary||void 0}));return Or(b,n,r,t)}let d=c.map(b=>b.path),m=s.findByFiles(d),f=r==="detailed"?a.findByFiles(d):[],h=new Map;for(let b of m){let _=h.get(b.file_path)||[];_.push(b),h.set(b.file_path,_)}let v=new Map;for(let b of f){let _=v.get(b.file_path)||[];_.push(b),v.set(b.file_path,_)}let y=c.map(b=>{let x=(h.get(b.path)||[]).map(I=>({name:I.name,kind:I.kind,signature:I.signature,line:I.start_line}));r==="structure"?x=x.map(I=>({name:I.name,kind:I.kind,line:I.line})):r==="signatures"&&(x=x.map(I=>({name:I.name,kind:I.kind,signature:I.signature,line:I.line})));let k=[];return r==="detailed"&&(k=(v.get(b.path)||[]).map(N=>({module:N.module_specifier,resolved_path:N.resolved_path}))),{path:b.path,mtime:b.mtime,classification:b.classification||void 0,summary:b.summary||void 0,exports:x,imports:k.length>0?k:void 0,chunks:[]}});return $.info({count:y.length},"Building hierarchical project tree..."),Or(y,n,r,t)}Oe();ee();ee();var Gt=class n{static extractKeywords(e){if(!e)return[];let r=new Set(["the","and","for","with","from","this","that","into","onto","http","https","www","com","org","net","api"]),t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>2&&!r.has(o));return Array.from(new Set(t))}static calculateKeywordCoverageFromKeywords(e,r){if(!e||!r||r.length===0)return 0;let i=e.toLowerCase();return r.filter(o=>i.includes(o)).length/r.length}static calculateKeywordCoverage(e,r){return n.calculateKeywordCoverageFromKeywords(e,n.extractKeywords(r))}static extractSnippet(e,r,i=300){if(!e||!r)return"";let t=n.extractKeywords(r);if(t.length===0)return e.slice(0,i)+"...";let o=e.split(`
|
|
661
|
+
`),s=new Array(o.length).fill(0);for(let d=0;d<o.length;d++){let m=o[d].toLowerCase(),f=0,h=0;for(let v of t)m.includes(v)&&(f++,h++);(m.includes("export ")||m.includes("class ")||m.includes("function ")||m.includes("interface "))&&(f+=1),s[d]=h*10+f}let a=0,c=-1,l=5;for(let d=0;d<=o.length-l;d++){let m=0;for(let f=0;f<l;f++)m+=s[d+f];m>c&&(c=m,a=d)}if(c<=0)return e.slice(0,i).trim()+"...";let p=o.slice(a,a+l).join(`
|
|
507
662
|
`).trim();return a>0&&(p=`...
|
|
508
663
|
`+p),a+l<o.length&&(p=p+`
|
|
509
|
-
...`),p.length>i?p.slice(0,i)+"...":p}static calculateLexicalScore(e,r){if(!e||!r)return 0;let i=
|
|
664
|
+
...`),p.length>i?p.slice(0,i)+"...":p}static calculateLexicalScore(e,r){if(!e||!r)return 0;let i=n.extractKeywords(r);if(i.length===0)return 0;let t=0,o=e.toLowerCase();for(let s of i)if(o.includes(s)){t+=1;let a=new RegExp(`\\b${s}`,"gi"),c=o.match(a);c&&(t+=Math.min(c.length*.2,2)),new RegExp(`(class|function|export|interface|enum|type)\\s+${s}`,"i").test(e)&&(t+=1.5)}return t/i.length}};Oe();ee();Q();var Jt=$.child({module:"clean-sweep"}),Kc=class{files;intentLogs;constructor(e){let{files:r,intentLogs:i}=z.getInstance(e);this.files=r,this.intentLogs=i}pruneOrphans(){Jt.info("Starting orphan pruning...");let e=0,r=0,i=this.intentLogs.findOrphans();Jt.info({orphanCount:i.length},"Found orphaned logs");for(let s of i)s.file_path&&this.files.exists(s.file_path)?(this.intentLogs.markAsLapsed(s.id),r++,Jt.debug({logId:s.id,symbolName:s.symbol_name},"Converted to lapsed intent")):(this.intentLogs.delete(s.id),e++,Jt.debug({logId:s.id},"Deleted orphaned log"));let t=this.intentLogs.findLogsForMissingFiles();for(let s of t)this.intentLogs.delete(s.id),e++;let o=this.intentLogs.findRecentDecisionActivity(1e3).length;return Jt.info({deleted:e,converted:r},"Orphan pruning complete"),{deleted:e,converted:r,retained:o}}},Io=class{lambda;constructor(e=.01){this.lambda=e}calculateScore(e,r){let t=(Math.floor(Date.now()/1e3)-r)/(3600*24),o=Math.exp(-this.lambda*t);return e*o}scoreResults(e){return e.map(r=>({...r,decayed_score:this.calculateScore(r.score,r.created_at)}))}},Yc=class{missions;constructor(e){let{missions:r}=z.getInstance(e);this.missions=r}findColdMissions(){let e=Math.floor(Date.now()/1e3)-604800,r=this.missions.findColdMissions(e,10);return Jt.info({count:r.length},"Found cold missions for compaction"),r}markDistilled(e){this.missions.update(e,{status:"distilled"})}},vn=class{pruner;scorer;compactor;constructor(e){this.pruner=new Kc(e),this.scorer=new Io,this.compactor=new Yc(e)}runMaintenance(){Jt.info("Initiating Clean Sweep maintenance protocol...");let e=this.pruner.pruneOrphans(),r=this.compactor.findColdMissions();return Jt.info("Clean Sweep maintenance complete"),{pruning:e,compaction:{eligible:r.length}}}getScorer(){return this.scorer}getCompactor(){return this.compactor}};ee();Q();var _g=$.child({module:"lineage-service"}),Kr=class{repoPath;constructor(e){this.repoPath=e}getAncestorMissionIds(e=50){try{let r=Vr(this.repoPath,e);if(r.length===0)return[];let{missions:i}=z.getInstance(this.repoPath),o=i.findByCommitShas(r).map(s=>s.id);return o.length>0&&_g.debug({count:o.length},"Identified ancestor missions for gravity bleed"),o}catch(r){return _g.warn({err:r.message},"Failed to identify ancestor missions"),[]}}};var n$={Solid:1,Liquid:.8,Virtual:.4,Intel:.2,Phantom:.05},st=class{static classify(e,r){let i=e.toLowerCase();if(r?.content){let t=r.content;if(t.includes("describe(")||t.includes("test(")||t.includes("it(")||t.includes("expect(")||t.includes('from "@jest/globals"')||t.includes('from "vitest"'))return"Virtual"}return r?.exports&&(r.exports.some(o=>o.kind==="ClassDeclaration"||o.kind==="Class")||r.exports.length>5),i.includes("/dist/")||i.includes("/build/")||i.includes("/.generated/")||i.includes("/node_modules/")||i.endsWith(".map")||i.endsWith(".log")?"Phantom":i.includes("/test/")||i.includes("/tests/")||i.includes("/__tests__/")||i.includes("/__mocks__/")||i.includes(".spec.")||i.includes(".test.")||i.includes("/e2e/")||i.includes("/test-utils/")?"Virtual":i.includes("/examples/")||i.includes("/fixtures/")||i.includes("/mocks/")||i.includes("/stories/")||i.includes("/samples/")||i.includes("/docs/")?"Intel":i.includes("/src/")||i.includes("/lib/")||i.includes("/app/")||i.includes("/core/")||i.includes("/logic/")||i.includes("/domain/")||i.includes("/services/")||i.includes("/controllers/")||i.includes("/handlers/")||i.includes("/repositories/")||i.includes("/models/")||i.includes("/packages/")&&!i.includes("/packages/config/")||i.includes("/backends/")||r?.exports&&(r.exports.some(t=>t.kind==="ClassDeclaration"||t.kind==="Class")||r.exports.length>5)?"Solid":"Liquid"}static mapClassificationToTier(e){let r=e.toLowerCase();return r==="service"||r==="repository"||r==="model"||r==="controller"||r==="handler"||r==="component"||r==="hook"||r==="titanium"||r==="solid"?"Solid":r==="test"||r==="iron"||r==="virtual"?"Virtual":r==="lead"||r==="intel"?"Intel":r==="ghost"||r==="error"||r==="phantom"?"Phantom":"Liquid"}static getMultiplier(e,r){let i=r?this.mapClassificationToTier(r):this.classify(e);return n$[i]}};Q();var xg=(c=>(c.EXACT="exact",c.EXACT_CASE_INSENSITIVE="exact-case-insensitive",c.PREFIX="prefix",c.SUFFIX="suffix",c.SUBSTRING="substring",c.CAMEL_CASE="camel-case",c.ACRONYM="acronym",c.LEVENSHTEIN="levenshtein",c))(xg||{});function r$(n,e){let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=n.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let t=1;t<=n.length;t++)e.charAt(i-1)===n.charAt(t-1)?r[i][t]=r[i-1][t-1]:r[i][t]=Math.min(r[i-1][t-1]+1,r[i][t-1]+1,r[i-1][t]+1);return r[e.length][n.length]}function i$(n,e){let r=r$(n.toLowerCase(),e.toLowerCase()),i=Math.max(n.length,e.length);return Math.round((i-r)/i*100)}function Sg(n){let e=[],r="";for(let i=0;i<n.length;i++){let t=n[i],o=t>="A"&&t<="Z",s=t>="a"&&t<="z";o&&r.length>0?(e.push(r),r=t):s||o?r+=t:r.length>0&&(e.push(r),r="")}return r.length>0&&e.push(r),e}function o$(n,e){let r=Sg(e),i=n.toLowerCase();if(r.map(s=>s[0].toLowerCase()).join("")===i)return!0;let o=0;for(let s of r){if(o>=n.length)break;let a=s.toLowerCase();if(a.startsWith(i.slice(o))){o=n.length;break}a[0]===i[o]&&o++}return o===n.length}function s$(n,e){return Sg(e).map(t=>t[0].toLowerCase()).join("")===n.toLowerCase()}function a$(n,e){let r=n.toLowerCase(),i=e.toLowerCase();if(n===e)return{matchType:"exact",score:100};if(r===i)return{matchType:"exact-case-insensitive",score:98};if(i.startsWith(r))return{matchType:"prefix",score:90+n.length/e.length*8};if(i.endsWith(r))return{matchType:"suffix",score:80+n.length/e.length*8};if(i.includes(r)){let o=n.length/e.length,s=i.indexOf(r)/e.length;return{matchType:"substring",score:70+o*10-s*5}}return s$(n,e)?{matchType:"acronym",score:75}:o$(n,e)?{matchType:"camel-case",score:65}:{matchType:"levenshtein",score:i$(n,e)*.6}}function Bn(n,e,r=50,i=5){let t=[];for(let o of e){let{matchType:s,score:a}=a$(n,o);if(a>=r){let l={exact:1e3,"exact-case-insensitive":900,prefix:800,suffix:700,substring:600,acronym:550,"camel-case":500,levenshtein:100}[s]+a;t.push({match:o,score:a,matchType:s,rank:l})}}return t.sort((o,s)=>s.rank!==o.rank?s.rank-o.rank:s.score!==o.score?s.score-o.score:o.match.length-s.match.length),t.slice(0,i)}We();var Be=class n{constructor(e){this.repoPath=e}get filesRepo(){return z.getInstance(this.repoPath).files}get exportsRepo(){return z.getInstance(this.repoPath).exports}get intentLogsRepo(){return z.getInstance(this.repoPath).intentLogs}static normalizeFileType(e){if(e==null)return;let r=Array.isArray(e)?e:e.split(",").map(i=>i.trim().replace(/^\./,""));return r.filter(Boolean).length?r:void 0}static matchesFilters(e,r,i,t){if(r.fileType?.length){let o=e.replace(/^.*\./,"").toLowerCase();if(!r.fileType.some(s=>s.toLowerCase()===o))return!1}if(r.layer!=null||r.excludeLayers&&r.excludeLayers.length>0){let o=t!=null?st.mapClassificationToTier(t):st.classify(e);if(r.layer!=null&&o!==r.layer||r.excludeLayers?.includes(o))return!1}return!0}async searchByPath(e,r,i,t,o,s=!1){let a=this.extractPathKeywords(e),c=this.isLikelySymbolQuery(e),l=this.filesRepo.findByPathKeywords(a,Math.min((r??50)*(o?Ne.FILTERED_QUERY_LIMIT_MULTIPLIER:1),de.MAX_LIMIT)).map(b=>({...b,source:"path",keywordHits:this.countPathKeywordHits(b.path,a),relevance:this.scorePathResult(b.path,a,"path",c)}));o&&(l=l.filter(b=>n.matchesFilters(b.path,t,b.mtime,b.classification))),c&&a.length>=3&&(l=l.filter(b=>b.source==="symbol"||b.keywordHits>=2));let u=this.findSymbolBackedPaths(e,a,r*3),p=new Set(l.map(b=>b.path));for(let b of u){if(p.has(b))continue;let _=this.filesRepo.findByPath(b);_&&(o&&!n.matchesFilters(_.path,t,_.mtime,_.classification)||(l.push({..._,source:"symbol",keywordHits:this.countPathKeywordHits(_.path,a),relevance:this.scorePathResult(_.path,a,"symbol",c)}),p.add(b)))}l.sort((b,_)=>_.relevance-b.relevance),o||(l=l.slice(0,Math.min(r*4,de.MAX_LIMIT)));let d=l.length;if(d===0)return{content:[{type:"text",text:`No indexed files match path/filename: "${e}".
|
|
510
665
|
|
|
511
|
-
If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};if(s){let
|
|
666
|
+
If the repo is not indexed, run shadow_recon_onboard then shadow_sync_trace. Otherwise try broader keywords.`}]};let m=b=>b.replace(this.repoPath,"").replace(/^\//,"");if(s){let _=new ce(this.repoPath).getSection("gravity"),x=new Map;if(_?.hotspots)for(let S of _.hotspots){let R=x.get(S.filePath)||0;x.set(S.filePath,R+S.gravity)}let k=l.map(S=>{let R=x.get(S.path)||0,A=S.classification?st.mapClassificationToTier(S.classification):st.classify(S.path);return{...S,gravity:R,layer:A}});k.sort((S,R)=>R.gravity!==S.gravity?R.gravity-S.gravity:R.relevance!==S.relevance?R.relevance-S.relevance:S.path.localeCompare(R.path));let I=k.slice(i,i+r),N=i+r<d;if(I.length===0)return{content:[{type:"text",text:`No results at offset ${i}. Total matches: ${d}.`}]};let L=N?`
|
|
667
|
+
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"";return{content:[{type:"text",text:`# Resolved paths: "${e}" (Ranked by Gravity)
|
|
512
668
|
|
|
513
|
-
${
|
|
669
|
+
Showing ${I.length} of ${d} file(s) (offset: ${i}, limit: ${r})${L}
|
|
514
670
|
|
|
515
|
-
`+
|
|
671
|
+
`+I.map((S,R)=>{let A=S.gravity>50?" \u269B\uFE0F":S.gravity>0?" \u2022":"",H=S.gravity>0?` [G:${Math.round(S.gravity)}]`:"",W=S.source==="symbol"?" [via symbol]":"";return`${i+R+1}. \`${m(S.path)}\` (${S.layer})${A}${H}${W}`}).join(`
|
|
516
672
|
`)+`
|
|
517
673
|
|
|
518
|
-
> **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}return{content:[{type:"text",text
|
|
674
|
+
> **Legend**: \u269B\uFE0F = High-gravity hotspot (>50), \u2022 = Has gravity, G = Gravity score`}]}}let f=l.slice(i,i+r),h=i+r<d;if(f.length===0)return{content:[{type:"text",text:`No results at offset ${i}. Total matches: ${d}.`}]};let v=h?`
|
|
675
|
+
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"";return{content:[{type:"text",text:`# Resolved paths: "${e}"
|
|
519
676
|
|
|
520
|
-
${
|
|
677
|
+
Showing ${f.length} of ${d} file(s) (offset: ${i}, limit: ${r})${v}
|
|
521
678
|
|
|
522
|
-
`+
|
|
523
|
-
`)}]}}async searchByConcept(e,r,i,t,o,s=!1){
|
|
524
|
-
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",
|
|
525
|
-
> _Compact mode: snippets omitted_`:
|
|
679
|
+
`+f.map((b,_)=>{let x=b.source==="symbol"?" [via symbol]":"";return`${i+_+1}. \`${m(b.path)}\`${b.classification?` (${b.classification})`:""}${x}`}).join(`
|
|
680
|
+
`)}]}}async searchByConcept(e,r,i,t,o,s=!1,a){$.info({repoPath:this.repoPath,query:e},"Searching by concept (Semantic Analysis)...");let c=await uo(e),l=x=>x.replace(this.repoPath,"").replace(/^\//,""),u=Gt.extractKeywords(e),p=this.classifyConceptQuery(e,u),d=this.getConceptConfidenceFloor(p.profile),m=this.getIntentConfidenceFloor(p.profile),f=Math.min(Math.max((r+i)*2,r),de.MAX_LIMIT),h=await this.findConceptMatches(e,c,t,o,f,0),v=c?await this.findIntentLogMatches(c,5):[],y=h.filter(x=>(x.score||0)>=d),b=h.filter(x=>(x.score||0)<d),_=v.filter(x=>(x.score||0)>=m);if(y.length>0){let x=y.length,k=y.slice(i,i+r),N=i+r<x?`
|
|
681
|
+
> **Note**: More results available. Use \`offset: ${i+r}\` to see the next page.`:"",L=s?`
|
|
682
|
+
> _Compact mode: snippets omitted_`:x>20&&!s?"\n> \u{1F4A1} **Tip**: Use `compact: true` to reduce output size (omits snippets).":"",C=a&&a>0?`
|
|
683
|
+
> _Adaptive compression enabled under token budget._`:"",S=b.length>0?`
|
|
684
|
+
> _${b.length} lower-confidence candidate(s) were suppressed below the ${Math.round(d*100)}% evidence floor._`:"",R=`# Semantic Concept Search: "${e}"
|
|
526
685
|
|
|
527
|
-
Showing ${
|
|
686
|
+
Showing ${k.length} of ${x} high-confidence file(s) (offset: ${i}, limit: ${r})${N}${L}${C}${S}
|
|
528
687
|
|
|
529
|
-
`,
|
|
530
|
-
|
|
531
|
-
>
|
|
532
|
-
> **Rationale**: ${C.rationale}${ue}
|
|
688
|
+
`,H=new ce(this.repoPath).getSection("gravity"),W=new Map;if(H?.hotspots)for(let M of H.hotspots)W.set(M.filePath,M.gravity);let O=k.map((M,V)=>{let J=l(M.path),P=Math.round((M.score||0)*100),G=W.get(M.path)?" \u269B\uFE0F":"";return`${i+V+1}. \`${J}\`${G} (${P}% evidence) - ${M.summary||"No summary"}`}),K=k.map((M,V)=>{let J=l(M.path),P=Math.round((M.score||0)*100),E=W.get(M.path),G=E?" \u269B\uFE0F **CORE**":"",Y=E&&E>50?`
|
|
689
|
+
> \u26A0\uFE0F **STRATEGIC RISK**: High-gravity hotspot (${E.toFixed(0)}). Modifications may have significant architectural impact.`:"",re=`## ${i+V+1}. ${J}${G} (${P}% Evidence Match)
|
|
690
|
+
> **Rationale**: ${M.rationale}${Y}
|
|
533
691
|
|
|
534
|
-
`+(
|
|
692
|
+
`+(M.snippet?`**Matched Snippet**:
|
|
535
693
|
\`\`\`typescript
|
|
536
|
-
${
|
|
694
|
+
${M.snippet}
|
|
537
695
|
\`\`\`
|
|
538
696
|
|
|
539
|
-
`:"")+`**Summary**: ${
|
|
540
|
-
|
|
541
|
-
`);
|
|
697
|
+
`:"")+`**Summary**: ${M.summary||"No summary available"}
|
|
698
|
+
`;return{index:i+V+1,relativePath:J,matchPct:P,gravity:E,text:re}}),D="";if(s)D=R+O.join(`
|
|
699
|
+
`);else if(a&&a>0){let M=Math.max(80,Math.floor(a*.12)),V=this.estimateTokenCount(R),J=[],P=[];for(let E of K){let G=this.estimateTokenCount(E.text),Y=V+G<=a-M;if(J.length<2||Y)J.push(E.text),V+=G;else{let re=E.gravity?" \u269B\uFE0F":"";P.push(`${E.index}. \`${E.relativePath}\`${re} (${E.matchPct}% Evidence Match)`)}}D=R+J.join(`
|
|
700
|
+
`),P.length>0&&(D+=`
|
|
701
|
+
|
|
702
|
+
### Folded Lower-Relevance Matches (${P.length})
|
|
703
|
+
_Expanded blocks omitted to stay within token budget._
|
|
704
|
+
`+P.join(`
|
|
705
|
+
`))}else D=R+K.map(M=>M.text).join(`
|
|
706
|
+
`);if(_.length>0){let M=`
|
|
542
707
|
|
|
543
708
|
---
|
|
544
|
-
## Intent Vectors (${
|
|
709
|
+
## Intent Vectors (${_.length} matching decision(s))
|
|
545
710
|
|
|
546
|
-
|
|
547
|
-
> ${
|
|
711
|
+
`+_.map((J,P)=>{let E=Math.round((J.score||0)*100),G=J.symbolName?` \`${J.symbolName}\``:"",Y=J.missionId?` [Mission #${J.missionId}]`:"",re=J.content.length>200?J.content.slice(0,200)+"...":J.content;return s?`${P+1}. **[${J.type}]**${G}${Y} (${E}%) - ${re}`:`### ${P+1}. [${J.type}]${G}${Y} (${E}% Evidence Match)
|
|
712
|
+
> ${re}
|
|
548
713
|
`}).join(`
|
|
549
|
-
`)
|
|
714
|
+
`),V=`
|
|
550
715
|
|
|
551
|
-
|
|
716
|
+
---
|
|
717
|
+
## Intent Vectors (${_.length} matching decision(s))
|
|
552
718
|
|
|
553
|
-
|
|
719
|
+
`+_.slice(0,2).map((J,P)=>{let E=Math.round((J.score||0)*100),G=J.symbolName?` \`${J.symbolName}\``:"",Y=J.missionId?` [Mission #${J.missionId}]`:"";return`${P+1}. **[${J.type}]**${G}${Y} (${E}%)`}).join(`
|
|
720
|
+
`)+(_.length>2?`
|
|
721
|
+
> Additional intent matches folded by token budget.`:"");a&&a>0&&this.estimateTokenCount(D+M)>a?D+=V:D+=M}return{content:[{type:"text",text:D}]}}if(i===0){let x=this.filesRepo.getStats(),k=e.toLowerCase().split(/\s+/),I=this.filesRepo.findByPathKeywords(k,r);if(o&&(I=I.filter(N=>n.matchesFilters(N.path,t,N.mtime,N.classification))),I.length>0)return{content:[{type:"text",text:`# Concept Search: "${e}"
|
|
554
722
|
|
|
555
|
-
|
|
556
|
-
`)}]}:{content:[{type:"text",text:`No files found matching concept: "${e}"
|
|
723
|
+
\u26A0\uFE0F No high-confidence semantic matches cleared the ${Math.round(d*100)}% evidence floor (${x.withSummary}/${x.total} summaries indexed).
|
|
557
724
|
|
|
558
|
-
|
|
725
|
+
Found ${I.length} file(s) with matching paths:
|
|
559
726
|
|
|
560
|
-
|
|
561
|
-
>
|
|
562
|
-
|
|
727
|
+
`+I.map((L,C)=>`${C+1}. \`${l(L.path)}\` (${L.classification||"Unknown"})`).join(`
|
|
728
|
+
`)}]};if(b.length>0){let N=b.slice(0,Math.min(3,r)).map((L,C)=>{let S=Math.round((L.score||0)*100);return`${C+1}. \`${l(L.path)}\` (${S}% evidence) - ${L.summary||"No summary"}`}).join(`
|
|
729
|
+
`);return{content:[{type:"text",text:`# Semantic Concept Search: "${e}"
|
|
563
730
|
|
|
564
|
-
|
|
731
|
+
No high-confidence semantic matches cleared the evidence floor (${Math.round(d*100)}% required for ${p.profile} queries).
|
|
565
732
|
|
|
566
|
-
|
|
567
|
-
|
|
733
|
+
Low-confidence candidates were suppressed instead of being presented as relevant matches:
|
|
734
|
+
${N?`
|
|
735
|
+
${N}
|
|
568
736
|
|
|
569
|
-
|
|
570
|
-
`)
|
|
571
|
-
|
|
737
|
+
`:`
|
|
738
|
+
`}Try adding distinctive identifiers, narrowing the concept, or using shadow_search_symbol({ query: "${e}", repoPath }).`}]}}}return{content:[{type:"text",text:`No high-confidence files found matching concept: "${e}"
|
|
739
|
+
|
|
740
|
+
Try a symbol search: shadow_search_symbol({ query: "${e}", repoPath })`}]}}async searchBySymbol(e,r,i,t,o,s="any"){let a=e.toLowerCase(),c=S=>S.replace(this.repoPath,"").replace(/^\//,""),l=this.buildFtsQuery(e,s),u;try{u=this.exportsRepo.findFts(l,r+50)}catch{u=this.exportsRepo.findByPartialName(e,r+50)}if(u.length===0){let S=this.exportsRepo.getAllNames(5e3),R=e.trim().split(/\s+/).filter(H=>H.length>0);if(R.length>1){let H=new Map;for(let O of R){let K=Bn(O,S,40,20);for(let D of K){let M=H.get(D.match);M?(M.terms.push(O),M.bestScore=Math.max(M.bestScore,D.score)):H.set(D.match,{terms:[O],bestScore:D.score})}}let W=Array.from(H.entries()).sort((O,K)=>K[1].terms.length!==O[1].terms.length?K[1].terms.length-O[1].terms.length:K[1].bestScore-O[1].bestScore).slice(0,10);if(W.length>0){let O=W.map(([K,D])=>{let M=D.terms.join(", ");return` \u2022 \`${K}\` (matches: ${M}, ${Math.round(D.bestScore)}%)`}).join(`
|
|
572
741
|
`);return{content:[{type:"text",text:`No symbols found matching all terms: "${e}"
|
|
573
742
|
|
|
574
743
|
**Partial matches:**
|
|
575
|
-
${
|
|
744
|
+
${O}
|
|
576
745
|
|
|
577
|
-
\u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let
|
|
746
|
+
\u{1F4A1} Try searching for individual terms, or use shadow_search_concept for semantic search.`}]}}}else{let H=Bn(e,S,50,5);if(H.length>0){let W=H.map(O=>` \u2022 \`${O.match}\` (${Math.round(O.score)}% ${O.matchType} match)`).join(`
|
|
578
747
|
`);return{content:[{type:"text",text:`No symbols found matching: "${e}"
|
|
579
748
|
|
|
580
749
|
**Did you mean?**
|
|
581
|
-
${
|
|
750
|
+
${W}
|
|
582
751
|
|
|
583
752
|
\u{1F4A1} Try shadow_search_symbol with fuzzy, or shadow_search_concept for semantic search.`}]}}}return{content:[{type:"text",text:`No symbols found matching: "${e}"
|
|
584
753
|
|
|
585
|
-
\u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(
|
|
586
|
-
`);
|
|
587
|
-
`).trim()}let
|
|
754
|
+
\u{1F4A1} Try shadow_search_symbol (fuzzy) or shadow_search_concept for semantic search.`}]}}o&&(u=u.filter(S=>{let R=this.filesRepo.findByPath(S.file_path);return n.matchesFilters(S.file_path,t,R?.mtime,R?.classification)}));let p=new Kr(this.repoPath),d=new ce(this.repoPath),m=p.getAncestorMissionIds(),f=ge(this.repoPath)||void 0,h=this.exportsRepo.getGravityMap(m,f),v=d.getSection("gravity"),y=new Map;if(v?.hotspots)for(let S of v.hotspots)y.set(`${S.filePath}::${S.symbol}`,S.gravity);let b="\u{1F525}",_="\u26A1",x="\u269B\uFE0F",k=u.map((S,R)=>{let A=h[S.id],H=y.get(`${S.file_path}::${S.name}`),W=this.filesRepo.findByPath(S.file_path),O=st.getMultiplier(S.file_path,W?.classification),K=(Ne.SCORE_BASE-R)*O;A&&(K+=A.score*Ne.SCORE_BASE),H&&(K+=H*Ne.SCORE_BASE*Ne.GRAVITY_STRUCTURAL_WEIGHT),S.name.toLowerCase()===a&&(K+=Ne.EXACT_MATCH_BONUS*O);let D=W?.mtime;if(D!=null){let V=D>1e10?D/1e3:D,J=(Date.now()/1e3-V)/_c.SECONDS_PER_DAY;J<Ne.RECENT_FILE_THRESHOLD_DAYS?K+=Ne.RECENT_FILE_BOOST:J<Ne.OLDER_FILE_THRESHOLD_DAYS&&(K+=Ne.OLDER_FILE_BOOST)}let M=[];return A&&M.push(...A.reasons),H&&M.push(`Structural Hotspot (Gravity: ${H.toFixed(1)})`),{...S,activeGravity:A,structuralGravity:H,sortScore:K,reasons:M}}).sort((S,R)=>R.sortScore-S.sortScore).slice(i,i+r),I=u.length,N=i+r<I,L=k.map((S,R)=>{let A=c(S.file_path),H=this.filesRepo.getContent(S.file_path),W="";if(H){let D=H.split(`
|
|
755
|
+
`);W=D.slice(Math.max(0,S.start_line-2),Math.min(D.length,S.start_line+3)).join(`
|
|
756
|
+
`).trim()}let O=[];S.activeGravity&&(S.activeGravity.reasons.some(D=>D.includes("Working Set"))?O.push(b):S.activeGravity.reasons.some(D=>D.includes("Recent Intent"))&&O.push(_)),S.structuralGravity&&O.push(x);let K=O.length>0?` ${O.join("")}`:"";return{relPath:A,name:S.name,kind:S.kind,signature:S.signature,line:S.start_line,snippet:W,badgeStr:K,gravityReasons:S.reasons}});return{content:[{type:"text",text:`# Symbol Search Results: "${e}"
|
|
588
757
|
|
|
589
|
-
Showing ${
|
|
758
|
+
Showing ${L.length} matching symbol(s)${N?` (use offset=${i+r} for more)`:""}:
|
|
590
759
|
|
|
591
|
-
`+
|
|
592
|
-
**File**: \`${
|
|
593
|
-
`;return
|
|
594
|
-
`),
|
|
595
|
-
`),
|
|
760
|
+
`+L.map((S,R)=>{let A=`## ${i+R+1}. \`${S.name}\` (${S.kind})${S.badgeStr}
|
|
761
|
+
**File**: \`${S.relPath}:${S.line}\`
|
|
762
|
+
`;return S.gravityReasons&&(A+=`> *${S.gravityReasons.join(", ")}*
|
|
763
|
+
`),S.signature&&(A+=`**Signature**: \`${S.signature}\`
|
|
764
|
+
`),S.snippet&&(A+=`
|
|
596
765
|
\`\`\`typescript
|
|
597
|
-
${
|
|
766
|
+
${S.snippet}
|
|
598
767
|
\`\`\`
|
|
599
|
-
`),
|
|
600
|
-
`)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=ve(this.repoPath)||void 0;if(!r)return[];let c=this.filesRepo.findWithEmbeddings(),u=new en(this.repoPath).getScorer(),d=new Tr(this.repoPath).getAncestorMissionIds(),m=[];for(let h of c)try{let _=JSON.parse(h.embedding),v=ji(r,_),y=this.filesRepo.getContent(h.path),k=Ie.ENABLE_LEXICAL_SCORING&&y?Ir.calculateLexicalScore(y,e):0,S=1;if(y){let E=/\b(class|function|const|let|var|enum)\s+\w+/.test(y);if(/export\s+/.test(y)&&!E){let P=y.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(P)||(S=.1)}}let $=k>0?.1:.18;if(v>$){if(t&&!n.matchesFilters(h.path,i,h.mtime,h.classification))continue;let E=h.mtime>2e9?Math.floor(h.mtime/1e3):h.mtime,T=Math.floor(Date.now()/1e3)-Fa.SECONDS_PER_YEAR,P=Ke.getMultiplier(h.path,h.classification),U=u.calculateScore(v,E||T);U*=P;let O=this.filesRepo.getGravityMap(d,a)[h.path],Z=h.classification?Ke.mapClassificationToTier(h.classification):Ke.classify(h.path,{content:y??void 0}),B=`Similarity: ${(v*100).toFixed(0)}%, Tier: ${Z}${P!==1?` (${P}x)`:""}`;k>0&&(U+=k*Ie.LEXICAL_WEIGHT,B+=` | Lexical: +${k.toFixed(1)}`),O&&(U+=O.score,B+=` | \u{1F525} Gravity: +${O.score.toFixed(1)} (${O.reasons.join(", ")})`),S<1&&(U*=S,B+=` | \u{1F4C9} Barrel: x${S}`);let C=y?Ir.extractSnippet(y,e):void 0;m.push({path:h.path,summary:h.summary||"",score:v,decayedScore:U,rationale:B,snippet:C})}}catch{}let f=new Map;for(let h of m){let _=h.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();_&&_.length>3&&(f.has(_)||f.set(_,[]),f.get(_).push(h))}for(let[h,_]of f.entries())if(new Set(_.map(y=>y.path.split(".").pop())).size>1)for(let y of _)y.decayedScore=(y.decayedScore||0)+.15,y.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${h}')`;return m.sort((h,_)=>(_.decayedScore||0)-(h.decayedScore||0)),m}async findIntentLogMatches(e,r){return(await this.intentLogsRepo.findSemanticMatches(e,r)).map(t=>({id:t.id,missionId:t.mission_id,type:t.type,content:t.content,symbolName:t.symbol_name,filePath:t.file_path,score:t.similarity,decayedScore:t.similarity,rationale:`Similarity: ${(t.similarity*100).toFixed(0)}%`,createdAt:t.created_at}))}buildFtsQuery(e,r){let i=e.trim();if(!i.includes(" "))return`"${i}" OR ${i}*`;let t=i.split(/\s+/).filter(o=>o.length>0);switch(r){case"exact":return`"${i}"`;case"all":return t.map(o=>`${o}*`).join(" ");default:return t.map(o=>`${o}*`).join(" OR ")}}};Oe();gt();function Dt(n){let{fileType:e,layer:r}=n,i={fileType:Ae.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}X();Oe();import{Visitor as Kb}from"@swc/core/Visitor.js";var In=class extends Kb{calls=new Set;apiCalls=[];imports=new Map;axiosInstances=new Map([["axios",""],["http",""],["appApi",""],["restApi",""],["adminApi",""]]);visitImportDeclaration(e){let r=e.source.value;for(let i of e.specifiers)(i.type==="ImportDefaultSpecifier"||i.type==="ImportSpecifier")&&this.imports.set(i.local.value,r);return super.visitImportDeclaration(e)}visitCallExpression(e){if(e.callee.type==="Identifier"){let r=e.callee.value;this.calls.add(r),(r==="axios"||r==="http")&&e.arguments.length>0&&this.extractApiCallFromConfig(e.arguments[0].expression)}else if(e.callee.type==="MemberExpression"){let r=e.callee.property.value,i=o=>{if(!o)return"?";if(o.type==="Identifier")return o.value;if(o.type==="ThisExpression")return"this";if(o.type==="MemberExpression"){let s=i(o.object),a=o.property.value||"?";return`${s}.${a}`}return o.type==="TsNonNullExpression"||o.type==="TsAsExpression"||o.type==="ParenthesisExpression"?i(o.expression):"?"},t=i(e.callee.object);if(t!=="?"&&r){if(this.calls.add(`${t}.${r}`),t==="axios"||t==="http"||this.axiosInstances.has(t)){let o=this.axiosInstances.get(t)||"";this.extractApiCall(r,e.arguments,o)}if((t.toLowerCase().includes("pubsub")||t==="pubSubClient"||t.endsWith(".pubSubClient"))&&r!=="subscribe"){let o=r;if((r==="publish"||r==="publishMessage"||r==="publishTaskByNameAndPayload")&&e.arguments.length>0)for(let s of e.arguments){let a=s.expression;if(a.type==="ObjectExpression"){let c=a.properties.find(l=>l.key?.type==="Identifier"&&(l.key.value==="action"||l.key.value==="type")||l.key?.type==="StringLiteral"&&(l.key.value==="action"||l.key.value==="type"));if(c&&c.value?.type==="StringLiteral"){o=c.value.value;break}}if(a.type==="CallExpression"&&a.callee.type==="MemberExpression"&&a.callee.object.value==="JSON"&&a.callee.property.value==="stringify"&&a.arguments.length>0){let c=a.arguments[0].expression;if(c.type==="ObjectExpression"){let l=c.properties.find(u=>u.key?.type==="Identifier"&&(u.key.value==="action"||u.key.value==="type")||u.key?.type==="StringLiteral"&&(u.key.value==="action"||u.key.value==="type"));if(l&&l.value?.type==="StringLiteral"){o=l.value.value;break}}}}this.apiCalls.push({method:"PUBSUB",url:o})}}}return e.callee.type==="Identifier"&&e.callee.value==="fetch"&&this.extractApiCall("GET",e.arguments),super.visitCallExpression(e)}visitNewExpression(e){return e.callee.type==="Identifier"&&this.calls.add(e.callee.value),super.visitNewExpression(e)}visitVariableDeclarator(e){if(e.init&&e.init.type==="CallExpression"){let r=e.init.callee;if(r.type==="MemberExpression"&&r.property.value==="create"&&r.object.value==="axios"){let t=e.init.arguments[0]?.expression;if(t&&t.type==="ObjectExpression"){let o=t.properties.find(s=>s.key.value==="baseURL");if(o){let s="?";o.value.type==="StringLiteral"?s=o.value.value:o.value.type==="Identifier"&&(s=`\${${o.value.value}}`),e.id.type==="Identifier"&&this.axiosInstances.set(e.id.value,s)}}}}return super.visitVariableDeclarator(e)}extractApiCallFromConfig(e){if(e&&e.type==="ObjectExpression"){let r=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="url"||t.key.type==="StringLiteral"&&t.key.value==="url"),i=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="method"||t.key.type==="StringLiteral"&&t.key.value==="method");if(r&&r.value){let t=i?.value?.value||"GET",o=this.resolveUrlValue(r.value);o!=="?"&&this.apiCalls.push({method:t.toUpperCase(),url:o})}}}resolveUrlValue(e){return e.type==="StringLiteral"?e.value:e.type==="TemplateLiteral"?e.quasis.map(r=>r.cooked).join("*"):"?"}visitTsType(e){return e}extractApiCall(e,r,i=""){if(r.length>0){let t=r[0].expression,o=this.resolveUrlValue(t);if(o!=="?"){if(i&&i!=="?"){let s=i.endsWith("/")||o.startsWith("/")?"":"/";o=`${i}${s}${o}`}this.apiCalls.push({method:e.toUpperCase(),url:o})}}}},Ot=class{calls=new Set;apiCalls=[];imports=new Map;visit(e,r){if(r===".php"){let i=/(?:([a-zA-Z0-9_$->:\(\)]*)?(?:->|::))?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&!["$this","self","parent"].includes(o)&&this.calls.add(`${o}${o.includes("::")?"::":"->"}${s}`),["save","delete","update","create","first","all","where","get","find"].includes(s)&&o&&!["Log","Route","Cache","Config","Http"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}->${s}()`}),s==="publish"&&o&&(o.includes("topic")||o.includes("pubSub"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="Http"||o==="client"||o.endsWith("request")||o.includes("Client")||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if(r===".py"){let i=/(?:([a-zA-Z0-9_\.]+)\.)?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&o!=="self"&&o!=="cls"&&this.calls.add(`${o}.${s}`),["save","delete","update","create","first","all","filter","get"].includes(s)&&o&&!["logger","os","sys"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}.${s}()`}),s==="publish"&&o&&(o.includes("publisher")||o.includes("client"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="requests"||o==="httpx"||o==="client"||o==="http"||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if([".ts",".tsx",".js",".jsx"].includes(r)){let i=/import\s+[\s\S]*?from\s+['"](.*?)['"];?/g,t;for(;(t=i.exec(e))!==null;)this.imports.set("*",t[1]);let o=/(?:([a-zA-Z0-9_$]+)\.)?([a-zA-Z0-9_$]+)\s*\(/g,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=s[2];a?(this.calls.add(`${a}.${c}`),(a.toLowerCase().includes("pubsub")||a==="pubSubClient")&&c!=="subscribe"&&this.apiCalls.push({method:"PUBSUB",url:c})):this.calls.add(c)}}else{let i=/\.([a-zA-Z0-9_]+)\s*\(/g,t;for(;(t=i.exec(e))!==null;)this.calls.add(t[1])}if(r===".php"){let i=/use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/g,t;for(;(t=i.exec(e))!==null;){let o=t[1],s=o.split("\\"),a=t[2]||s[s.length-1];this.imports.set(a,o)}}else if(r===".py"){let i=/from\s+([a-zA-Z0-9_\.]+)\s+import\s+([a-zA-Z0-9_,\s]+)/g,t;for(;(t=i.exec(e))!==null;){let a=t[1];t[2].split(",").map(l=>l.trim()).forEach(l=>{this.imports.set(l,a)})}let o=/^import\s+([a-zA-Z0-9_\.]+)/gm,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=a.split("."),l=c[c.length-1];this.imports.set(l,a)}}}};J();import sx from"path";J();Et();import Yb from"better-sqlite3";import Tn from"path";import xh from"fs";import Xb from"os";import Qb from"crypto";var ex=b.child({module:"fusion-connection"}),eo=5,tx=1,Sh=["files","exports","imports","configs","schema_migrations"],to=class{fusionDb;attachedRepos=new Map;fusionDbPath;name;constructor(e){this.name=e.name,this.fusionDbPath=this.getFusionDbPath(e.name),ex.info({name:e.name,path:this.fusionDbPath},"Initializing fused index connection");let r=Tn.dirname(this.fusionDbPath);xh.existsSync(r)||xh.mkdirSync(r,{recursive:!0}),this.fusionDb=new Yb(this.fusionDbPath),this.fusionDb.pragma("journal_mode = WAL"),this.fusionDb.pragma("busy_timeout = 5000"),this.initFusionSchema();for(let i of e.repoPaths)this.attachRepo(i)}getFusionDbPath(e){let r=Xb.homedir(),i=Tn.join(r,".mcp-liquid-shadow","fused"),t=e.replace(/[^a-zA-Z0-9-_]/g,"_");return Tn.join(i,`${t}.db`)}initFusionSchema(){this.fusionDb.exec(`
|
|
601
|
-
|
|
602
|
-
alias TEXT PRIMARY KEY,
|
|
603
|
-
repo_path TEXT NOT NULL UNIQUE,
|
|
604
|
-
db_path TEXT NOT NULL,
|
|
605
|
-
schema_version INTEGER NOT NULL,
|
|
606
|
-
attached_at REAL DEFAULT (unixepoch()),
|
|
607
|
-
last_validated_at REAL
|
|
608
|
-
);
|
|
609
|
-
|
|
610
|
-
CREATE TABLE IF NOT EXISTS fused_metadata (
|
|
611
|
-
key TEXT PRIMARY KEY,
|
|
612
|
-
value TEXT NOT NULL,
|
|
613
|
-
updated_at REAL DEFAULT (unixepoch())
|
|
614
|
-
);
|
|
615
|
-
|
|
616
|
-
CREATE TABLE IF NOT EXISTS virtual_edges (
|
|
617
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
618
|
-
source_repo TEXT NOT NULL,
|
|
619
|
-
source_file_path TEXT NOT NULL,
|
|
620
|
-
source_symbol_id INTEGER,
|
|
621
|
-
target_repo TEXT NOT NULL,
|
|
622
|
-
target_file_path TEXT NOT NULL,
|
|
623
|
-
target_symbol_id INTEGER,
|
|
624
|
-
relationship TEXT NOT NULL,
|
|
625
|
-
metadata TEXT,
|
|
626
|
-
confidence REAL DEFAULT 1.0,
|
|
627
|
-
created_at REAL DEFAULT (unixepoch()),
|
|
628
|
-
updated_at REAL DEFAULT (unixepoch()),
|
|
629
|
-
UNIQUE(source_repo, source_file_path, target_repo, target_file_path, relationship)
|
|
630
|
-
);
|
|
631
|
-
|
|
632
|
-
CREATE INDEX IF NOT EXISTS idx_virtual_edges_source ON virtual_edges(source_repo, source_file_path);
|
|
633
|
-
CREATE INDEX IF NOT EXISTS idx_virtual_edges_target ON virtual_edges(target_repo, target_file_path);
|
|
634
|
-
`),this.fusionDb.prepare("INSERT OR REPLACE INTO fused_metadata (key, value, updated_at) VALUES ('schema_version', ?, unixepoch())").run(tx.toString())}attachRepo(e){let r=Tn.resolve(e);if(this.attachedRepos.has(r))return;if(!Ge(r))throw new Error(`Repository "${r}" is not indexed. Run shadow_recon_onboard({ repoPath: "${r}" }) then shadow_sync_trace({ repoPath: "${r}" }).`);let i=Te(r),t=i.name;this.validateSchemaCompatibility(i,r);let o=this.getSchemaVersion(i),s=this.generateAlias(r),a=3,c=100;for(let l=1;l<=a;l++)try{this.fusionDb.exec(`ATTACH DATABASE '${t}' AS ${s}`);let u={alias:s,repoPath:r,dbPath:t,schemaVersion:o,attached:!0};this.attachedRepos.set(r,u),this.fusionDb.prepare(`INSERT OR REPLACE INTO fused_repos (alias, repo_path, db_path, schema_version, attached_at, last_validated_at)
|
|
635
|
-
VALUES (?, ?, ?, ?, unixepoch(), unixepoch())`).run(s,r,t,o);return}catch(u){let p=u instanceof Error?u.message.toLowerCase():String(u).toLowerCase();if((p.includes("locked")||p.includes("busy"))&&l<a){this.sleep(c*l);continue}throw u}}checkHealth(){let e=[];for(let r of this.attachedRepos.values())try{this.fusionDb.prepare(`SELECT 1 FROM ${r.alias}.files LIMIT 1`).get(),e.push({alias:r.alias,repoPath:r.repoPath,accessible:!0})}catch(i){e.push({alias:r.alias,repoPath:r.repoPath,accessible:!1,error:i instanceof Error?i.message:String(i)})}return{healthy:e.every(r=>r.accessible),repos:e}}detachRepo(e){let r=Tn.resolve(e),i=this.attachedRepos.get(r);i&&(this.fusionDb.exec(`DETACH DATABASE ${i.alias}`),this.attachedRepos.delete(r),this.fusionDb.prepare("DELETE FROM fused_repos WHERE repo_path = ?").run(r))}refreshRepo(e){this.detachRepo(e),this.attachRepo(e)}refreshAll(){let e=Array.from(this.attachedRepos.keys());for(let r of e)this.refreshRepo(r)}validateSchemas(){let e=Array.from(this.attachedRepos.values()).map(r=>{let i=Te(r.repoPath),t=Sh.filter(s=>!this.checkTableExists(i,s)),o=this.getSchemaVersion(i);return{alias:r.alias,repoPath:r.repoPath,schemaVersion:o,compatible:o>=eo&&t.length===0,missingTables:t}});return{valid:e.every(r=>r.compatible),minVersion:eo,repos:e}}getAttachedRepos(){return Array.from(this.attachedRepos.values())}prepare(e){return this.fusionDb.prepare(e)}exec(e){this.fusionDb.exec(e)}close(){for(let e of this.attachedRepos.values())try{this.fusionDb.exec(`DETACH DATABASE ${e.alias}`)}catch{}this.attachedRepos.clear(),this.fusionDb.open&&this.fusionDb.close()}generateAlias(e){let r=Tn.basename(e).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),i=Qb.createHash("sha256").update(e).digest("hex").substring(0,6);return`repo_${r}_${i}`}getSchemaVersion(e){try{return e.prepare("SELECT MAX(version) as version FROM schema_migrations").get()?.version||0}catch{return 0}}validateSchemaCompatibility(e,r){let i=this.getSchemaVersion(e);if(i<eo)throw new Error(`Schema version mismatch for ${r}. Expected >= ${eo}, got ${i}.`);let t=Sh.filter(o=>!this.checkTableExists(e,o));if(t.length>0)throw new Error(`Missing tables in ${r}: ${t.join(", ")}`)}checkTableExists(e,r){try{return!!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(r)}catch{return!1}}sleep(e){let r=Date.now()+e;for(;Date.now()<r;);}get nameValue(){return this.name}get dbPath(){return this.fusionDbPath}};J();var At=b.child({module:"edge-scanner"});function _c(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function nx(n){if(!n)return null;try{let e=JSON.parse(n);return e.path||e.name||null}catch{return null}}function rx(n,e){let r=_c(n),i=_c(e);if(r===i)return!0;let t=i.replace(/:[^/]+/g,"[^/]+").replace(/\{[^}]+\}/g,"[^/]+").replace(/\$[^/]+/g,"[^/]+");return new RegExp(`^${t}$`).test(r)}function ix(n){At.info("Starting HTTP gap detection scan");let e=n.getAttachedRepos();if(e.length<2)return At.warn("Need at least 2 repos for cross-repo dependency detection"),0;let r=[];for(let o of e)try{let s=`
|
|
636
|
-
SELECT id, name, file_path, capabilities
|
|
637
|
-
FROM ${o.alias}.exports
|
|
638
|
-
WHERE kind = 'HTTP Route'
|
|
639
|
-
`,a=n.executeRawQuery(s);for(let c of a){let l=nx(c.capabilities)||c.name;l&&l.startsWith("/")&&r.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,symbolId:c.id,routePath:l})}}catch(s){At.warn({repo:o.alias,error:s},"Failed to query backend routes")}At.debug({count:r.length},"Found backend routes");let i=[];for(let o of e)try{let s=`
|
|
640
|
-
SELECT file_path, name
|
|
641
|
-
FROM ${o.alias}.event_synapses
|
|
642
|
-
WHERE type = 'api_route' AND direction = 'produce'
|
|
643
|
-
`,a=n.executeRawQuery(s);for(let c of a){let l=_c(c.name);l&&l.startsWith("/")&&i.push({repo:o.alias,repoPath:o.repoPath,filePath:c.file_path,routePath:l})}}catch(s){At.warn({repo:o.alias,error:s},"Failed to query frontend API calls")}At.debug({count:i.length},"Found frontend API calls");let t=0;for(let o of i)for(let s of r)if(o.repoPath!==s.repoPath&&rx(o.routePath,s.routePath))try{n.addVirtualEdge({sourceRepo:o.repoPath,sourceFilePath:o.filePath,targetRepo:s.repoPath,targetFilePath:s.filePath,targetSymbolId:s.symbolId,relationship:"api_call",metadata:{frontendPath:o.routePath,backendPath:s.routePath,method:s.method},confidence:1}),t++}catch(a){At.debug({source:o.filePath,target:s.filePath,error:a},"Skipped duplicate edge")}return At.info({edgesCreated:t,backendRoutes:r.length,frontendCalls:i.length},"HTTP gap detection scan completed"),t}function $h(n){let e=ix(n);return{httpGaps:e,totalEdges:e}}J();var ox=b.child({module:"fusion-index-service"}),no=class{constructor(e){this.connection=e}executeFederatedQuery(e,...r){return this.connection.prepare(e).all(...r).map(o=>{let{_repo_alias:s,_repo_path:a,...c}=o;return{repo:s,repoPath:a,data:c}})}executeRawQuery(e,...r){return this.connection.prepare(e).all(...r)}buildAdvancedQuery(e){let r=this.connection.getAttachedRepos();if(r.length===0)throw new Error("No repositories attached");let{table:i,tableAlias:t,columns:o,joins:s,where:a,groupBy:c,having:l,orderBy:u,limit:p,offset:d}=e,m=t||i.charAt(0),f=o.join(", "),_=r.map(v=>{let y=`${v.alias}.${i} ${m}`,k="";s&&s.length>0&&(k=s.map(T=>{let P=T.alias||T.table.charAt(0);return`${T.type} JOIN ${v.alias}.${T.table} ${P} ON ${T.on}`}).join(`
|
|
644
|
-
`));let S=a?`WHERE ${a}`:"",$=c&&c.length>0?`GROUP BY ${c.join(", ")}`:"",E=l?`HAVING ${l}`:"";return`SELECT '${v.alias}' as _repo_alias, '${v.repoPath}' as _repo_path, ${f} FROM ${y} ${k} ${S} ${$} ${E}`.trim()}).join(`
|
|
645
|
-
UNION ALL
|
|
646
|
-
`);return u&&(_=`SELECT * FROM (${_}) AS federated_results ORDER BY ${u}`),p!==void 0&&(_+=` LIMIT ${p}`),d!==void 0&&(_+=` OFFSET ${d}`),_}buildFtsQuery(e,r,i,t,o=50){let s=this.connection.getAttachedRepos();if(s.length===0)throw new Error("No repositories attached");let a=i.replace(/"/g,'""'),c=t.map(u=>`c.${u}`).join(", ");return`${s.map(u=>`
|
|
647
|
-
SELECT '${u.alias}' as _repo_alias, '${u.repoPath}' as _repo_path, ${c}, bm25(${u.alias}.${e}) as _fts_rank
|
|
648
|
-
FROM ${u.alias}.${e} fts
|
|
649
|
-
JOIN ${u.alias}.${r} c ON fts.rowid = c.id
|
|
650
|
-
WHERE ${u.alias}.${e} MATCH '"${a}"'`).join(`
|
|
651
|
-
UNION ALL
|
|
652
|
-
`)} ORDER BY _fts_rank LIMIT ${o}`}buildCrossRepoImportsQuery(){let e=this.connection.getAttachedRepos();if(e.length<2)throw new Error("Cross-repo analysis requires at least 2 attached repositories");let r=[];for(let i of e)for(let t of e)i.alias!==t.alias&&r.push(`
|
|
653
|
-
SELECT
|
|
654
|
-
'${i.alias}' as source_repo, '${i.repoPath}' as source_repo_path,
|
|
655
|
-
i.file_path as source_file, i.module_specifier, i.imported_symbols,
|
|
656
|
-
'${t.alias}' as target_repo, '${t.repoPath}' as target_repo_path,
|
|
657
|
-
f.path as target_file
|
|
658
|
-
FROM ${i.alias}.imports i
|
|
659
|
-
JOIN ${t.alias}.files f ON i.resolved_path = f.path
|
|
660
|
-
WHERE i.resolved_path IS NOT NULL`);return r.join(`
|
|
661
|
-
UNION ALL
|
|
662
|
-
`)}buildUnionQuery(e,r,i){let t=this.connection.getAttachedRepos();if(t.length===0)throw new Error("No repositories attached");let o=r.join(", "),s=i?` WHERE ${i}`:"";return t.map(a=>`SELECT '${a.alias}' as _repo_alias, '${a.repoPath}' as _repo_path, ${o} FROM ${a.alias}.${e}${s}`).join(`
|
|
663
|
-
UNION ALL
|
|
664
|
-
`)}searchExports(e,r=50){let i=this.buildUnionQuery("exports",["id","name","kind","file_path","signature"],"name LIKE ?")+` LIMIT ${r*this.connection.getAttachedRepos().length}`,t=Array(this.connection.getAttachedRepos().length).fill(`%${e}%`);return this.executeFederatedQuery(i,...t)}searchFiles(e,r=50){let i=this.buildUnionQuery("files",["path","classification","content_hash"],"path LIKE ?")+` LIMIT ${r*this.connection.getAttachedRepos().length}`,t=Array(this.connection.getAttachedRepos().length).fill(`%${e}%`);return this.executeFederatedQuery(i,...t)}getVirtualEdges(e,r){let i="SELECT * FROM virtual_edges WHERE 1=1",t=[];return e&&(i+=" AND source_repo = ?",t.push(e)),r&&(i+=" AND target_repo = ?",t.push(r)),this.connection.prepare(i).all(...t)}addVirtualEdge(e){return this.connection.prepare(`
|
|
665
|
-
INSERT INTO virtual_edges
|
|
666
|
-
(source_repo, source_file_path, source_symbol_id, target_repo, target_file_path, target_symbol_id, relationship, metadata, confidence, updated_at)
|
|
667
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, unixepoch())
|
|
668
|
-
`).run(e.sourceRepo,e.sourceFilePath,e.sourceSymbolId||null,e.targetRepo,e.targetFilePath,e.targetSymbolId||null,e.relationship,e.metadata?JSON.stringify(e.metadata):null,e.confidence??1).lastInsertRowid}scanEdges(){return ox.info({name:this.connection.nameValue},"Starting edge scan"),$h(this)}getAttachedRepos(){return this.connection.getAttachedRepos()}get name(){return this.connection.nameValue}};var kh=b.child({module:"fused-index"}),ro=class{connection;service;configName;constructor(e){this.configName=e.name,this.connection=new to(e),this.service=new no(this.connection)}attachRepo(e){this.connection.attachRepo(e)}detachRepo(e){this.connection.detachRepo(e)}refreshRepo(e){this.connection.refreshRepo(e)}getAttachedRepos(){return this.connection.getAttachedRepos()}checkHealth(){return this.connection.checkHealth()}close(){this.connection.close(),kh.info({name:this.configName},"Fused index closed")}getStatus(){let e=this.service.executeRawQuery("SELECT COUNT(*) as count FROM virtual_edges");return{name:this.connection.nameValue,path:this.connection.dbPath,attachedRepos:this.connection.getAttachedRepos().length,repos:this.connection.getAttachedRepos(),virtualEdgesCount:e[0]?.count||0}}searchExports(e,r=50){return this.service.searchExports(e,r)}searchFiles(e,r=50){return this.service.searchFiles(e,r)}getVirtualEdges(e,r){return this.service.getVirtualEdges(e,r)}addVirtualEdge(e){return this.service.addVirtualEdge(e)}scanEdges(){return this.service.scanEdges()}buildUnionQuery(e,r,i){return this.service.buildUnionQuery(e,r,i)}executeFederatedQuery(e,...r){return this.service.executeFederatedQuery(e,...r)}executeRawQuery(e,...r){return this.service.executeRawQuery(e,...r)}buildAdvancedQuery(e){return this.service.buildAdvancedQuery(e)}buildFtsQuery(e,r,i,t,o){return this.service.buildFtsQuery(e,r,i,t,o)}buildCrossRepoImportsQuery(){return this.service.buildCrossRepoImportsQuery()}refreshAll(){this.connection.refreshAll()}validateSchemas(){return kh.debug({name:this.configName},"Delegating validateSchemas"),this.connection.validateSchemas()}},Pn=new Map;function bc(n){let e=Pn.get(n.name);if(e){let i=new Set(e.getAttachedRepos().map(s=>s.repoPath)),t=new Set(n.repoPaths.map(s=>sx.resolve(s)));if(i.size===t.size&&[...i].every(s=>t.has(s)))return e;e.close(),Pn.delete(n.name)}let r=new ro(n);return Pn.set(n.name,r),r}function ax(n){let e=Pn.get(n);e&&(e.close(),Pn.delete(n))}function xc(){return Array.from(Pn.keys())}import yt from"path";import Sc from"fs";import cx from"@swc/core";var tn=class{constructor(e){this.repoPath=e}async analyze(e,r={}){let{filePath:i,depth:t=3,limit:o=50,offset:s=0}=r,a=L.getInstance(this.repoPath),c=i?a.exports.findByNameAndFile(e,i):a.exports.findByNameGlobal(e);if(c.length===0)return[];let l=[];for(let u of c){let p=a.imports.findImpactDependents(u.file_path,`%${e}%`,t),d=[],m=new Set;for(let S of p){let $=yt.relative(this.repoPath,S.consumer_path);if(m.has($))continue;let E=`Imports ${S.imported_symbols}`,T=await this.verifySymbolUsage(S.consumer_path,u.name);T?E+=" (\u2705 Verified Call)":E+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",m.add($),d.push({type:"IMPORT",file:$,depth:S.depth,details:E,verified:T})}let f=a.exports.findRoutesByCapability(e);u.kind==="HTTP Route"&&f.push({name:u.name,file_path:u.file_path,signature:u.signature});for(let S of f){let E=S.name.split("/").filter(P=>P.length>3&&!P.includes("{")&&!P.includes("$")&&!P.includes("<")).sort((P,U)=>U.length-P.length)[0];if(!E||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(E.toLowerCase()))continue;let T=a.files.findContentByToken(E,10);for(let P of T){let U=yt.relative(this.repoPath,P);!m.has(U)&&P!==u.file_path&&(m.add(U),d.push({type:"API_USAGE",file:U,depth:2,details:`Likely calls route ${S.name} (matched token '${E}')`,verified:!1}))}}let h=a.files.findContentByToken(e,20);for(let S of h){let $=yt.relative(this.repoPath,S);!m.has($)&&S!==u.file_path&&(m.add($),d.push({type:"POTENTIAL_USAGE",file:$,depth:2,details:`Contains keyword '${e}' (Dynamic/Implicit usage)`,verified:!0}))}u.kind==="HTTP Route"&&await this.addCrossRepoImpact(d,m,u),d.sort((S,$)=>S.verified&&!$.verified?-1:!S.verified&&$.verified?1:S.depth!==$.depth?S.depth-$.depth:S.file.localeCompare($.file));let _=d.length,v=d.slice(s,s+o),y=s+o<_,k=this.calculateRiskScore(u,_,d);l.push({symbol:e,definedIn:yt.relative(this.repoPath,u.file_path),riskScore:k,impact:v,pagination:{total:_,offset:s,limit:o,hasMore:y}})}return l}async verifySymbolUsage(e,r){try{if(!Sc.existsSync(e))return!1;let i=Sc.readFileSync(e,"utf8"),t=yt.extname(e).toLowerCase(),o=new Set;if(t===".ts"||t===".tsx"||t===".js"||t===".jsx"){let s=new In;try{let a=await cx.parse(i,{syntax:"typescript",tsx:e.endsWith(".tsx"),target:"es2020"});s.visitModule(a),o=s.calls}catch{return i.includes(r)}}else{let s=new Ot;s.visit(i,t),o=s.calls}if(o.has(r))return!0;for(let s of o){if(s===r)return!0;let a=s.split(/(?:\.|->|::)+/),c=a[a.length-1],l=r.split(/(?:\.|->|::)+/),u=l[l.length-1];if(c===u)return!0}return!1}catch{return!1}}async addCrossRepoImpact(e,r,i){try{let t=xc();for(let o of t)try{let a=(await import("os")).homedir(),c=yt.join(a,".mcp-liquid-shadow","fused"),l=o.replace(/[^a-zA-Z0-9-_]/g,"_"),u=yt.join(c,`${l}.db`);if(!Sc.existsSync(u))continue;let p=(await import("better-sqlite3")).default,d=new p(u),m=d.prepare("SELECT source_repo, source_file_path, relationship, metadata FROM virtual_edges WHERE target_repo = ? AND target_file_path = ? AND relationship = 'api_call'").all(this.repoPath,i.file_path);d.close();for(let f of m){let h=yt.relative(f.source_repo,f.source_file_path),_=`${f.source_repo}:${h}`;r.has(_)||(r.add(_),e.push({type:"CROSS_REPO_API_CALL",file:_,depth:1,details:`Cross-repo API call from ${yt.basename(f.source_repo)}`,verified:!0}))}}catch{continue}}catch{}}calculateRiskScore(e,r,i){let a=(new re(this.repoPath).getSnapshot().gravity?.hotspots||[]).find(d=>d.filePath===e.file_path&&d.symbol===e.name)?.gravity||0,c=i.filter(d=>d.type==="CROSS_REPO_API_CALL").length,l=a/50+r/15+c*2,u="LOW",p="Peripheral symbol with limited usage.";return l>=8?(u="CRITICAL",p=`Core architectural pillar (Gravity: ${a.toFixed(0)}). Modification will destabilize ${r} dependents.`):l>=4?(u="HIGH",p=`High-gravity symbol with significant blast radius (${r} files).`):l>=1.5&&(u="MEDIUM",p="Standard library symbol with moderate dependency chain."),{score:Math.min(10,Math.round(l*10)/10),level:u,rationale:p}}};X();var io=class n{constructor(e){this.intentLogs=e}static RECENCY_HALF_LIFE_HOURS=48;static WEIGHTS={recency:.4,activity:.3,statusBoost:.2,blockerBoost:.1};score(e){if(e.length===0)return[];let r=Math.floor(Date.now()/1e3),i=e.map(c=>c.id),t=this.intentLogs.countByMissions(i),o=this.intentLogs.findMissionsWithBlockers(i),s=Math.max(1,...Object.values(t));return e.map(c=>{let l=this.computeRecency(c.updated_at,r),u=(t[c.id]||0)/s,p=this.computeStatusBoost(c.status),d=o.has(c.id)?1:0,m=n.WEIGHTS,f=l*m.recency+u*m.activity+p*m.statusBoost+d*m.blockerBoost;return{mission:c,score:Math.round(f*1e3)/1e3,breakdown:{recency:Math.round(l*1e3)/1e3,activity:Math.round(u*1e3)/1e3,blockerBoost:d,statusBoost:p}}}).sort((c,l)=>l.score-c.score)}computeRecency(e,r){let i=Math.max(0,(r-e)/3600);return Math.pow(.5,i/n.RECENCY_HALF_LIFE_HOURS)}computeStatusBoost(e){switch(e){case"in-progress":return 1;case"verifying":return .8;case"planned":return .4;default:return 0}}};X();Oe();J();import{execSync as wh}from"child_process";import lx from"path";var oo=b.child({module:"shadow-trace"}),vt=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=L.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new re(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=wh(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
|
|
669
|
-
`).filter(s=>s.trim()!=="");if(o.length===0)return;oo.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=lx.join(this.repoPath,s),l=wh(`git diff -U0 ${r} -- ${s}`,{cwd:this.repoPath,encoding:"utf-8"}).matchAll(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/g);for(let u of l){let p=parseInt(u[2],10),d=this.exports.findAtLine(a,p);d&&(this.intentLogs.create({mission_id:0,file_path:a,symbol_id:d.id,type:"discovery",content:`Shadow Trace: Modified externally in ${r}`,confidence:.8,symbol_name:d.name,signature:d.signature,commit_sha:null}),oo.debug({symbol:d.name},"Logged ghost change"),i.push({from:"external",to:`${s}:${d.name}`,pattern:"git-delta",confidence:.8}))}}i.length>0&&this.hologramService.updateGhostBridges(i),oo.info("Shadow Trace complete.")}catch(t){oo.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};X();J();var ux=b.child({module:"collision-service"}),so=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=ve(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=L.getInstance(this.repoPath),t=r.findActive().filter(a=>a.git_branch&&a.git_branch!==e),o=[],s=new Set;for(let a of t){let c=a.git_branch;if(s.has(c))continue;s.add(c),ux.info({branch:c,currentBranch:e},"Checking predictive collisions"),sc(this.repoPath,e,c)&&o.push({branch:c,type:"file",description:`Background merge-tree detected a file-level conflict between '${e}' and '${c}'.`});let u=r.findActive(e),p=new Set;for(let f of u)r.getWorkingSet(f.id).forEach(h=>p.add(h.file_path));let m=r.getWorkingSet(a.id).filter(f=>p.has(f.file_path));m.length>0&&o.push({branch:c,type:"intent",description:`Logical conflict: Mission '${a.name}' on '${c}' is modifying files you are currently working on.`,conflictingFiles:m.map(f=>f.file_path)})}return o}};var nn=class{constructor(e){this.repoPath=e}async getBriefing(e={}){let{missionId:r,scope:i="mission",altitude:t,activeMissionsLimit:o,recentActivityLimit:s,compact:a}=e,c=a??(t==="orbit"||t==="atmosphere"),l=s??(t==="orbit"?0:t==="ground"?20:10),{missions:u,intentLogs:p}=L.getInstance(this.repoPath),d=Fe(this.repoPath),m=ve(this.repoPath);return i==="project"?this.getProjectBriefing({altitude:t,activeMissionsLimit:o,recentActivityLimit:l,compact:c,currentBranch:m,currentCommit:d}):this.getMissionBriefing({missionId:r,altitude:t,recentActivityLimit:l,currentBranch:m,currentCommit:d})}async getProjectBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=L.getInstance(r),{altitude:o,activeMissionsLimit:s,recentActivityLimit:a,compact:c,currentBranch:l,currentCommit:u}=e,p=i.findActive(l||void 0),d=p.length;s&&p.length>s&&(p=p.slice(0,s));let m=i.findParentOnlyIds(p),f=new Set(m),h=p.filter(C=>!f.has(C.id)),v=new io(t).score(h),y=.15,k=3,S=c&&v.length>k?v.filter((C,R)=>R<k||C.score>=y):v,$=S.map(C=>C.mission),E=new Map(S.map(C=>[C.mission.id,C.score])),T=C=>({id:C.id,name:C.name,goal:C.goal,status:C.status,relevance:E.get(C.id)});if(o==="orbit")return{scope:"project",altitude:"orbit",counts:i.getStats(),next_work_candidates:$.map(T),meta:{current_branch:l,activeMissionsTotal:d}};let P={},U=[];for(let C of p)C.parent_id!=null?(P[C.parent_id]||(P[C.parent_id]=[]),P[C.parent_id].push(C)):U.push(C);let I=i.findRecentCompleted(5).map(T),O=a>0?t.findRecentDecisionActivity(a):void 0,Z=m.map(C=>{let R=p.find(G=>G.id===C);return{parent:c?{...R,strategy_graph:void 0,verification_context:void 0}:R,children:P[C]??[]}}),B=U.filter(C=>!f.has(C.id));return{scope:"project",altitude:o||"atmosphere",counts:i.getStats(),analytics:i.getAnalytics(),hierarchy:Z.length>0?Z:void 0,standalone_active:B.length>0?B:void 0,active_missions:Z.length===0?c?p.map(C=>({...C,strategy_graph:void 0})):p:void 0,next_work_candidates:$.map(T),recent_completed:I,recent_activity:O,meta:{current_branch:l,current_commit:u,activeMissionsTotal:d,active_limit_applied:!!s,relevance_filtered:S.length<v.length?{shown:S.length,total:v.length}:void 0}}}async getMissionBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=L.getInstance(r),{missionId:o,altitude:s,recentActivityLimit:a,currentBranch:c,currentCommit:l}=e,u;if(o?u=i.findById(o):u=i.findActive(c||void 0)[0],!u)return null;let p=null;try{u.strategy_graph&&(p=JSON.parse(u.strategy_graph))}catch{}if(s==="orbit")return{altitude:"orbit",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString()},strategy_snapshot:p};let d="No external shadow changes detected.";try{new vt(r).analyzeGhostChanges(u.commit_sha||void 0),d="Shadow Trace completed: Checked for external modifications."}catch{}let m={repaired:0,failed:0};try{m=new Se(r).detectAndRepairShifts()}catch{}let f={altitude:s||"atmosphere",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString(),git_branch:u.git_branch,commit_sha:u.commit_sha,outcome_contract:u.outcome_contract},artifacts:i.getArtifacts(u.id),shadow_trace:{ghost_analysis:d,symbols_repaired:m.repaired,symbols_missing:m.failed},context:{current_commit:l,working_set:i.getWorkingSet(u.id).map(h=>h.file_path)},strategy_snapshot:p,recent_activity:s==="ground"?t.findByMission(u.id,a||20):t.findByMissionPreferCrystal(u.id,15),ancestor_activity_summary:[],predictive_collisions:[]};try{let h=new so(r);f.predictive_collisions=await h.analyzePotentialCollisions()}catch{}if(u.parent_id){let h=s==="ground"?t.findByMission(u.parent_id,5):t.findByMissionPreferCrystal(u.parent_id,3);f.ancestor_activity_summary=h.map(_=>({type:_.type,content:_.content,date:new Date(_.created_at*1e3).toISOString()}))}return f}};async function nR(n,e,r={}){await Q(n);let i=new Ae(n),{filters:t,hasFilters:o}=Dt(r);return await i.searchBySymbol(e,r.limit??he.DEFAULT_LIMIT,r.offset??0,t,o,r.matchMode??"any")}async function rR(n,e,r={}){return await Q(n),await new tn(n).analyze(e,r)}async function iR(n){await Q(n);let e=L.getInstance(n),r=De(e,n);return new re(n).updateTopography(r),r}async function oR(n,e={}){await Q(n);let i=new re(n).getSnapshot();if(e.compact&&i.gravity?.hotspots){let t=i.gravity.hotspots.length;i={...i,gravity:{...i.gravity,hotspots:i.gravity.hotspots.slice(0,20),_truncated:t>20,_totalHotspots:t}}}return i}async function sR(n,e={}){return await Q(n),await new nn(n).getBriefing(e)}async function aR(n,e={}){return L.getInstance(n).missions.findAll(e.status)}async function cR(n,e={}){let r=L.getInstance(n);return e.missionId?r.intentLogs.findByMission(e.missionId,e.limit):r.intentLogs.findRecentDecisionActivity(e.limit??50)}async function lR(n){return await Q(n),new re(n).computeGravityZones()}var Eh=[{name:"shadow_recon_onboard",description:"Initial onboarding for a repository. Indexes all files, extracts symbols, and detects services.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_topography",description:"Analyze architectural layers (Entry/Logic/Data/Utility). Returns layer breakdown and architectural insights.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_scout",description:"(Expert) Detect architectural drift, pattern violations, and gravity anomalies.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_tree",description:"Generate hierarchical file tree with file classifications and export summaries.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},subPath:{type:"string",description:"Relative path to focus tree on a specific subdirectory"},maxDepth:{type:"number",description:"Maximum directory depth to traverse"}},required:["repoPath"]}},{name:"shadow_recon_hologram",description:"Get the project hologram (persistent architectural snapshot) and gravity zones.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},compact:{type:"boolean",description:"Omit large arrays (gravity.hotspots) for lighter output"}},required:["repoPath"]}},{name:"shadow_search_concept",description:"Semantic/Vector-based intent search across file purpose and logic.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term or semantic intent"},limit:{type:"number",description:"Max results (default 10)"},offset:{type:"number",description:"Pagination offset"},compact:{type:"boolean",description:"Return compact output (no snippets)"},fileType:{type:"string",description:"Filter by extension(s)"},layer:{type:"string",enum:["Solid","Liquid","Virtual","Intel","Phantom"]},includeTests:{type:"boolean",description:"Include test files (Virtual)"}},required:["repoPath","query"]}},{name:"shadow_search_symbol",description:"Exact and fuzzy code symbol matching (classes, functions, methods).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Symbol name or partial name"},limit:{type:"number",description:"Max results"},offset:{type:"number",description:"Pagination offset"},fileType:{type:"string",description:"Filter by extension(s)"},matchMode:{type:"string",enum:["any","all","exact"],description:"Match mode for multi-word queries: 'any' (OR, default), 'all' (AND), 'exact' (phrase)"}},required:["repoPath","query"]}},{name:"shadow_search_config",description:"Environment and configuration discovery (ENV, Ports, Docker, YAML).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term for values/keys"},key:{type:"string",description:"Specific config key match"},kind:{type:"string",enum:["Service","Image","Port","Env"]},limit:{type:"number"},showUsage:{type:"boolean",description:"Cross-reference with code to show usage counts and identify orphaned vars (defined but never used)"}},required:["repoPath"]}},{name:"shadow_search_path",description:"Filename-keyword resolution using the search index.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Filename part or path keyword"},limit:{type:"number"},ranked:{type:"boolean",description:"Sort results by gravity (high-import files first) and show layer classification (Entry/Logic/Data)"}},required:["repoPath","query"]}},{name:"shadow_analyze_impact",description:"Calculate blast radius and Strategic Risk Scoring of changing a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string",description:"Symbol to analyze"},filePath:{type:"string",description:"Specific file where symbol is defined"},depth:{type:"number",description:"Traversal depth (default 3)"},limit:{type:"number",description:"Max results per symbol (default 50)"},offset:{type:"number",description:"Pagination offset"}},required:["repoPath","symbolName"]}},{name:"shadow_analyze_flow",description:"Execution call-chain tracing (AST-based) for a specific function/method.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string",description:"File to start trace from"},symbolName:{type:"string",description:"Function/method name"}},required:["repoPath","filePath"]}},{name:"shadow_analyze_deps",description:"Direct file import/export mapping and dependency graph inspection.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},direction:{type:"string",enum:["imports","imported_by"]}},required:["repoPath","filePath","direction"]}},{name:"shadow_analyze_debt",description:"Recursive dead-code detection and circular import identification. For dead-code mode: excludes migrations and fixtures by default, returns results with confidence scoring.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},mode:{type:"string",enum:["dead-code","circular-deps"]},limit:{type:"number"},includeTests:{type:"boolean"},excludePatterns:{type:"array",items:{type:"string"},description:"Custom glob patterns to exclude (e.g., '**/migrations/**')"},includeMigrations:{type:"boolean",description:"Include migration files (default: false)"},includeFixtures:{type:"boolean",description:"Include fixture/mock files (default: false)"},confidenceThreshold:{type:"string",enum:["all","high","medium"],description:"Filter by confidence: 'all' (default), 'high' (likely dead), 'medium' (possibly intentional)"}},required:["repoPath","mode"]}}];var Ih=[{name:"shadow_ops_plan",description:"Create a new development mission or strategic initiative with goals and strategy.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},name:{type:"string",description:"Mission name"},goal:{type:"string",description:"Objective and success criteria"},strategy:{type:"string",description:"JSON strategy (steps DAG)"},parentId:{type:"number",description:"ID of parent mission"},outcomeContract:{type:"string",description:"Success verification contract"},templateId:{type:"string",enum:["refactoring","feature","bug-fix"]},templateVars:{type:"object",description:"Template variables"}},required:["repoPath"]}},{name:"shadow_ops_track",description:"Update mission step status, record progress, and track completion.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},stepId:{type:"string"},status:{type:"string",enum:["pending","in-progress","completed","failed","skipped"]},contextPivot:{type:"string",description:"Rationale for status change"},updates:{type:"array",items:{type:"object",properties:{stepId:{type:"string"},status:{type:"string"},contextPivot:{type:"string"}}}}},required:["repoPath","missionId"]}},{name:"shadow_ops_log",description:"Record architectural decisions, discoveries, or blockers to the intent log.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Mission to attach this log to. Optional \u2014 if omitted, auto-resolves to the active mission or logs as standalone."},type:{type:"string",enum:["decision","blocker","discovery","fix"]},content:{type:"string"},filePath:{type:"string",description:"File path to associate with this log"},symbolName:{type:"string",description:"Symbol related to this intent"},standalone:{type:"boolean",description:"If true, log is anchored to symbolName only (no mission). Requires symbolName."}},required:["repoPath","type","content"]}},{name:"shadow_ops_briefing",description:"Active situational awareness - Get details on missions, decisions, and next steps.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Optional specific mission ID"},scope:{type:"string",enum:["mission","project"]},altitude:{type:"string",enum:["orbit","atmosphere","ground"],description:"Zoom level: orbit (~200 tokens, counts+candidates only), atmosphere (strategy+crystals, default), ground (raw logs+working set)"},includeGroupedByParent:{type:"boolean"},activeMissionsLimit:{type:"number",description:"Limit active missions in output"},recentActivityLimit:{type:"number",description:"Limit recent activity logs"},compact:{type:"boolean",description:"Omit strategy_graph JSON for lighter output"}},required:["repoPath"]}},{name:"shadow_ops_synthesize",description:"Distill mission context and logs into an Architectural Decision Record (ADR).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_chronicle",description:"Archive feed of the repository narrative (initiatives and standalones).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},format:{type:"string",enum:["markdown","json"]},limit:{type:"number"},offset:{type:"number"},since:{type:"number"},until:{type:"number"}},required:["repoPath"]}},{name:"shadow_ops_context",description:'Session-start bundle in one call: hologram + chronicle (last 5) + briefing summary (counts, next_work_candidates). Use for "new chat, give me the world" without multiple round-trips.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},compact:{type:"boolean",description:"Return lighter payload (omit full hologram.gravity.hotspots, strategy_graph)"}},required:["repoPath"]}},{name:"shadow_ops_health",description:"System health metrics and intelligence index status.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_ops_crystallize",description:"Compress a mission's intent logs into a single crystal summary. Raw logs are marked as absorbed and replaced by one dense crystal node for token-efficient briefings.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_graph",description:"Visualize mission lineage and dependencies.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},depth:{type:"number"},limit:{type:"number"},format:{type:"string",enum:["mermaid","json"]}},required:["repoPath"]}},{name:"shadow_working_set_check",description:"Checks which files are in active mission working sets to detect parallel editing conflicts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePaths:{type:"array",items:{type:"string"}}},required:["repoPath","filePaths"]}},{name:"shadow_inspect_symbol",description:"Dense code retrieval for a single symbol with semantic folding and usage context.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string"},context:{type:"string",enum:["definition","full"]}},required:["repoPath","symbolName"]}},{name:"shadow_inspect_file",description:"Token-efficient summary of ALL symbols and exports in a file.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},detailLevel:{type:"string",enum:["structure","signatures","summaries","detailed"]}},required:["repoPath","filePath"]}},{name:"shadow_sync_trace",description:"Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},sinceCommit:{type:"string"}},required:["repoPath"]}},{name:"shadow_sync_index",description:"Incremental code re-indexing to reflect latest file changes.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},deep:{type:"boolean",description:"Force full rebuild"}},required:["repoPath"]}},{name:"shadow_sync_repair",description:"NanoRepair only - Heals broken intent links and symbol shifts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_env_hooks",description:"Install and manage Git hooks for automated intelligence maintenance.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},action:{type:"string",enum:["install","remove","status"]},enableAutoRefresh:{type:"boolean"},enableSymbolHealing:{type:"boolean"}},required:["repoPath","action"]}},{name:"shadow_env_diagnose",description:"Missions and intelligence toolset health check.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_workspace_list",description:"Federated view of active missions across multiple repositories.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},status:{type:"string"}},required:["repoPaths"]}},{name:"shadow_workspace_link",description:"Establish intent-level dependencies between missions in different repos.",inputSchema:{type:"object",properties:{parentRepoPath:{type:"string"},parentMissionId:{type:"number"},childRepoPath:{type:"string"},childMissionId:{type:"number"},relationship:{type:"string"}},required:["parentRepoPath","parentMissionId","childRepoPath","childMissionId","relationship"]}},{name:"shadow_workspace_fuse",description:"Create unified cross-repo search indices using SQLite fusion.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},name:{type:"string"}},required:["repoPaths"]}}];var g={};Me(g,{$brand:()=>ao,$input:()=>Zu,$output:()=>Fu,NEVER:()=>$c,TimePrecision:()=>Ju,ZodAny:()=>Ad,ZodArray:()=>Md,ZodBase64:()=>As,ZodBase64URL:()=>Ls,ZodBigInt:()=>or,ZodBigIntFormat:()=>Ms,ZodBoolean:()=>ir,ZodCIDRv4:()=>Ds,ZodCIDRv6:()=>Os,ZodCUID:()=>Es,ZodCUID2:()=>Is,ZodCatch:()=>am,ZodCodec:()=>Gs,ZodCustom:()=>si,ZodCustomStringFormat:()=>nr,ZodDate:()=>ti,ZodDefault:()=>tm,ZodDiscriminatedUnion:()=>Fd,ZodE164:()=>Cs,ZodEmail:()=>$s,ZodEmoji:()=>ks,ZodEnum:()=>er,ZodError:()=>j$,ZodExactOptional:()=>Xd,ZodFile:()=>Kd,ZodFirstPartyTypeKind:()=>_m,ZodFunction:()=>gm,ZodGUID:()=>Kr,ZodIPv4:()=>Ns,ZodIPv6:()=>zs,ZodISODate:()=>ys,ZodISODateTime:()=>gs,ZodISODuration:()=>_s,ZodISOTime:()=>vs,ZodIntersection:()=>Zd,ZodIssueCode:()=>U$,ZodJWT:()=>js,ZodKSUID:()=>Rs,ZodLazy:()=>mm,ZodLiteral:()=>qd,ZodMAC:()=>Td,ZodMap:()=>Gd,ZodNaN:()=>lm,ZodNanoID:()=>ws,ZodNever:()=>Cd,ZodNonOptional:()=>Bs,ZodNull:()=>Dd,ZodNullable:()=>em,ZodNumber:()=>rr,ZodNumberFormat:()=>pn,ZodObject:()=>ri,ZodOptional:()=>Ws,ZodPipe:()=>Js,ZodPrefault:()=>rm,ZodPromise:()=>hm,ZodReadonly:()=>um,ZodRealError:()=>Ne,ZodRecord:()=>oi,ZodSet:()=>Vd,ZodString:()=>tr,ZodStringFormat:()=>oe,ZodSuccess:()=>sm,ZodSymbol:()=>Nd,ZodTemplateLiteral:()=>dm,ZodTransform:()=>Yd,ZodTuple:()=>Wd,ZodType:()=>Y,ZodULID:()=>Ts,ZodURL:()=>ei,ZodUUID:()=>ct,ZodUndefined:()=>zd,ZodUnion:()=>ii,ZodUnknown:()=>Ld,ZodVoid:()=>jd,ZodXID:()=>Ps,ZodXor:()=>Ud,_ZodString:()=>Ss,_default:()=>nm,_function:()=>sv,any:()=>jy,array:()=>ni,base64:()=>xy,base64url:()=>Sy,bigint:()=>Dy,boolean:()=>Rd,catch:()=>cm,check:()=>av,cidrv4:()=>_y,cidrv6:()=>by,clone:()=>$e,codec:()=>rv,coerce:()=>bm,config:()=>me,core:()=>xt,cuid:()=>py,cuid2:()=>dy,custom:()=>cv,date:()=>Uy,decode:()=>xd,decodeAsync:()=>$d,describe:()=>lv,discriminatedUnion:()=>Jy,e164:()=>$y,email:()=>ty,emoji:()=>ly,encode:()=>bd,encodeAsync:()=>Sd,endsWith:()=>Wn,enum:()=>Zs,exactOptional:()=>Qd,file:()=>Qy,flattenError:()=>Cr,float32:()=>Py,float64:()=>Ry,formatError:()=>jr,fromJSONSchema:()=>gv,function:()=>sv,getErrorMap:()=>Z$,globalRegistry:()=>_e,gt:()=>st,gte:()=>ke,guid:()=>ny,hash:()=>Ty,hex:()=>Iy,hostname:()=>Ey,httpUrl:()=>cy,includes:()=>Zn,instanceof:()=>pv,int:()=>xs,int32:()=>Ny,int64:()=>Oy,intersection:()=>Hd,ipv4:()=>gy,ipv6:()=>vy,iso:()=>Qn,json:()=>mv,jwt:()=>ky,keyof:()=>Fy,ksuid:()=>hy,lazy:()=>fm,length:()=>ln,literal:()=>Xy,locales:()=>Jr,looseObject:()=>Wy,looseRecord:()=>Vy,lowercase:()=>Un,lt:()=>ot,lte:()=>Ce,mac:()=>yy,map:()=>qy,maxLength:()=>cn,maxSize:()=>Zt,meta:()=>uv,mime:()=>Bn,minLength:()=>bt,minSize:()=>at,multipleOf:()=>Ft,nan:()=>nv,nanoid:()=>uy,nativeEnum:()=>Yy,negative:()=>ss,never:()=>Us,nonnegative:()=>cs,nonoptional:()=>om,nonpositive:()=>as,normalize:()=>Jn,null:()=>Od,nullable:()=>Xr,nullish:()=>ev,number:()=>Pd,object:()=>Zy,optional:()=>Yr,overwrite:()=>Qe,parse:()=>gd,parseAsync:()=>yd,partialRecord:()=>Gy,pipe:()=>Qr,positive:()=>os,prefault:()=>im,preprocess:()=>fv,prettifyError:()=>Ac,promise:()=>ov,property:()=>ls,readonly:()=>pm,record:()=>Jd,refine:()=>ym,regex:()=>Mn,regexes:()=>He,registry:()=>jo,safeDecode:()=>wd,safeDecodeAsync:()=>Id,safeEncode:()=>kd,safeEncodeAsync:()=>Ed,safeParse:()=>vd,safeParseAsync:()=>_d,set:()=>Ky,setErrorMap:()=>F$,size:()=>an,slugify:()=>Kn,startsWith:()=>Hn,strictObject:()=>Hy,string:()=>bs,stringFormat:()=>wy,stringbool:()=>dv,success:()=>tv,superRefine:()=>vm,symbol:()=>Ly,templateLiteral:()=>iv,toJSONSchema:()=>ms,toLowerCase:()=>Vn,toUpperCase:()=>qn,transform:()=>Hs,treeifyError:()=>Oc,trim:()=>Gn,tuple:()=>Bd,uint32:()=>zy,uint64:()=>Ay,ulid:()=>my,undefined:()=>Cy,union:()=>Fs,unknown:()=>un,uppercase:()=>Fn,url:()=>ay,util:()=>D,uuid:()=>ry,uuidv4:()=>iy,uuidv6:()=>oy,uuidv7:()=>sy,void:()=>My,xid:()=>fy,xor:()=>By});var xt={};Me(xt,{$ZodAny:()=>lu,$ZodArray:()=>fu,$ZodAsyncError:()=>Xe,$ZodBase64:()=>Ql,$ZodBase64URL:()=>eu,$ZodBigInt:()=>No,$ZodBigIntFormat:()=>ou,$ZodBoolean:()=>Zr,$ZodCIDRv4:()=>Kl,$ZodCIDRv6:()=>Yl,$ZodCUID:()=>jl,$ZodCUID2:()=>Ml,$ZodCatch:()=>zu,$ZodCheck:()=>se,$ZodCheckBigIntFormat:()=>fl,$ZodCheckEndsWith:()=>El,$ZodCheckGreaterThan:()=>ko,$ZodCheckIncludes:()=>kl,$ZodCheckLengthEquals:()=>bl,$ZodCheckLessThan:()=>$o,$ZodCheckLowerCase:()=>Sl,$ZodCheckMaxLength:()=>vl,$ZodCheckMaxSize:()=>hl,$ZodCheckMimeType:()=>Tl,$ZodCheckMinLength:()=>_l,$ZodCheckMinSize:()=>gl,$ZodCheckMultipleOf:()=>dl,$ZodCheckNumberFormat:()=>ml,$ZodCheckOverwrite:()=>Pl,$ZodCheckProperty:()=>Il,$ZodCheckRegex:()=>xl,$ZodCheckSizeEquals:()=>yl,$ZodCheckStartsWith:()=>wl,$ZodCheckStringFormat:()=>Cn,$ZodCheckUpperCase:()=>$l,$ZodCodec:()=>Wr,$ZodCustom:()=>Uu,$ZodCustomStringFormat:()=>ru,$ZodDate:()=>mu,$ZodDefault:()=>Tu,$ZodDiscriminatedUnion:()=>yu,$ZodE164:()=>tu,$ZodEmail:()=>Ol,$ZodEmoji:()=>Ll,$ZodEncodeError:()=>Lt,$ZodEnum:()=>Su,$ZodError:()=>Lr,$ZodExactOptional:()=>Eu,$ZodFile:()=>ku,$ZodFunction:()=>Cu,$ZodGUID:()=>zl,$ZodIPv4:()=>Gl,$ZodIPv6:()=>Vl,$ZodISODate:()=>Wl,$ZodISODateTime:()=>Hl,$ZodISODuration:()=>Jl,$ZodISOTime:()=>Bl,$ZodIntersection:()=>vu,$ZodJWT:()=>nu,$ZodKSUID:()=>Zl,$ZodLazy:()=>Mu,$ZodLiteral:()=>$u,$ZodMAC:()=>ql,$ZodMap:()=>bu,$ZodNaN:()=>Du,$ZodNanoID:()=>Cl,$ZodNever:()=>pu,$ZodNonOptional:()=>Ru,$ZodNull:()=>cu,$ZodNullable:()=>Iu,$ZodNumber:()=>Ro,$ZodNumberFormat:()=>iu,$ZodObject:()=>eg,$ZodObjectJIT:()=>hu,$ZodOptional:()=>Do,$ZodPipe:()=>Ou,$ZodPrefault:()=>Pu,$ZodPromise:()=>ju,$ZodReadonly:()=>Au,$ZodRealError:()=>Re,$ZodRecord:()=>_u,$ZodRegistry:()=>Co,$ZodSet:()=>xu,$ZodString:()=>sn,$ZodStringFormat:()=>ie,$ZodSuccess:()=>Nu,$ZodSymbol:()=>su,$ZodTemplateLiteral:()=>Lu,$ZodTransform:()=>wu,$ZodTuple:()=>zo,$ZodType:()=>K,$ZodULID:()=>Ul,$ZodURL:()=>Al,$ZodUUID:()=>Dl,$ZodUndefined:()=>au,$ZodUnion:()=>Hr,$ZodUnknown:()=>uu,$ZodVoid:()=>du,$ZodXID:()=>Fl,$ZodXor:()=>gu,$brand:()=>ao,$constructor:()=>x,$input:()=>Zu,$output:()=>Fu,Doc:()=>Fr,JSONSchema:()=>Qg,JSONSchemaGenerator:()=>fs,NEVER:()=>$c,TimePrecision:()=>Ju,_any:()=>mp,_array:()=>bp,_base64:()=>ts,_base64url:()=>ns,_bigint:()=>sp,_boolean:()=>ip,_catch:()=>R$,_check:()=>Xg,_cidrv4:()=>Qo,_cidrv6:()=>es,_coercedBigint:()=>ap,_coercedBoolean:()=>op,_coercedDate:()=>vp,_coercedNumber:()=>Xu,_coercedString:()=>Wu,_cuid:()=>Jo,_cuid2:()=>Go,_custom:()=>Sp,_date:()=>yp,_decode:()=>fo,_decodeAsync:()=>go,_default:()=>I$,_discriminatedUnion:()=>h$,_e164:()=>rs,_email:()=>Mo,_emoji:()=>Wo,_encode:()=>mo,_encodeAsync:()=>ho,_endsWith:()=>Wn,_enum:()=>x$,_file:()=>xp,_float32:()=>ep,_float64:()=>tp,_gt:()=>st,_gte:()=>ke,_guid:()=>Gr,_includes:()=>Zn,_int:()=>Qu,_int32:()=>np,_int64:()=>cp,_intersection:()=>g$,_ipv4:()=>Yo,_ipv6:()=>Xo,_isoDate:()=>Vu,_isoDateTime:()=>Gu,_isoDuration:()=>Ku,_isoTime:()=>qu,_jwt:()=>is,_ksuid:()=>Ko,_lazy:()=>O$,_length:()=>ln,_literal:()=>$$,_lowercase:()=>Un,_lt:()=>ot,_lte:()=>Ce,_mac:()=>Bu,_map:()=>_$,_max:()=>Ce,_maxLength:()=>cn,_maxSize:()=>Zt,_mime:()=>Bn,_min:()=>ke,_minLength:()=>bt,_minSize:()=>at,_multipleOf:()=>Ft,_nan:()=>_p,_nanoid:()=>Bo,_nativeEnum:()=>S$,_negative:()=>ss,_never:()=>hp,_nonnegative:()=>cs,_nonoptional:()=>T$,_nonpositive:()=>as,_normalize:()=>Jn,_null:()=>dp,_nullable:()=>E$,_number:()=>Yu,_optional:()=>w$,_overwrite:()=>Qe,_parse:()=>Dn,_parseAsync:()=>On,_pipe:()=>N$,_positive:()=>os,_promise:()=>A$,_property:()=>ls,_readonly:()=>z$,_record:()=>v$,_refine:()=>$p,_regex:()=>Mn,_safeDecode:()=>vo,_safeDecodeAsync:()=>bo,_safeEncode:()=>yo,_safeEncodeAsync:()=>_o,_safeParse:()=>An,_safeParseAsync:()=>Ln,_set:()=>b$,_size:()=>an,_slugify:()=>Kn,_startsWith:()=>Hn,_string:()=>Hu,_stringFormat:()=>Yn,_stringbool:()=>Ip,_success:()=>P$,_superRefine:()=>kp,_symbol:()=>up,_templateLiteral:()=>D$,_toLowerCase:()=>Vn,_toUpperCase:()=>qn,_transform:()=>k$,_trim:()=>Gn,_tuple:()=>y$,_uint32:()=>rp,_uint64:()=>lp,_ulid:()=>Vo,_undefined:()=>pp,_union:()=>m$,_unknown:()=>fp,_uppercase:()=>Fn,_url:()=>Vr,_uuid:()=>Uo,_uuidv4:()=>Fo,_uuidv6:()=>Zo,_uuidv7:()=>Ho,_void:()=>gp,_xid:()=>qo,_xor:()=>f$,clone:()=>$e,config:()=>me,createStandardJSONSchemaMethod:()=>Xn,createToJSONSchemaMethod:()=>Tp,decode:()=>jx,decodeAsync:()=>Ux,describe:()=>wp,encode:()=>Cx,encodeAsync:()=>Mx,extractDefs:()=>Wt,finalize:()=>Bt,flattenError:()=>Cr,formatError:()=>jr,globalConfig:()=>Pr,globalRegistry:()=>_e,initializeContext:()=>Ht,isValidBase64:()=>Xl,isValidBase64URL:()=>Kh,isValidJWT:()=>Yh,locales:()=>Jr,meta:()=>Ep,parse:()=>uo,parseAsync:()=>po,prettifyError:()=>Ac,process:()=>ne,regexes:()=>He,registry:()=>jo,safeDecode:()=>Zx,safeDecodeAsync:()=>Wx,safeEncode:()=>Fx,safeEncodeAsync:()=>Hx,safeParse:()=>Lc,safeParseAsync:()=>Cc,toDotPath:()=>zh,toJSONSchema:()=>ms,treeifyError:()=>Oc,util:()=>D,version:()=>Rl});var $c=Object.freeze({status:"aborted"});function x(n,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),e(a,c);let l=s.prototype,u=Object.keys(l);for(let p=0;p<u.length;p++){let d=u[p];d in a||(a[d]=l[d].bind(a))}}let t=r?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:n});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}var ao=Symbol("zod_brand"),Xe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Lt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Pr={};function me(n){return n&&Object.assign(Pr,n),Pr}var D={};Me(D,{BIGINT_FORMAT_RANGES:()=>Dc,Class:()=>wc,NUMBER_FORMAT_RANGES:()=>zc,aborted:()=>Ut,allowsEval:()=>Tc,assert:()=>hx,assertEqual:()=>px,assertIs:()=>mx,assertNever:()=>fx,assertNotEqual:()=>dx,assignProp:()=>jt,base64ToUint8Array:()=>Ph,base64urlToUint8Array:()=>zx,cached:()=>Nn,captureStackTrace:()=>lo,cleanEnum:()=>Nx,cleanRegex:()=>zr,clone:()=>$e,cloneDef:()=>yx,createTransparentProxy:()=>$x,defineLazy:()=>ee,esc:()=>co,escapeRegex:()=>Ze,extend:()=>Ex,finalizeIssue:()=>Pe,floatSafeRemainder:()=>Ec,getElementAtPath:()=>vx,getEnumValues:()=>Nr,getLengthableOrigin:()=>Ar,getParsedType:()=>Sx,getSizableOrigin:()=>Or,hexToUint8Array:()=>Ox,isObject:()=>rn,isPlainObject:()=>Mt,issue:()=>zn,joinValues:()=>w,jsonStringifyReplacer:()=>Rn,merge:()=>Tx,mergeDefs:()=>_t,normalizeParams:()=>A,nullish:()=>Ct,numKeys:()=>xx,objectClone:()=>gx,omit:()=>wx,optionalKeys:()=>Nc,parsedType:()=>z,partial:()=>Px,pick:()=>kx,prefixIssues:()=>Le,primitiveTypes:()=>Rc,promiseAllObject:()=>_x,propertyKeyTypes:()=>Dr,randomString:()=>bx,required:()=>Rx,safeExtend:()=>Ix,shallowClone:()=>Pc,slugify:()=>Ic,stringifyPrimitive:()=>N,uint8ArrayToBase64:()=>Rh,uint8ArrayToBase64url:()=>Dx,uint8ArrayToHex:()=>Ax,unwrapMessage:()=>Rr});function px(n){return n}function dx(n){return n}function mx(n){}function fx(n){throw new Error("Unexpected value in exhaustive check")}function hx(n){}function Nr(n){let e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,t])=>e.indexOf(+i)===-1).map(([i,t])=>t)}function w(n,e="|"){return n.map(r=>N(r)).join(e)}function Rn(n,e){return typeof e=="bigint"?e.toString():e}function Nn(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ct(n){return n==null}function zr(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function Ec(n,e){let r=(n.toString().split(".")[1]||"").length,i=e.toString(),t=(i.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c?.[1]&&(t=Number.parseInt(c[1]))}let o=r>t?r:t,s=Number.parseInt(n.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var Th=Symbol("evaluating");function ee(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==Th)return i===void 0&&(i=Th,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function gx(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function jt(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function _t(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function yx(n){return _t(n._zod.def)}function vx(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function _x(n){let e=Object.keys(n),r=e.map(i=>n[i]);return Promise.all(r).then(i=>{let t={};for(let o=0;o<e.length;o++)t[e[o]]=i[o];return t})}function bx(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function co(n){return JSON.stringify(n)}function Ic(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var lo="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function rn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var Tc=Nn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function Mt(n){if(rn(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(rn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Pc(n){return Mt(n)?{...n}:Array.isArray(n)?[...n]:n}function xx(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var Sx=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Dr=new Set(["string","number","symbol"]),Rc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ze(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $e(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function A(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function $x(n){let e;return new Proxy({},{get(r,i,t){return e??(e=n()),Reflect.get(e,i,t)},set(r,i,t,o){return e??(e=n()),Reflect.set(e,i,t,o)},has(r,i){return e??(e=n()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=n()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,t){return e??(e=n()),Reflect.defineProperty(e,i,t)}})}function N(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function Nc(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var zc={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]},Dc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function kx(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=_t(n._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return jt(this,"shape",s),s},checks:[]});return $e(n,o)}function wx(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=_t(n._zod.def,{get shape(){let s={...n._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return jt(this,"shape",s),s},checks:[]});return $e(n,o)}function Ex(n,e){if(!Mt(e))throw new Error("Invalid input to extend: expected a plain object");let r=n._zod.def.checks;if(r&&r.length>0){let o=n._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=_t(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return jt(this,"shape",o),o}});return $e(n,t)}function Ix(n,e){if(!Mt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=_t(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return jt(this,"shape",i),i}});return $e(n,r)}function Tx(n,e){let r=_t(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return jt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return $e(n,r)}function Px(n,e,r){let t=e._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=_t(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=n?new n({type:"optional",innerType:a[l]}):a[l])}else for(let l in a)c[l]=n?new n({type:"optional",innerType:a[l]}):a[l];return jt(this,"shape",c),c},checks:[]});return $e(e,s)}function Rx(n,e,r){let i=_t(e._zod.def,{get shape(){let t=e._zod.def.shape,o={...t};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new n({type:"nonoptional",innerType:t[s]}))}else for(let s in t)o[s]=new n({type:"nonoptional",innerType:t[s]});return jt(this,"shape",o),o}});return $e(e,i)}function Ut(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function Le(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function Rr(n){return typeof n=="string"?n:n?.message}function Pe(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=Rr(n.inst?._zod.def?.error?.(n))??Rr(e?.error?.(n))??Rr(r.customError?.(n))??Rr(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Or(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function Ar(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function z(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function zn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function Nx(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Ph(n){let e=atob(n),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function Rh(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function zx(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Ph(e+r)}function Dx(n){return Rh(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ox(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function Ax(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var wc=class{constructor(...e){}};var Nh=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,Rn,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Lr=x("$ZodError",Nh),Re=x("$ZodError",Nh,{Parent:Error});function Cr(n,e=r=>r.message){let r={},i=[];for(let t of n.issues)t.path.length>0?(r[t.path[0]]=r[t.path[0]]||[],r[t.path[0]].push(e(t))):i.push(e(t));return{formErrors:i,fieldErrors:r}}function jr(n,e=r=>r.message){let r={_errors:[]},i=t=>{for(let o of t.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return i(n),r}function Oc(n,e=r=>r.message){let r={errors:[]},i=(t,o=[])=>{var s,a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,p=0;for(;p<l.length;){let d=l[p],m=p===l.length-1;typeof d=="string"?(u.properties??(u.properties={}),(s=u.properties)[d]??(s[d]={errors:[]}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(e(c)),p++}}};return i(n),r}function zh(n){let e=[],r=n.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Ac(n){let e=[],r=[...n.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${zh(i.path)}`);return e.join(`
|
|
670
|
-
`)}var Dn=n=>(e,r,i,t)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Xe;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>Pe(c,o,me())));throw lo(a,t?.callee),a}return s.value},uo=Dn(Re),On=n=>async(e,r,i,t)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>Pe(c,o,me())));throw lo(a,t?.callee),a}return s.value},po=On(Re),An=n=>(e,r,i)=>{let t=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},t);if(o instanceof Promise)throw new Xe;return o.issues.length?{success:!1,error:new(n??Lr)(o.issues.map(s=>Pe(s,t,me())))}:{success:!0,data:o.value}},Lc=An(Re),Ln=n=>async(e,r,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>Pe(s,t,me())))}:{success:!0,data:o.value}},Cc=Ln(Re),mo=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Dn(n)(e,r,t)},Cx=mo(Re),fo=n=>(e,r,i)=>Dn(n)(e,r,i),jx=fo(Re),ho=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return On(n)(e,r,t)},Mx=ho(Re),go=n=>async(e,r,i)=>On(n)(e,r,i),Ux=go(Re),yo=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return An(n)(e,r,t)},Fx=yo(Re),vo=n=>(e,r,i)=>An(n)(e,r,i),Zx=vo(Re),_o=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ln(n)(e,r,t)},Hx=_o(Re),bo=n=>async(e,r,i)=>Ln(n)(e,r,i),Wx=bo(Re);var He={};Me(He,{base64:()=>Qc,base64url:()=>xo,bigint:()=>ol,boolean:()=>al,browserEmail:()=>Xx,cidrv4:()=>Yc,cidrv6:()=>Xc,cuid:()=>jc,cuid2:()=>Mc,date:()=>tl,datetime:()=>rl,domain:()=>tS,duration:()=>Wc,e164:()=>el,email:()=>Jc,emoji:()=>Gc,extendedDuration:()=>Bx,guid:()=>Bc,hex:()=>nS,hostname:()=>eS,html5Email:()=>qx,idnEmail:()=>Yx,integer:()=>sl,ipv4:()=>Vc,ipv6:()=>qc,ksuid:()=>Zc,lowercase:()=>ul,mac:()=>Kc,md5_base64:()=>iS,md5_base64url:()=>oS,md5_hex:()=>rS,nanoid:()=>Hc,null:()=>cl,number:()=>So,rfc5322Email:()=>Kx,sha1_base64:()=>aS,sha1_base64url:()=>cS,sha1_hex:()=>sS,sha256_base64:()=>uS,sha256_base64url:()=>pS,sha256_hex:()=>lS,sha384_base64:()=>mS,sha384_base64url:()=>fS,sha384_hex:()=>dS,sha512_base64:()=>gS,sha512_base64url:()=>yS,sha512_hex:()=>hS,string:()=>il,time:()=>nl,ulid:()=>Uc,undefined:()=>ll,unicodeEmail:()=>Dh,uppercase:()=>pl,uuid:()=>on,uuid4:()=>Jx,uuid6:()=>Gx,uuid7:()=>Vx,xid:()=>Fc});var jc=/^[cC][^\s-]{8,}$/,Mc=/^[0-9a-z]+$/,Uc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fc=/^[0-9a-vA-V]{20}$/,Zc=/^[A-Za-z0-9]{27}$/,Hc=/^[a-zA-Z0-9_-]{21}$/,Wc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bx=/^[-+]?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)?)??$/,Bc=/^([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})$/,on=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,Jx=on(4),Gx=on(6),Vx=on(7),Jc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qx=/^[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])?)*$/,Kx=/^(([^<>()\[\]\\.,;:\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,}))$/,Dh=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Yx=Dh,Xx=/^[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])?)*$/,Qx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Gc(){return new RegExp(Qx,"u")}var Vc=/^(?:(?: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])$/,qc=/^(([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}|:))$/,Kc=n=>{let e=Ze(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Yc=/^((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])$/,Xc=/^(([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])$/,Qc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xo=/^[A-Za-z0-9_-]*$/,eS=/^(?=.{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])?)*\.?$/,tS=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,el=/^\+[1-9]\d{6,14}$/,Oh="(?:(?:\\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])))",tl=new RegExp(`^${Oh}$`);function Ah(n){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nl(n){return new RegExp(`^${Ah(n)}$`)}function rl(n){let e=Ah({precision:n.precision}),r=["Z"];n.local&&r.push(""),n.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${Oh}T(?:${i})$`)}var il=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},ol=/^-?\d+n?$/,sl=/^-?\d+$/,So=/^-?\d+(?:\.\d+)?$/,al=/^(?:true|false)$/i,cl=/^null$/i;var ll=/^undefined$/i;var ul=/^[^A-Z]*$/,pl=/^[^a-z]*$/,nS=/^[0-9a-fA-F]*$/;function Mr(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function Ur(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var rS=/^[0-9a-fA-F]{32}$/,iS=Mr(22,"=="),oS=Ur(22),sS=/^[0-9a-fA-F]{40}$/,aS=Mr(27,"="),cS=Ur(27),lS=/^[0-9a-fA-F]{64}$/,uS=Mr(43,"="),pS=Ur(43),dS=/^[0-9a-fA-F]{96}$/,mS=Mr(64,""),fS=Ur(64),hS=/^[0-9a-fA-F]{128}$/,gS=Mr(86,"=="),yS=Ur(86);var se=x("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),Ch={number:"number",bigint:"bigint",object:"date"},$o=x("$ZodCheckLessThan",(n,e)=>{se.init(n,e);let r=Ch[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?t.maximum=e.value:t.exclusiveMaximum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),ko=x("$ZodCheckGreaterThan",(n,e)=>{se.init(n,e);let r=Ch[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?t.minimum=e.value:t.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),dl=x("$ZodCheckMultipleOf",(n,e)=>{se.init(n,e),n._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Ec(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:n,continue:!e.abort})}}),ml=x("$ZodCheckNumberFormat",(n,e)=>{se.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=zc[e.format];n._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=t,a.maximum=o,r&&(a.pattern=sl)}),n._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:n});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}a<t&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:t,inclusive:!0,inst:n,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),fl=x("$ZodCheckBigIntFormat",(n,e)=>{se.init(n,e);let[r,i]=Dc[e.format];n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),n._zod.check=t=>{let o=t.value;o<r&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!e.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:n,continue:!e.abort})}}),hl=x("$ZodCheckMaxSize",(n,e)=>{var r;se.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Ct(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;t.size<=e.maximum||i.issues.push({origin:Or(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),gl=x("$ZodCheckMinSize",(n,e)=>{var r;se.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Ct(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;t.size>=e.minimum||i.issues.push({origin:Or(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),yl=x("$ZodCheckSizeEquals",(n,e)=>{var r;se.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Ct(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.size,t.maximum=e.size,t.size=e.size}),n._zod.check=i=>{let t=i.value,o=t.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:Or(t),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),vl=x("$ZodCheckMaxLength",(n,e)=>{var r;se.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Ct(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;if(t.length<=e.maximum)return;let s=Ar(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),_l=x("$ZodCheckMinLength",(n,e)=>{var r;se.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Ct(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;if(t.length>=e.minimum)return;let s=Ar(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),bl=x("$ZodCheckLengthEquals",(n,e)=>{var r;se.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Ct(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),n._zod.check=i=>{let t=i.value,o=t.length;if(o===e.length)return;let s=Ar(t),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),Cn=x("$ZodCheckStringFormat",(n,e)=>{var r,i;se.init(n,e),n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=n._zod).check??(r.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:e.format,input:t.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),xl=x("$ZodCheckRegex",(n,e)=>{Cn.init(n,e),n._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),Sl=x("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=ul),Cn.init(n,e)}),$l=x("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=pl),Cn.init(n,e)}),kl=x("$ZodCheckIncludes",(n,e)=>{se.init(n,e);let r=Ze(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,n._zod.onattach.push(t=>{let o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=t=>{t.value.includes(e.includes,e.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:t.value,inst:n,continue:!e.abort})}}),wl=x("$ZodCheckStartsWith",(n,e)=>{se.init(n,e);let r=new RegExp(`^${Ze(e.prefix)}.*`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),El=x("$ZodCheckEndsWith",(n,e)=>{se.init(n,e);let r=new RegExp(`.*${Ze(e.suffix)}$`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}});function Lh(n,e,r){n.issues.length&&e.issues.push(...Le(r,n.issues))}var Il=x("$ZodCheckProperty",(n,e)=>{se.init(n,e),n._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Lh(t,r,e.property));Lh(i,r,e.property)}}),Tl=x("$ZodCheckMimeType",(n,e)=>{se.init(n,e);let r=new Set(e.mime);n._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),n._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:n,continue:!e.abort})}}),Pl=x("$ZodCheckOverwrite",(n,e)=>{se.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var Fr=class{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 i=e.split(`
|
|
768
|
+
`),A}).join(`
|
|
769
|
+
`)}]}}async findConceptMatches(e,r,i,t,o,s=0){let a=ge(this.repoPath)||void 0,l=new vn(this.repoPath).getScorer(),p=new Kr(this.repoPath).getAncestorMissionIds(),d=this.filesRepo.getGravityMap(p,a),m=Gt.extractKeywords(e),f=m.length>=3,h=this.extractOrderedConceptTerms(e),v=this.buildNgrams(h,2,3),y=this.classifyConceptQuery(e,m),b=f?this.collectConceptSymbolHintPaths(m,Math.max(o*10,100)):new Set,_=Math.min(Math.max((o+s)*y.channelMultiplier,Ne.FILTERED_QUERY_LIMIT_MULTIPLIER*20),de.MAX_LIMIT),x=Math.min(Math.max(_*4,200),4e3),[k,I,N]=await Promise.all([Promise.resolve(r?this.filesRepo.findWithEmbeddings():[]),Promise.resolve(this.filesRepo.findContentFts(e,_)),Promise.resolve(r?this.exportsRepo.findWithEmbeddings(x):[])]),L=[];if(r){for(let P of k)try{let E=JSON.parse(P.embedding),G=Br(r,E);L.push({row:P,similarity:G,vectorRank:0})}catch{}L.sort((P,E)=>E.similarity-P.similarity);for(let P=0;P<L.length;P++)L[P].vectorRank=P+1}let C=[];if(r){for(let P of N)if(P.embedding)try{let E=JSON.parse(P.embedding),G=Br(r,E);if(G<=0)continue;C.push({row:P,similarity:G,symbolVectorRank:0})}catch{}C.sort((P,E)=>E.similarity-P.similarity);for(let P=0;P<C.length;P++)C[P].symbolVectorRank=P+1}let S=new Map;for(let P of k)S.set(P.path,P);for(let P of I)S.has(P.path)||S.set(P.path,P);let R=new Map,A=[],H=new Set;for(let P of C.slice(0,x)){let E=P.row.file_path,G=R.get(E);if((!G||P.similarity>G.similarity)&&R.set(E,{similarity:P.similarity,symbolRank:P.symbolVectorRank,symbolName:P.row.name}),H.has(E))continue;let Y=S.get(E);Y||(Y=this.filesRepo.findByPath(E),Y&&S.set(E,Y)),Y&&(A.push({path:E,rank:P.symbolVectorRank,score:P.similarity,row:Y,symbolName:P.row.name}),H.add(E))}let W=this.rrfMerge(L.slice(0,_).map(P=>({path:P.row.path,rank:P.vectorRank,score:P.similarity,row:P.row})),I.slice(0,_).map((P,E)=>({path:P.path,rank:E+1,bm25Rank:P.bm25_rank,row:P})),y.rrfK,{vectorWeight:y.vectorWeight,ftsWeight:y.ftsWeight,symbolWeight:y.symbolWeight,symbolResults:A.slice(0,_)});if(W.length===0)return[];let O=new Map;for(let P of L)O.set(P.row.path,P.similarity);let K=Math.min(W.length,Math.max(o*y.lexicalWindowMultiplier,40)),D=new Set(W.slice(0,K).map(P=>P.path)),M=[],V=new Map;for(let P of W){let E=P.row,G=O.get(E.path)||0,Y=R.get(E.path),re=Y?.similarity||0,B=Math.max(G,re),X=P.ftsRank!==null,me=P.symbolVectorRank!==null||!!Y,Se=P.vectorRank!==null||me,Ie=b.has(E.path),$e=D.has(E.path)||X||Ie||me;if(!$e&&P.fusedScore<y.earlyRejectThreshold&&B<.18&&!t)continue;let be=$e?this.filesRepo.getContent(E.path):null,ut=Ne.ENABLE_LEXICAL_SCORING&&be?Gt.calculateLexicalScore(be,e):0,Dn=be?Gt.calculateKeywordCoverageFromKeywords(be,m):0,un=m.length>0?Math.round(Dn*m.length):0,pt=this.calculatePhraseCoverage(`${E.path}
|
|
770
|
+
${E.summary||""}
|
|
771
|
+
${be||""}`,v),Mi=1;if(be){let Cr=/\b(class|function|const|let|var|enum)\s+\w+/.test(be);if(/export\s+/.test(be)&&!Cr){let mx=be.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"");/\b(class|function|const|let|var|enum)\s+\w+/.test(mx)||(Mi=.1)}}let ax=Ie?.08:me?.1:ut>0||pt>0||X?.14:f?.22:.18;if(Se&&B<=ax&&!X)continue;if(m.length>0&&ut===0&&!X){if(f){if(!Ie&&(un===0&&pt===0&&B<.4||un<=1&&pt===0&&B<.34||un===1&&B<.3))continue}else if(un===0&&B<.24)continue}if(f&&!Ie&&pt===0&&un<=1&&B<.3&&!X||t&&!n.matchesFilters(E.path,i,E.mtime,E.classification))continue;let cx=E.mtime>2e9?Math.floor(E.mtime/1e3):E.mtime,lx=Math.floor(Date.now()/1e3)-_c.SECONDS_PER_YEAR,vc=st.getMultiplier(E.path,E.classification),ux=Se?l.calculateScore(B,cx||lx):0,Et=(P.fusedScore*60+ux*.2)*vc,ji=d[E.path],px=E.classification?st.mapClassificationToTier(E.classification):st.classify(E.path,{content:be??void 0}),qe=`vector_rank: ${this.formatRank(P.vectorRank)} | symbol_vector_rank: ${this.formatRank(P.symbolVectorRank)} | fts_rank: ${this.formatRank(P.ftsRank)} | fused_score: ${P.fusedScore.toFixed(6)} | query_profile: ${y.profile} | Similarity: ${(B*100).toFixed(0)}%, Tier: ${px}${vc!==1?` (${vc}x)`:""}`;if(Ie&&(qe+=" | SymbolHint"),Y&&(qe+=` | SymbolVec: ${Y.symbolName}`),ut>0&&(Et+=ut*Ne.LEXICAL_WEIGHT,qe+=` | Lexical: +${ut.toFixed(1)}`),m.length>0)if(Dn>0){let Cr=f?Dn*.45:Dn*.35;Et+=Cr,qe+=` | Keywords: ${(Dn*100).toFixed(0)}%`}else qe+=" | Keywords: 0%",f&&!X&&(Et*=.55,qe+=" (penalty)");if(v.length>0)if(pt>0){let Cr=f?pt*.8:pt*.35;Et+=Cr,qe+=` | Phrases: ${(pt*100).toFixed(0)}%`}else f&&!X&&(Et*=.72,qe+=" | Phrases: 0% (penalty)");ji&&(Et+=ji.score,qe+=` | \u{1F525} Gravity: +${ji.score.toFixed(1)} (${ji.reasons.join(", ")})`),f&&this.isGenericConceptPath(E.path)&&un<=1&&pt===0&&!X&&(Et*=.75,qe+=" | Generic path penalty"),Mi<1&&(Et*=Mi,qe+=` | \u{1F4C9} Barrel: x${Mi}`);let dx=be?Gt.extractSnippet(be,e):void 0;M.push({path:E.path,summary:E.summary||"",score:B,fusedScore:P.fusedScore,vectorRank:P.vectorRank,ftsRank:P.ftsRank,decayedScore:Et,rationale:qe,snippet:dx}),V.set(E.path,{lexicalScore:ut,keywordCoverage:Dn,matchedKeywordCount:un,phraseCoverage:pt,similarity:B,hasFtsSignal:X,hasSymbolHint:Ie,hasSymbolVectorSignal:me,lexicalConfirm:0,identifierOverlap:0,isGenericPath:this.isGenericConceptPath(E.path)})}if(M.length>0&&m.length>0){let P=this.exportsRepo.findByFiles(M.map(G=>G.path)),E=new Map;for(let G of P){let Y=E.get(G.file_path)??[];Y.push(G.name),E.set(G.file_path,Y)}for(let G of M){let Y=this.calculateIdentifierOverlap(m,E.get(G.path)??[]),re=V.get(G.path);if(re&&(re.identifierOverlap=Y),Y>0){let B=f?Y*.8:Y*.25;G.decayedScore=(G.decayedScore||0)+B,G.rationale+=` | Symbols: ${(Y*100).toFixed(0)}%`}else f&&this.isGenericConceptPath(G.path)&&(G.decayedScore=(G.decayedScore||0)*.82,G.rationale+=" | Symbols: 0% (generic penalty)")}}let J=new Map;for(let P of M){let E=P.path.split("/").pop()?.split(".")[0].replace(/(Controller|Service|Repository|Component|View|Page|Handler|Wrapper|Client|DTO|Interface)$/i,"").toLowerCase();E&&E.length>3&&(J.has(E)||J.set(E,[]),J.get(E).push(P))}for(let[P,E]of J.entries())if(new Set(E.map(Y=>Y.path.split(".").pop())).size>1)for(let Y of E)Y.decayedScore=(Y.decayedScore||0)+.15,Y.rationale+=` | \u{1F310} Polyglot Flow: +0.15 (Linked via '${P}')`;if(f&&M.length>1){let P=Math.min(Math.max(o*4,Ne.FILTERED_QUERY_LIMIT_MULTIPLIER*20),M.length),E=[...M].sort((Y,re)=>(re.decayedScore||0)-(Y.decayedScore||0)).slice(0,P),G=this.computeBm25LikeConfirmation(E.map(Y=>Y.path),m);for(let Y of E){let re=G.get(Y.path)||0,B=V.get(Y.path);if(B&&(B.lexicalConfirm=re),re>0){let X=Math.min(.95,re*.18);Y.decayedScore=(Y.decayedScore||0)+X,Y.rationale+=` | LexConfirm: +${X.toFixed(2)}`}else B&&B.matchedKeywordCount<=1&&B.phraseCoverage===0&&B.lexicalScore===0&&(Y.decayedScore=(Y.decayedScore||0)*.85,Y.rationale+=" | LexConfirm: 0 (penalty)")}}for(let P of M){let E=V.get(P.path);E&&(P.score=this.calculateConceptEvidenceScore({profile:y.profile,queryKeywordCount:m.length,...E}),P.rationale+=` | Evidence: ${(P.score*100).toFixed(0)}%`)}return M.sort((P,E)=>(E.decayedScore||0)-(P.decayedScore||0)),M.slice(s,s+Math.min(o,de.MAX_LIMIT))}async findIntentLogMatches(e,r){return(await this.intentLogsRepo.findSemanticMatches(e,r)).map(t=>({id:t.id,missionId:t.mission_id,type:t.type,content:t.content,symbolName:t.symbol_name,filePath:t.file_path,score:t.similarity,decayedScore:t.similarity,rationale:`Similarity: ${(t.similarity*100).toFixed(0)}%`,createdAt:t.created_at}))}buildFtsQuery(e,r){let i=e.trim();if(!i.includes(" "))return`"${i}" OR ${i}*`;let t=i.split(/\s+/).filter(o=>o.length>0);switch(r){case"exact":return`"${i}"`;case"all":return t.map(o=>`${o}*`).join(" ");default:return t.map(o=>`${o}*`).join(" OR ")}}extractPathKeywords(e){let r=e.trim();if(!r)return[];let i=r.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_\/.-]+/).map(o=>o.trim()).filter(o=>o.length>=2),t=new Set;t.add(r.toLowerCase());for(let o of i)t.add(o);return Array.from(t)}isLikelySymbolQuery(e){let r=e.trim();return!r||/[\/\\]/.test(r)?!1:/^[a-z]+(?:[A-Z][a-z0-9]+)+$/.test(r)||!r.includes(" ")&&/[A-Z]/.test(r)}countPathKeywordHits(e,r){let i=e.toLowerCase(),t=r.filter(s=>s.length>=3),o=0;for(let s of t)i.includes(s.toLowerCase())&&(o+=1);return o}scorePathResult(e,r,i,t){let s=this.countPathKeywordHits(e,r)*10;i==="symbol"&&(s+=25);let a=e.toLowerCase(),c=a.includes("/.env")||a.endsWith(".env")||a.endsWith(".yml")||a.endsWith(".yaml")||a.endsWith(".json")||a.endsWith(".md");return t&&c&&(s-=20),t&&a.includes("/tests/")&&(s-=15),s}findSymbolBackedPaths(e,r,i){let t=e.trim().toLowerCase();if(!t)return[];if(/[\/\\]/.test(t))return[];let o=Array.from(new Set([t,...r])).filter(c=>c.length>=3).slice(0,6);if(o.length===0)return[];let s=o.flatMap(c=>{let l=c===t?Math.min(i,60):Math.min(i,30);return this.exportsRepo.findByPartialName(c,l)}),a=new Map;for(let c of s){let l=c.name.toLowerCase(),u=0;l===t&&(u+=6),l.startsWith(t)&&(u+=4),l.includes(t)&&(u+=3);for(let d of r)d.length>=3&&l.includes(d)&&(u+=1);if(u===0)continue;let p=a.get(c.file_path)||0;u>p&&a.set(c.file_path,u)}return Array.from(a.entries()).sort((c,l)=>l[1]-c[1]).slice(0,Math.min(i,de.MAX_LIMIT)).map(([c])=>c)}rrfMerge(e,r,i,t){let o=new Map,s=t?.vectorWeight??1.2,a=t?.ftsWeight??.8,c=t?.symbolWeight??1.1,l=t?.symbolResults??[];for(let u of e){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.vectorRank=u.rank,p.fusedScore+=s/(i+u.rank),o.set(u.path,p)}for(let u of r){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.ftsRank=u.rank,p.fusedScore+=a/(i+u.rank),o.set(u.path,p)}for(let u of l){let p=o.get(u.path)||{path:u.path,row:u.row,vectorRank:null,symbolVectorRank:null,symbolName:null,ftsRank:null,fusedScore:0};p.symbolVectorRank=u.rank,p.symbolName=u.symbolName,p.fusedScore+=c/(i+u.rank),o.set(u.path,p)}return Array.from(o.values()).sort((u,p)=>p.fusedScore-u.fusedScore)}formatRank(e){return e==null?"none":String(e)}getConceptConfidenceFloor(e){switch(e){case"identifier-heavy":return .33;case"lexical-heavy":return .38;case"semantic-exploratory":return .3;default:return .35}}getIntentConfidenceFloor(e){return Math.max(.28,this.getConceptConfidenceFloor(e)-.05)}calculateConceptEvidenceScore(e){let r=Math.min(1,e.lexicalConfirm/Math.max(1,e.queryKeywordCount*1.5)),i=e.profile==="semantic-exploratory"?.72:.58,t=e.profile==="lexical-heavy"?.16:.12,o=e.profile==="identifier-heavy"?.12:.08,s=e.similarity*i+Math.min(1,e.lexicalScore)*.08+e.keywordCoverage*.1+e.phraseCoverage*t+e.identifierOverlap*o+r*.08;return e.hasFtsSignal&&(s+=.04),e.hasSymbolHint?s+=.03:e.hasSymbolVectorSignal&&(s+=.02),e.matchedKeywordCount===0&&e.phraseCoverage===0&&e.lexicalScore===0?s*=e.hasFtsSignal||e.hasSymbolVectorSignal?.72:.6:e.matchedKeywordCount<=1&&e.phraseCoverage===0&&e.identifierOverlap===0&&(s*=.88),e.isGenericPath&&e.matchedKeywordCount<=1&&e.phraseCoverage===0&&e.identifierOverlap===0&&(s*=.85),e.queryKeywordCount===0&&(s*=.75),Math.max(0,Math.min(.97,s))}estimateTokenCount(e){return e?Math.ceil(e.length/4):0}classifyConceptQuery(e,r){let i=e.trim(),t=r.length,o=/\b[a-z]+[A-Z][A-Za-z0-9]*\b/.test(i),s=/\b[a-z0-9]+_[a-z0-9_]+\b/i.test(i),a=/[/.:#()]/.test(i),c=t<=1&&!i.includes(" "),l=i.includes('"')||t>=5&&i.split(/\s+/).length>=6;return o||s||a&&t>=2?{profile:"identifier-heavy",rrfK:45,vectorWeight:1,ftsWeight:.75,symbolWeight:1.45,channelMultiplier:5,lexicalWindowMultiplier:5,earlyRejectThreshold:.012}:l?{profile:"lexical-heavy",rrfK:55,vectorWeight:.95,ftsWeight:1.3,symbolWeight:1,channelMultiplier:7,lexicalWindowMultiplier:8,earlyRejectThreshold:.008}:c||t<=2?{profile:"semantic-exploratory",rrfK:70,vectorWeight:1.35,ftsWeight:.6,symbolWeight:.9,channelMultiplier:4,lexicalWindowMultiplier:4,earlyRejectThreshold:.018}:{profile:"balanced",rrfK:60,vectorWeight:1.15,ftsWeight:.9,symbolWeight:1.2,channelMultiplier:6,lexicalWindowMultiplier:6,earlyRejectThreshold:.01}}extractOrderedConceptTerms(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(r=>r.trim()).filter(r=>r.length>=3):[]}buildNgrams(e,r,i){if(e.length<r)return[];let t=[];for(let o=r;o<=i&&!(e.length<o);o++)for(let s=0;s<=e.length-o;s++)t.push(e.slice(s,s+o).join(" "));return Array.from(new Set(t))}calculatePhraseCoverage(e,r){if(!e||r.length===0)return 0;let i=e.toLowerCase(),t=0;for(let o of r)i.includes(o)&&(t+=1);return t/r.length}calculateIdentifierOverlap(e,r){if(e.length===0||r.length===0)return 0;let i=new Set(e.map(s=>s.toLowerCase())),t=new Set;for(let s of r){let a=s.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9_]+/).map(c=>c.trim()).filter(c=>c.length>=3);for(let c of a)t.add(c)}let o=0;for(let s of i)t.has(s)&&(o+=1);return o/i.size}isGenericConceptPath(e){let r=e.toLowerCase();return/(?:^|\/)(index|utils?|helpers?|common|shared|types?|constants?|models?)(?:\/|\.|$)/.test(r)}computeBm25LikeConfirmation(e,r){let i=Array.from(new Set(r.map(p=>p.toLowerCase()).filter(p=>p.length>=3)));if(e.length===0||i.length===0)return new Map;let t=new Set(i),o=[],s=new Map;for(let p of e){let m=(this.filesRepo.getContent(p)??"").toLowerCase().split(/[^a-z0-9_]+/).map(h=>h.trim()).filter(Boolean),f=new Map;for(let h of m)t.has(h)&&f.set(h,(f.get(h)||0)+1);for(let h of i)(f.get(h)||0)>0&&s.set(h,(s.get(h)||0)+1);o.push({path:p,frequencies:f,length:Math.max(m.length,1)})}let a=o.reduce((p,d)=>p+d.length,0)/Math.max(o.length,1),c=1.2,l=.75,u=new Map;for(let p of o){let d=0;for(let m of i){let f=p.frequencies.get(m)||0;if(f===0)continue;let h=s.get(m)||0,v=Math.log(1+(o.length-h+.5)/(h+.5)),y=f*(c+1)/(f+c*(1-l+l*(p.length/Math.max(a,1))));d+=v*y}u.set(p.path,d)}return u}collectConceptSymbolHintPaths(e,r){let i=Array.from(new Set(e.filter(o=>o.length>=4&&!this.isLowSignalConceptKeyword(o)))).slice(0,6);if(i.length===0)return new Set;let t=new Map;for(let o of i){let s=this.exportsRepo.findByPartialName(o,Math.min(r,80));for(let a of s){let c=a.name.toLowerCase(),l=0;c===o&&(l+=3),c.startsWith(o)&&(l+=2),c.includes(o)&&(l+=1),l!==0&&t.set(a.file_path,(t.get(a.file_path)||0)+l)}}return new Set(Array.from(t.entries()).sort((o,s)=>s[1]-o[1]).slice(0,Math.min(r,de.MAX_LIMIT)).map(([o])=>o))}isLowSignalConceptKeyword(e){return new Set(["type","types","data","update","create","list","item","value","model","helper"]).has(e.toLowerCase())}};We();yt();function Vt(n){let{fileType:e,layer:r}=n,i={fileType:Be.normalizeFileType(e),layer:r},t=!!(i.fileType?.length||i.layer!=null);return{filters:i,hasFilters:t}}ee();We();import{Visitor as l$}from"@swc/core/Visitor.js";var Jn=class extends l${calls=new Set;apiCalls=[];imports=new Map;axiosInstances=new Map([["axios",""],["http",""],["appApi",""],["restApi",""],["adminApi",""]]);visitImportDeclaration(e){let r=e.source.value;for(let i of e.specifiers)(i.type==="ImportDefaultSpecifier"||i.type==="ImportSpecifier")&&this.imports.set(i.local.value,r);return super.visitImportDeclaration(e)}visitCallExpression(e){if(e.callee.type==="Identifier"){let r=e.callee.value;this.calls.add(r),(r==="axios"||r==="http")&&e.arguments.length>0&&this.extractApiCallFromConfig(e.arguments[0].expression)}else if(e.callee.type==="MemberExpression"){let r=e.callee.property.value,i=o=>{if(!o)return"?";if(o.type==="Identifier")return o.value;if(o.type==="ThisExpression")return"this";if(o.type==="MemberExpression"){let s=i(o.object),a=o.property.value||"?";return`${s}.${a}`}return o.type==="TsNonNullExpression"||o.type==="TsAsExpression"||o.type==="ParenthesisExpression"?i(o.expression):"?"},t=i(e.callee.object);if(t!=="?"&&r){if(this.calls.add(`${t}.${r}`),t==="axios"||t==="http"||this.axiosInstances.has(t)){let o=this.axiosInstances.get(t)||"";this.extractApiCall(r,e.arguments,o)}if((t.toLowerCase().includes("pubsub")||t==="pubSubClient"||t.endsWith(".pubSubClient"))&&r!=="subscribe"){let o=r;if((r==="publish"||r==="publishMessage"||r==="publishTaskByNameAndPayload")&&e.arguments.length>0)for(let s of e.arguments){let a=s.expression;if(a.type==="ObjectExpression"){let c=a.properties.find(l=>l.key?.type==="Identifier"&&(l.key.value==="action"||l.key.value==="type")||l.key?.type==="StringLiteral"&&(l.key.value==="action"||l.key.value==="type"));if(c&&c.value?.type==="StringLiteral"){o=c.value.value;break}}if(a.type==="CallExpression"&&a.callee.type==="MemberExpression"&&a.callee.object.value==="JSON"&&a.callee.property.value==="stringify"&&a.arguments.length>0){let c=a.arguments[0].expression;if(c.type==="ObjectExpression"){let l=c.properties.find(u=>u.key?.type==="Identifier"&&(u.key.value==="action"||u.key.value==="type")||u.key?.type==="StringLiteral"&&(u.key.value==="action"||u.key.value==="type"));if(l&&l.value?.type==="StringLiteral"){o=l.value.value;break}}}}this.apiCalls.push({method:"PUBSUB",url:o})}}}return e.callee.type==="Identifier"&&e.callee.value==="fetch"&&this.extractApiCall("GET",e.arguments),super.visitCallExpression(e)}visitNewExpression(e){return e.callee.type==="Identifier"&&this.calls.add(e.callee.value),super.visitNewExpression(e)}visitVariableDeclarator(e){if(e.init&&e.init.type==="CallExpression"){let r=e.init.callee;if(r.type==="MemberExpression"&&r.property.value==="create"&&r.object.value==="axios"){let t=e.init.arguments[0]?.expression;if(t&&t.type==="ObjectExpression"){let o=t.properties.find(s=>s.key.value==="baseURL");if(o){let s="?";o.value.type==="StringLiteral"?s=o.value.value:o.value.type==="Identifier"&&(s=`\${${o.value.value}}`),e.id.type==="Identifier"&&this.axiosInstances.set(e.id.value,s)}}}}return super.visitVariableDeclarator(e)}extractApiCallFromConfig(e){if(e&&e.type==="ObjectExpression"){let r=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="url"||t.key.type==="StringLiteral"&&t.key.value==="url"),i=e.properties.find(t=>t.key.type==="Identifier"&&t.key.value==="method"||t.key.type==="StringLiteral"&&t.key.value==="method");if(r&&r.value){let t=i?.value?.value||"GET",o=this.resolveUrlValue(r.value);o!=="?"&&this.apiCalls.push({method:t.toUpperCase(),url:o})}}}resolveUrlValue(e){return e.type==="StringLiteral"?e.value:e.type==="TemplateLiteral"?e.quasis.map(r=>r.cooked).join("*"):"?"}visitTsType(e){return e}extractApiCall(e,r,i=""){if(r.length>0){let t=r[0].expression,o=this.resolveUrlValue(t);if(o!=="?"){if(i&&i!=="?"){let s=i.endsWith("/")||o.startsWith("/")?"":"/";o=`${i}${s}${o}`}this.apiCalls.push({method:e.toUpperCase(),url:o})}}}},qt=class{calls=new Set;apiCalls=[];imports=new Map;visit(e,r){if(r===".php"){let i=/(?:([a-zA-Z0-9_$->:\(\)]*)?(?:->|::))?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&!["$this","self","parent"].includes(o)&&this.calls.add(`${o}${o.includes("::")?"::":"->"}${s}`),["save","delete","update","create","first","all","where","get","find"].includes(s)&&o&&!["Log","Route","Cache","Config","Http"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}->${s}()`}),s==="publish"&&o&&(o.includes("topic")||o.includes("pubSub"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="Http"||o==="client"||o.endsWith("request")||o.includes("Client")||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if(r===".py"){let i=/(?:([a-zA-Z0-9_\.]+)\.)?([a-zA-Z0-9_]+)\s*\(([\s\S]*?)\)/g,t;for(;(t=i.exec(e))!==null;){let o=t[1]||"",s=t[2],a=t[3];if(this.calls.add(s),o&&o!=="self"&&o!=="cls"&&this.calls.add(`${o}.${s}`),["save","delete","update","create","first","all","filter","get"].includes(s)&&o&&!["logger","os","sys"].includes(o)&&this.apiCalls.push({method:"DB",url:`${o}.${s}()`}),s==="publish"&&o&&(o.includes("publisher")||o.includes("client"))&&this.apiCalls.push({method:"PUBSUB",url:"publish"}),["get","post","put","delete","patch","request"].includes(s)&&(o==="requests"||o==="httpx"||o==="client"||o==="http"||!o)){let u=a.match(/(?:url\s*:\s*)?['"]([^'"]+)['"]/),p=u?u[1]:a.split(",")[0].trim()||"unknown";this.apiCalls.push({method:s.toUpperCase(),url:p})}}}else if([".ts",".tsx",".js",".jsx"].includes(r)){let i=/import\s+[\s\S]*?from\s+['"](.*?)['"];?/g,t;for(;(t=i.exec(e))!==null;)this.imports.set("*",t[1]);let o=/(?:([a-zA-Z0-9_$]+)\.)?([a-zA-Z0-9_$]+)\s*\(/g,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=s[2];a?(this.calls.add(`${a}.${c}`),(a.toLowerCase().includes("pubsub")||a==="pubSubClient")&&c!=="subscribe"&&this.apiCalls.push({method:"PUBSUB",url:c})):this.calls.add(c)}}else{let i=/\.([a-zA-Z0-9_]+)\s*\(/g,t;for(;(t=i.exec(e))!==null;)this.calls.add(t[1])}if(r===".php"){let i=/use\s+([a-zA-Z0-9_\\]+)(?:\s+as\s+([a-zA-Z0-9_]+))?;/g,t;for(;(t=i.exec(e))!==null;){let o=t[1],s=o.split("\\"),a=t[2]||s[s.length-1];this.imports.set(a,o)}}else if(r===".py"){let i=/from\s+([a-zA-Z0-9_\.]+)\s+import\s+([a-zA-Z0-9_,\s]+)/g,t;for(;(t=i.exec(e))!==null;){let a=t[1];t[2].split(",").map(l=>l.trim()).forEach(l=>{this.imports.set(l,a)})}let o=/^import\s+([a-zA-Z0-9_\.]+)/gm,s;for(;(s=o.exec(e))!==null;){let a=s[1],c=a.split("."),l=c[c.length-1];this.imports.set(l,a)}}}};Xr();ee();import Ag from"path";function Dg(n){let e=n.replace(/\\/g,"/").toLowerCase();return e.includes("/test/")||e.includes("/tests/")||e.includes("/__tests__/")||e.endsWith(".spec.ts")||e.endsWith(".spec.tsx")||e.endsWith(".spec.js")||e.endsWith(".spec.jsx")||e.endsWith(".test.ts")||e.endsWith(".test.tsx")||e.endsWith(".test.js")||e.endsWith(".test.jsx")}var Yt=class{constructor(e){this.repoPath=e}getMappedTestsForSymbol(e,r,i=10){let t=z.getInstance(this.repoPath),o=Math.max(1,Math.min(i,50)),s=t.imports.findProxies(e).map(p=>p.file_path),a=Array.from(new Set([e,...s])),c=new Map,l=t.imports.findVerifiedDependents(a,r);for(let p of l)Dg(p.file_path)&&(c.has(p.file_path)||c.set(p.file_path,{absolutePath:p.file_path,file:Ag.relative(this.repoPath,p.file_path),via:"import",confidence:"high"}));let u=t.files.findContentByToken(r,o*3);for(let p of u)Dg(p)&&(c.has(p)||c.set(p,{absolutePath:p,file:Ag.relative(this.repoPath,p),via:"content",confidence:"medium"}));return Array.from(c.values()).sort((p,d)=>p.confidence!==d.confidence?p.confidence==="high"?-1:1:p.file.localeCompare(d.file)).slice(0,o)}};import Pt from"path";import el from"fs";var Nt=class{constructor(e){this.repoPath=e}async analyze(e,r={}){let{filePath:i,depth:t=3,limit:o=50,offset:s=0}=r,a=z.getInstance(this.repoPath),c=new Yt(this.repoPath),l=i?a.exports.findByNameAndFile(e,i):a.exports.findByNameGlobal(e);if(l.length===0)return[];let u=[];for(let p of l){let d=a.imports.findImpactDependents(p.file_path,`%${e}%`,t),m=[],f=new Set;for(let I of d){let N=Pt.relative(this.repoPath,I.consumer_path);if(f.has(N))continue;let L=`Imports ${I.imported_symbols}`,C=await this.verifySymbolUsage(I.consumer_path,p.name);C?L+=" (\u2705 Verified Call)":L+=" (\u26A0\uFE0F Potential Import - Usage not statically detected)",f.add(N),m.push({type:"IMPORT",file:N,depth:I.depth,details:L,verified:C})}let h=a.exports.findRoutesByCapability(e);p.kind==="HTTP Route"&&h.push({name:p.name,file_path:p.file_path,signature:p.signature});for(let I of h){let L=I.name.split("/").filter(S=>S.length>3&&!S.includes("{")&&!S.includes("$")&&!S.includes("<")).sort((S,R)=>R.length-S.length)[0];if(!L||["admin","api","user","users","update","create","delete","list","index","show","store"].includes(L.toLowerCase()))continue;let C=a.files.findContentByToken(L,10);for(let S of C){let R=Pt.relative(this.repoPath,S);!f.has(R)&&S!==p.file_path&&(f.add(R),m.push({type:"API_USAGE",file:R,depth:2,details:`Likely calls route ${I.name} (matched token '${L}')`,verified:!1}))}}let v=a.files.findContentByToken(e,20);for(let I of v){let N=Pt.relative(this.repoPath,I);!f.has(N)&&I!==p.file_path&&(f.add(N),m.push({type:"POTENTIAL_USAGE",file:N,depth:2,details:`Contains keyword '${e}' (Dynamic/Implicit usage)`,verified:!0}))}p.kind==="HTTP Route"&&await this.addCrossRepoImpact(m,f,p),m.sort((I,N)=>I.verified&&!N.verified?-1:!I.verified&&N.verified?1:I.depth!==N.depth?I.depth-N.depth:I.file.localeCompare(N.file));let y=m.length,b=m.slice(s,s+o),_=s+o<y,x=c.getMappedTestsForSymbol(p.file_path,p.name,12),k=this.calculateRiskScore(p,y,m);u.push({symbol:e,definedIn:Pt.relative(this.repoPath,p.file_path),riskScore:k,impact:b,pagination:{total:y,offset:s,limit:o,hasMore:_},verification:{coverageHint:x.length>0?"covered":"uncovered",mappedTestCount:x.length,mappedTests:x.map(I=>I.file)}})}return u}async verifySymbolUsage(e,r){try{if(!el.existsSync(e))return!1;let i=el.readFileSync(e,"utf8"),t=Pt.extname(e).toLowerCase(),o=new Set;if(t===".ts"||t===".tsx"||t===".js"||t===".jsx"){let s=new Jn;try{let a=await Lr(i,{syntax:"typescript",tsx:e.endsWith(".tsx"),target:"es2020"});s.visitModule(a),o=s.calls}catch{return i.includes(r)}}else{let s=new qt;s.visit(i,t),o=s.calls}if(o.has(r))return!0;for(let s of o){if(s===r)return!0;let a=s.split(/(?:\.|->|::)+/),c=a[a.length-1],l=r.split(/(?:\.|->|::)+/),u=l[l.length-1];if(c===u)return!0}return!1}catch{return!1}}async addCrossRepoImpact(e,r,i){try{let t=zo();for(let o of t)try{let a=(await import("os")).homedir(),c=Pt.join(a,".mcp-liquid-shadow","fused"),l=o.replace(/[^a-zA-Z0-9-_]/g,"_"),u=Pt.join(c,`${l}.db`);if(!el.existsSync(u))continue;let p=(await import("better-sqlite3")).default,d=new p(u),m=d.prepare("SELECT source_repo, source_file_path, relationship, metadata FROM virtual_edges WHERE target_repo = ? AND target_file_path = ? AND relationship = 'api_call'").all(this.repoPath,i.file_path);d.close();for(let f of m){let h=Pt.relative(f.source_repo,f.source_file_path),v=`${f.source_repo}:${h}`;r.has(v)||(r.add(v),e.push({type:"CROSS_REPO_API_CALL",file:v,depth:1,details:`Cross-repo API call from ${Pt.basename(f.source_repo)}`,verified:!0}))}}catch{continue}}catch{}}calculateRiskScore(e,r,i){let a=(new ce(this.repoPath).getSnapshot().gravity?.hotspots||[]).find(d=>d.filePath===e.file_path&&d.symbol===e.name)?.gravity||0,c=i.filter(d=>d.type==="CROSS_REPO_API_CALL").length,l=a/50+r/15+c*2,u="LOW",p="Peripheral symbol with limited usage.";return l>=8?(u="CRITICAL",p=`Core architectural pillar (Gravity: ${a.toFixed(0)}). Modification will destabilize ${r} dependents.`):l>=4?(u="HIGH",p=`High-gravity symbol with significant blast radius (${r} files).`):l>=1.5&&(u="MEDIUM",p="Standard library symbol with moderate dependency chain."),{score:Math.min(10,Math.round(l*10)/10),level:u,rationale:p}}};ee();var Co=class n{constructor(e){this.intentLogs=e}static RECENCY_HALF_LIFE_HOURS=48;static WEIGHTS={recency:.4,activity:.3,statusBoost:.2,blockerBoost:.1};score(e){if(e.length===0)return[];let r=Math.floor(Date.now()/1e3),i=e.map(c=>c.id),t=this.intentLogs.countByMissions(i),o=this.intentLogs.findMissionsWithBlockers(i),s=Math.max(1,...Object.values(t));return e.map(c=>{let l=this.computeRecency(c.updated_at,r),u=(t[c.id]||0)/s,p=this.computeStatusBoost(c.status),d=o.has(c.id)?1:0,m=n.WEIGHTS,f=l*m.recency+u*m.activity+p*m.statusBoost+d*m.blockerBoost;return{mission:c,score:Math.round(f*1e3)/1e3,breakdown:{recency:Math.round(l*1e3)/1e3,activity:Math.round(u*1e3)/1e3,blockerBoost:d,statusBoost:p}}}).sort((c,l)=>l.score-c.score)}computeRecency(e,r){let i=Math.max(0,(r-e)/3600);return Math.pow(.5,i/n.RECENCY_HALF_LIFE_HOURS)}computeStatusBoost(e){switch(e){case"in-progress":return 1;case"verifying":return .8;case"planned":return .4;default:return 0}}};ee();We();Q();import{execSync as Lg}from"child_process";import v$ from"path";var Ao=$.child({module:"shadow-trace"}),zt=class{intentLogs;exports;repoPath;hologramService;constructor(e){let{intentLogs:r,exports:i}=z.getInstance(e);this.intentLogs=r,this.exports=i,this.repoPath=e,this.hologramService=new ce(e)}analyzeGhostChanges(e){let r=e?`${e}..HEAD`:"HEAD~1..HEAD",i=[];try{let o=Lg(`git diff --name-only ${r}`,{cwd:this.repoPath,encoding:"utf-8"}).split(`
|
|
772
|
+
`).filter(s=>s.trim()!=="");if(o.length===0)return;Ao.info({files:o.length,range:r},"Initiating Shadow Trace analysis...");for(let s of o){let a=v$.join(this.repoPath,s),l=Lg(`git diff -U0 ${r} -- ${s}`,{cwd:this.repoPath,encoding:"utf-8"}).matchAll(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/g);for(let u of l){let p=parseInt(u[2],10),d=this.exports.findAtLine(a,p);d&&(this.intentLogs.create({mission_id:0,file_path:a,symbol_id:d.id,type:"discovery",content:`Shadow Trace: Modified externally in ${r}`,confidence:.8,symbol_name:d.name,signature:d.signature,commit_sha:null}),Ao.debug({symbol:d.name},"Logged ghost change"),i.push({from:"external",to:`${s}:${d.name}`,pattern:"git-delta",confidence:.8}))}}i.length>0&&this.hologramService.updateGhostBridges(i),Ao.info("Shadow Trace complete.")}catch(t){Ao.warn({err:t.message},"Shadow Trace failed: git diff error.")}}};ee();Q();var _$=$.child({module:"collision-service"}),Do=class{repoPath;constructor(e){this.repoPath=e}async analyzePotentialCollisions(){let e=ge(this.repoPath);if(!e)return[];let{missions:r,intentLogs:i}=z.getInstance(this.repoPath),t=r.findActive().filter(a=>a.git_branch&&a.git_branch!==e),o=[],s=new Set;for(let a of t){let c=a.git_branch;if(s.has(c))continue;s.add(c),_$.info({branch:c,currentBranch:e},"Checking predictive collisions"),Oc(this.repoPath,e,c)&&o.push({branch:c,type:"file",description:`Background merge-tree detected a file-level conflict between '${e}' and '${c}'.`});let u=r.findActive(e),p=new Set;for(let f of u)r.getWorkingSet(f.id).forEach(h=>p.add(h.file_path));let m=r.getWorkingSet(a.id).filter(f=>p.has(f.file_path));m.length>0&&o.push({branch:c,type:"intent",description:`Logical conflict: Mission '${a.name}' on '${c}' is modifying files you are currently working on.`,conflictingFiles:m.map(f=>f.file_path)})}return o}};var _n=class{constructor(e){this.repoPath=e}async getBriefing(e={}){let{missionId:r,scope:i="mission",altitude:t,activeMissionsLimit:o,recentActivityLimit:s,compact:a}=e,c=a??(t==="orbit"||t==="atmosphere"),l=s??(t==="orbit"?0:t==="ground"?20:10),{missions:u,intentLogs:p}=z.getInstance(this.repoPath),d=Me(this.repoPath),m=ge(this.repoPath);return i==="project"?this.getProjectBriefing({altitude:t,activeMissionsLimit:o,recentActivityLimit:l,compact:c,currentBranch:m,currentCommit:d}):this.getMissionBriefing({missionId:r,altitude:t,recentActivityLimit:l,currentBranch:m,currentCommit:d})}async getProjectBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=z.getInstance(r),{altitude:o,activeMissionsLimit:s,recentActivityLimit:a,compact:c,currentBranch:l,currentCommit:u}=e,p=i.findActive(l||void 0),d=p.length;s&&p.length>s&&(p=p.slice(0,s));let m=i.findParentOnlyIds(p),f=new Set(m),h=p.filter(W=>!f.has(W.id)),y=new Co(t).score(h),b=.15,_=3,x=c&&y.length>_?y.filter((W,O)=>O<_||W.score>=b):y,k=x.map(W=>W.mission),I=new Map(x.map(W=>[W.mission.id,W.score])),N=W=>({id:W.id,name:W.name,goal:W.goal,status:W.status,relevance:I.get(W.id)});if(o==="orbit")return{scope:"project",altitude:"orbit",counts:i.getStats(),next_work_candidates:k.map(N),meta:{current_branch:l,activeMissionsTotal:d,ember:this.getEmberLabel(r)}};let L={},C=[];for(let W of p)W.parent_id!=null?(L[W.parent_id]||(L[W.parent_id]=[]),L[W.parent_id].push(W)):C.push(W);let S=i.findRecentCompleted(5).map(N),R=a>0?t.findRecentDecisionActivity(a):void 0,A=m.map(W=>{let O=p.find(D=>D.id===W);return{parent:c?{...O,strategy_graph:void 0,verification_context:void 0}:O,children:L[W]??[]}}),H=C.filter(W=>!f.has(W.id));return{scope:"project",altitude:o||"atmosphere",counts:i.getStats(),analytics:i.getAnalytics(),hierarchy:A.length>0?A:void 0,standalone_active:H.length>0?H:void 0,active_missions:A.length===0?c?p.map(W=>({...W,strategy_graph:void 0})):p:void 0,next_work_candidates:k.map(N),recent_completed:S,recent_activity:R,meta:{current_branch:l,current_commit:u,activeMissionsTotal:d,active_limit_applied:!!s,relevance_filtered:x.length<y.length?{shown:x.length,total:y.length}:void 0,ember:this.getEmberLabel(r)}}}getEmberLabel(e){try{let{status:r,progress:i}=Wn(e);if(r==="idle")return;if(r==="done")return"symbols: fully embedded";let[t,o]=i.split("/").map(Number),s=o>0?Math.round(t/o*100):0;return r==="running"?`symbols: warming ${i} (${s}%)`:`symbols: ${r} ${i}`}catch{return}}async getMissionBriefing(e){let{repoPath:r}=this,{missions:i,intentLogs:t}=z.getInstance(r),{missionId:o,altitude:s,recentActivityLimit:a,currentBranch:c,currentCommit:l}=e,u;if(o?u=i.findById(o):u=i.findActive(c||void 0)[0],!u)return null;let p=null;try{u.strategy_graph&&(p=JSON.parse(u.strategy_graph))}catch{}if(s==="orbit")return{altitude:"orbit",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString()},strategy_snapshot:p};let d="No external shadow changes detected.";try{new zt(r).analyzeGhostChanges(u.commit_sha||void 0),d="Shadow Trace completed: Checked for external modifications."}catch{}let m={repaired:0,failed:0};try{m=new ze(r).detectAndRepairShifts()}catch{}let f=i.getHandoffs(u.id).map(v=>{let y=null;try{y=JSON.parse(v.metadata??"")}catch{}return{artifactId:v.id,kind:v.identifier,confidence:y?.confidence??null,findingsCount:y?.findings?.length??0,risksCount:y?.risks?.length??0,missionsCreated:y?.missionsCreated??[],createdAt:v.created_at}}),h={altitude:s||"atmosphere",mission:{id:u.id,name:u.name,goal:u.goal,status:u.status,last_updated:new Date(u.updated_at*1e3).toISOString(),git_branch:u.git_branch,commit_sha:u.commit_sha,outcome_contract:u.outcome_contract},artifacts:i.getArtifacts(u.id),handoffs:f,shadow_trace:{ghost_analysis:d,symbols_repaired:m.repaired,symbols_missing:m.failed},context:{current_commit:l,working_set:i.getWorkingSet(u.id).map(v=>v.file_path)},strategy_snapshot:p,recent_activity:s==="ground"?t.findByMission(u.id,a||20):t.findByMissionPreferCrystal(u.id,15),ancestor_activity_summary:[],predictive_collisions:[]};try{let v=new Do(r);h.predictive_collisions=await v.analyzePotentialCollisions()}catch{}if(u.parent_id){let v=s==="ground"?t.findByMission(u.parent_id,5):t.findByMissionPreferCrystal(u.parent_id,3);h.ancestor_activity_summary=v.map(y=>({type:y.type,content:y.content,date:new Date(y.created_at*1e3).toISOString()}))}return h}};async function rC(n,e,r={}){await te(n);let i=new Be(n),{filters:t,hasFilters:o}=Vt(r);return await i.searchBySymbol(e,r.limit??de.DEFAULT_LIMIT,r.offset??0,t,o,r.matchMode??"any")}async function iC(n,e,r={}){return await te(n),await new Nt(n).analyze(e,r)}async function oC(n){await te(n);let e=z.getInstance(n),r=He(e,n);return new ce(n).updateTopography(r),r}async function sC(n,e={}){await te(n);let i=new ce(n).getSnapshot();if(e.compact&&i.gravity?.hotspots){let t=i.gravity.hotspots.length;i={...i,gravity:{...i.gravity,hotspots:i.gravity.hotspots.slice(0,20),_truncated:t>20,_totalHotspots:t}}}return i}async function aC(n,e={}){return await te(n),await new _n(n).getBriefing(e)}async function cC(n,e={}){return z.getInstance(n).missions.findAll(e.status)}async function lC(n,e={}){let r=z.getInstance(n);return e.missionId?r.intentLogs.findByMission(e.missionId,e.limit):r.intentLogs.findRecentDecisionActivity(e.limit??50)}async function uC(n){return await te(n),new ce(n).computeGravityZones()}var Og=[{name:"shadow_recon_onboard",description:"Initial onboarding for a repository. Indexes all files, extracts symbols, and detects services.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_topography",description:"Analyze architectural layers (Entry/Logic/Data/Utility). Returns layer breakdown and architectural insights.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_scout",description:"(Expert) Detect architectural drift, pattern violations, and gravity anomalies.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"}},required:["repoPath"]}},{name:"shadow_recon_tree",description:"Generate hierarchical file tree with file classifications and export summaries.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},subPath:{type:"string",description:"Relative path to focus tree on a specific subdirectory"},maxDepth:{type:"number",description:"Maximum directory depth to traverse"}},required:["repoPath"]}},{name:"shadow_recon_hologram",description:"Get the project hologram (persistent architectural snapshot) and gravity zones.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository root"},compact:{type:"boolean",description:"Omit large arrays (gravity.hotspots) for lighter output"}},required:["repoPath"]}},{name:"shadow_search_concept",description:"Semantic/Vector-based intent search across file purpose and logic.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term or semantic intent"},limit:{type:"number",description:"Max results (default 10)"},offset:{type:"number",description:"Pagination offset"},compact:{type:"boolean",description:"Return compact output (no snippets)"},tokenBudget:{type:"number",description:"Optional token budget for adaptive folding of low-relevance matches"},fileType:{type:"string",description:"Filter by extension(s)"},layer:{type:"string",enum:["Solid","Liquid","Virtual","Intel","Phantom"]},includeTests:{type:"boolean",description:"Include test files (Virtual)"}},required:["repoPath","query"]}},{name:"shadow_search_symbol",description:"Exact and fuzzy code symbol matching (classes, functions, methods).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Symbol name or partial name"},limit:{type:"number",description:"Max results"},offset:{type:"number",description:"Pagination offset"},fileType:{type:"string",description:"Filter by extension(s)"},matchMode:{type:"string",enum:["any","all","exact"],description:"Match mode for multi-word queries: 'any' (OR, default), 'all' (AND), 'exact' (phrase)"}},required:["repoPath","query"]}},{name:"shadow_search_config",description:"Environment and configuration discovery (ENV, Ports, Docker, YAML).",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Search term for values/keys"},key:{type:"string",description:"Specific config key match"},kind:{type:"string",enum:["Service","Image","Port","Env"]},limit:{type:"number"},showUsage:{type:"boolean",description:"Cross-reference with code to show usage counts and identify orphaned vars (defined but never used)"}},required:["repoPath"]}},{name:"shadow_search_path",description:"Filename-keyword resolution using the search index.",inputSchema:{type:"object",properties:{repoPath:{type:"string",description:"Absolute path to the repository"},query:{type:"string",description:"Filename part or path keyword"},limit:{type:"number"},ranked:{type:"boolean",description:"Sort results by gravity (high-import files first) and show layer classification (Entry/Logic/Data)"}},required:["repoPath","query"]}},{name:"shadow_analyze_impact",description:"Calculate blast radius and Strategic Risk Scoring of changing a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string",description:"Symbol to analyze"},filePath:{type:"string",description:"Specific file where symbol is defined"},depth:{type:"number",description:"Traversal depth (default 3)"},limit:{type:"number",description:"Max results per symbol (default 50)"},offset:{type:"number",description:"Pagination offset"}},required:["repoPath","symbolName"]}},{name:"shadow_analyze_explain_diff",description:"Explain a diff in one pass: changed symbols, blast radius, type relations, and verification test hints.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},baseCommit:{type:"string",description:"Optional base commit/ref for diff range"},headCommit:{type:"string",description:"Optional head commit/ref for diff range"},staged:{type:"boolean",description:"Analyze staged diff (default true)"},includeUntracked:{type:"boolean",description:"Include untracked files in diff"},maxSymbols:{type:"number",description:"Max changed symbols to explain (default 20)"},impactDepth:{type:"number",description:"Impact traversal depth for each symbol"},impactLimit:{type:"number",description:"Max impact rows per symbol"}},required:["repoPath"]}},{name:"shadow_analyze_type_graph",description:"Query indexed type graph edges (extends, implements, generic constraints) for a symbol.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string",description:"Optional file scope for outbound edges"},direction:{type:"string",enum:["outbound","inbound","both"]},relationship:{type:"string",enum:["extends","implements","constrained_by"]},limit:{type:"number"}},required:["repoPath","symbolName"]}},{name:"shadow_analyze_flow",description:"Execution call-chain tracing (AST-based) for a specific function/method.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string",description:"File to start trace from"},symbolName:{type:"string",description:"Function/method name"}},required:["repoPath","filePath"]}},{name:"shadow_analyze_deps",description:"Direct file import/export mapping and dependency graph inspection.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},direction:{type:"string",enum:["imports","imported_by"]}},required:["repoPath","filePath","direction"]}},{name:"shadow_analyze_debt",description:"Recursive dead-code detection and circular import identification. For dead-code mode: excludes migrations and fixtures by default, returns results with confidence scoring.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},mode:{type:"string",enum:["dead-code","circular-deps"]},limit:{type:"number"},includeTests:{type:"boolean"},excludePatterns:{type:"array",items:{type:"string"},description:"Custom glob patterns to exclude (e.g., '**/migrations/**')"},includeMigrations:{type:"boolean",description:"Include migration files (default: false)"},includeFixtures:{type:"boolean",description:"Include fixture/mock files (default: false)"},confidenceThreshold:{type:"string",enum:["all","high","medium"],description:"Filter by confidence: 'all' (default), 'high' (likely dead), 'medium' (possibly intentional)"}},required:["repoPath","mode"]}},{name:"shadow_analyze_mesh",description:'Query the event mesh \u2014 find all producers and consumers of a named event, API route, or pubsub topic across the codebase. For socket events use type="socket_event", for HTTP routes use type="api_route", for pubsub use type="pubsub_topic". Leave type unset to search across all categories. Set includeCrossRepo:true when a fused workspace index exists to include cross-repo edges.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},topic:{type:"string",description:"Event name, route path, or topic name to look up. Supports partial match."},type:{type:"string",enum:["socket_event","api_route","pubsub_topic"],description:"Optional: restrict to one synapse type"},includeCrossRepo:{type:"boolean",description:"Include cross-repo virtual edges from fused index (default false)"},format:{type:"string",enum:["json","text"],description:"Output format (default json)"}},required:["repoPath","topic"]}}];var Mg=[{name:"shadow_ops_plan",description:"Create a new development mission or strategic initiative with goals and strategy.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},name:{type:"string",description:"Mission name"},goal:{type:"string",description:"Objective and success criteria"},strategy:{type:"string",description:"JSON strategy (steps DAG)"},missionId:{type:"number",description:"Existing mission ID to update in place"},parentId:{type:"number",description:"ID of parent mission"},outcomeContract:{type:"string",description:"Success verification contract"},templateId:{type:"string",enum:["refactoring","feature","bug-fix"]},templateVars:{type:"object",description:"Template variables"}},required:["repoPath"]}},{name:"shadow_ops_track",description:"Update mission step status, record progress, and track completion.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},stepId:{type:"string"},status:{type:"string",enum:["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]},contextPivot:{type:"string",description:"Rationale for status change"},updates:{type:"array",items:{type:"object",properties:{stepId:{type:"string"},status:{type:"string"},contextPivot:{type:"string"}}}}},required:["repoPath","missionId"]}},{name:"shadow_ops_log",description:"Record architectural decisions, discoveries, or blockers to the intent log.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Mission to attach this log to. Optional \u2014 if omitted, auto-resolves to the active mission or logs as standalone."},type:{type:"string",enum:["decision","blocker","discovery","fix","note","system","adr"],description:"Intent category (architectural, operational, or narrative)."},content:{type:"string"},filePath:{type:"string",description:"File path to associate with this log"},symbolName:{type:"string",description:"Symbol related to this intent"},standalone:{type:"boolean",description:"If true, log is mission-unlinked (repo-level or symbol/file anchored)."}},required:["repoPath","type","content"]}},{name:"shadow_ops_briefing",description:"Active situational awareness - Get details on missions, decisions, and next steps.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Optional specific mission ID"},scope:{type:"string",enum:["mission","project"]},altitude:{type:"string",enum:["orbit","atmosphere","ground"],description:"Zoom level: orbit (~200 tokens, counts+candidates only), atmosphere (strategy+crystals, default), ground (raw logs+working set)"},includeGroupedByParent:{type:"boolean"},activeMissionsLimit:{type:"number",description:"Limit active missions in output"},recentActivityLimit:{type:"number",description:"Limit recent activity logs"},compact:{type:"boolean",description:"Omit strategy_graph JSON for lighter output"}},required:["repoPath"]}},{name:"shadow_ops_synthesize",description:"Distill mission context and logs into an Architectural Decision Record (ADR).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_chronicle",description:"Archive feed of the repository narrative (initiatives and standalones).",inputSchema:{type:"object",properties:{repoPath:{type:"string"},format:{type:"string",enum:["markdown","json"]},limit:{type:"number"},offset:{type:"number"},since:{type:"number"},until:{type:"number"},branch:{type:"string",description:"Optional git branch scope for mission timeline"}},required:["repoPath"]}},{name:"shadow_ops_context",description:'Session-start bundle in one call: hologram + chronicle (last 5) + briefing summary (counts, next_work_candidates). Use for "new chat, give me the world" without multiple round-trips.',inputSchema:{type:"object",properties:{repoPath:{type:"string"},compact:{type:"boolean",description:"Return lighter payload (omit full hologram.gravity.hotspots, strategy_graph)"},branch:{type:"string",description:"Optional branch scope for chronicle/context results"},includeSessionDelta:{type:"boolean",description:'If true, include optional "since last session" drift summary in response'},sinceCommit:{type:"string",description:"Optional baseline commit for drift summary (defaults to last indexed commit)"}},required:["repoPath"]}},{name:"shadow_ops_health",description:"System health metrics and intelligence index status.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_ops_crystallize",description:"Compress a mission's intent logs into a single crystal summary. Raw logs are marked as absorbed and replaced by one dense crystal node for token-efficient briefings.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"}},required:["repoPath","missionId"]}},{name:"shadow_ops_crystallize_theme",description:'Cluster semantically related intent logs across all missions by a theme phrase and compress them into a single thematic crystal. Unlike shadow_ops_crystallize which compresses one mission, this crosses mission boundaries. Use for architectural themes that span multiple missions e.g. "authentication decisions" or "database connection handling".',inputSchema:{type:"object",properties:{repoPath:{type:"string"},theme:{type:"string",description:'Theme phrase to search semantically e.g. "authentication decisions"'},missionIds:{type:"array",items:{type:"number"},description:"Optional: restrict to these mission IDs only"},limit:{type:"number",description:"Max logs to match (default 200)"}},required:["repoPath","theme"]}},{name:"shadow_ops_graph",description:"Visualize mission lineage and dependencies.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},depth:{type:"number"},limit:{type:"number"},format:{type:"string",enum:["mermaid","json"]}},required:["repoPath"]}},{name:"shadow_working_set_check",description:"Checks which files are in active mission working sets to detect parallel editing conflicts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePaths:{type:"array",items:{type:"string"}}},required:["repoPath","filePaths"]}},{name:"shadow_inspect_symbol",description:"Dense code retrieval for a single symbol with semantic folding and usage context.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},symbolName:{type:"string"},filePath:{type:"string"},context:{type:"string",enum:["definition","full"]}},required:["repoPath","symbolName"]}},{name:"shadow_inspect_file",description:"Token-efficient summary of ALL symbols and exports in a file.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},filePath:{type:"string"},detailLevel:{type:"string",enum:["structure","signatures","summaries","detailed"]}},required:["repoPath","filePath"]}},{name:"shadow_sync_trace",description:"Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state. Lifecycle status mutation is opt-in via flags.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},sinceCommit:{type:"string"},enableContextPivot:{type:"boolean",description:"Opt-in: suspend missions on other branches and resume current branch"},enableMergeSentinel:{type:"boolean",description:"Opt-in: auto-complete missions whose branch is merged into current branch"}},required:["repoPath"]}},{name:"shadow_sync_index",description:"Incremental code re-indexing to reflect latest file changes. Lifecycle status mutation is opt-in via flags.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},deep:{type:"boolean",description:"Force full rebuild"},enableContextPivot:{type:"boolean",description:"Opt-in: suspend missions on other branches and resume current branch"},enableMergeSentinel:{type:"boolean",description:"Opt-in: auto-complete missions whose branch is merged into current branch"}},required:["repoPath"]}},{name:"shadow_sync_repair",description:"NanoRepair only - Heals broken intent links and symbol shifts.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_env_hooks",description:"Install and manage Git hooks for automated intelligence maintenance.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},action:{type:"string",enum:["install","remove","status"]},enableAutoRefresh:{type:"boolean"},enableSymbolHealing:{type:"boolean"}},required:["repoPath","action"]}},{name:"shadow_env_diagnose",description:"Missions and intelligence toolset health check.",inputSchema:{type:"object",properties:{repoPath:{type:"string"}},required:["repoPath"]}},{name:"shadow_workspace_list",description:"Federated view of active missions across multiple repositories.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},status:{type:"string"}},required:["repoPaths"]}},{name:"shadow_workspace_link",description:"Establish intent-level dependencies between missions in different repos.",inputSchema:{type:"object",properties:{parentRepoPath:{type:"string"},parentMissionId:{type:"number"},childRepoPath:{type:"string"},childMissionId:{type:"number"},relationship:{type:"string"}},required:["parentRepoPath","parentMissionId","childRepoPath","childMissionId","relationship"]}},{name:"shadow_workspace_fuse",description:"Create unified cross-repo search indices using SQLite fusion.",inputSchema:{type:"object",properties:{repoPaths:{type:"array",items:{type:"string"}},name:{type:"string"}},required:["repoPaths"]}},{name:"shadow_ops_handoff",description:"Write a typed findings artifact at the end of an agent run. Call this as the final action of a RECON or analysis session to persist structured findings, risks, and mission links that any subsequent agent can query. Findings are embedded for semantic search.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number",description:"Mission this handoff is for (optional \u2014 omit for repo-level handoffs)"},kind:{type:"string",enum:["recon_report","risk_assessment","impact_map","debt_scan","custom"]},findings:{type:"array",items:{type:"object",properties:{statement:{type:"string"},confidence:{type:"number"},refs:{type:"object"}},required:["statement","confidence"]},description:"Structured findings. Each must have a statement and confidence 0-1."},risks:{type:"array",items:{type:"object",properties:{severity:{type:"string",enum:["low","medium","high","critical"]},description:{type:"string"},refs:{type:"object"}},required:["severity","description"]}},missionsCreated:{type:"array",items:{type:"number"},description:"Shadow mission IDs created during this agent run"},gaps:{type:"array",items:{type:"string"},description:"What could not be determined"},confidence:{type:"number",description:"Overall run confidence 0-1"},agentTag:{type:"string",description:"Optional agent identifier"}},required:["repoPath","kind","findings"]}},{name:"shadow_ops_handoff_read",description:"Read typed handoff artifacts written by previous agent runs. Provide a query string for semantic search across findings, or missionId/kind to filter directly.",inputSchema:{type:"object",properties:{repoPath:{type:"string"},missionId:{type:"number"},kind:{type:"string",enum:["recon_report","risk_assessment","impact_map","debt_scan","custom"]},query:{type:"string",description:"Semantic search query \u2014 finds handoffs whose findings match this concept"},limit:{type:"number"}},required:["repoPath"]}}];var g={};Ze(g,{$brand:()=>Lo,$input:()=>_p,$output:()=>vp,NEVER:()=>tl,TimePrecision:()=>wp,ZodAny:()=>mm,ZodArray:()=>ym,ZodBase64:()=>la,ZodBase64URL:()=>ua,ZodBigInt:()=>kr,ZodBigIntFormat:()=>ma,ZodBoolean:()=>wr,ZodCIDRv4:()=>aa,ZodCIDRv6:()=>ca,ZodCUID:()=>ea,ZodCUID2:()=>ta,ZodCatch:()=>jm,ZodCodec:()=>xa,ZodCustom:()=>Pi,ZodCustomStringFormat:()=>Sr,ZodDate:()=>ki,ZodDefault:()=>Cm,ZodDiscriminatedUnion:()=>vm,ZodE164:()=>pa,ZodEmail:()=>Ys,ZodEmoji:()=>Xs,ZodEnum:()=>_r,ZodError:()=>Vk,ZodExactOptional:()=>Pm,ZodFile:()=>Tm,ZodFirstPartyTypeKind:()=>Ym,ZodFunction:()=>Vm,ZodGUID:()=>_i,ZodIPv4:()=>oa,ZodIPv6:()=>sa,ZodISODate:()=>Bs,ZodISODateTime:()=>Ws,ZodISODuration:()=>Js,ZodISOTime:()=>Gs,ZodIntersection:()=>_m,ZodIssueCode:()=>Kk,ZodJWT:()=>da,ZodKSUID:()=>ia,ZodLazy:()=>Bm,ZodLiteral:()=>Im,ZodMAC:()=>sm,ZodMap:()=>km,ZodNaN:()=>Um,ZodNanoID:()=>Qs,ZodNever:()=>hm,ZodNonOptional:()=>va,ZodNull:()=>pm,ZodNullable:()=>zm,ZodNumber:()=>$r,ZodNumberFormat:()=>Tn,ZodObject:()=>Ii,ZodOptional:()=>ba,ZodPipe:()=>_a,ZodPrefault:()=>Dm,ZodPromise:()=>Jm,ZodReadonly:()=>Zm,ZodRealError:()=>Ue,ZodRecord:()=>Ri,ZodSet:()=>Em,ZodString:()=>xr,ZodStringFormat:()=>ue,ZodSuccess:()=>Mm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Rm,ZodTuple:()=>Sm,ZodType:()=>ie,ZodULID:()=>na,ZodURL:()=>wi,ZodUUID:()=>St,ZodUndefined:()=>um,ZodUnion:()=>Ti,ZodUnknown:()=>fm,ZodVoid:()=>gm,ZodXID:()=>ra,ZodXor:()=>bm,_ZodString:()=>Ks,_default:()=>Am,_function:()=>yv,any:()=>qb,array:()=>Ei,base64:()=>zb,base64url:()=>Cb,bigint:()=>Wb,boolean:()=>cm,catch:()=>Fm,check:()=>bv,cidrv4:()=>Pb,cidrv6:()=>Nb,clone:()=>Ce,codec:()=>fv,coerce:()=>Xm,config:()=>ye,core:()=>Dt,cuid:()=>Sb,cuid2:()=>$b,custom:()=>vv,date:()=>Yb,decode:()=>Qd,decodeAsync:()=>tm,describe:()=>_v,discriminatedUnion:()=>rv,e164:()=>Ab,email:()=>db,emoji:()=>_b,encode:()=>Xd,encodeAsync:()=>em,endsWith:()=>ur,enum:()=>ga,exactOptional:()=>Nm,file:()=>uv,flattenError:()=>ai,float32:()=>Fb,float64:()=>Ub,formatError:()=>ci,fromJSONSchema:()=>Iv,function:()=>yv,getErrorMap:()=>Xk,globalRegistry:()=>Ee,gt:()=>_t,gte:()=>Ae,guid:()=>mb,hash:()=>jb,hex:()=>Mb,hostname:()=>Ob,httpUrl:()=>vb,includes:()=>cr,instanceof:()=>Sv,int:()=>qs,int32:()=>Zb,int64:()=>Bb,intersection:()=>xm,ipv4:()=>Ib,ipv6:()=>Rb,iso:()=>vr,json:()=>wv,jwt:()=>Db,keyof:()=>Xb,ksuid:()=>Eb,lazy:()=>Gm,length:()=>En,literal:()=>lv,locales:()=>gi,looseObject:()=>tv,looseRecord:()=>ov,lowercase:()=>sr,lt:()=>vt,lte:()=>Je,mac:()=>Tb,map:()=>sv,maxLength:()=>kn,maxSize:()=>on,meta:()=>xv,mime:()=>pr,minLength:()=>At,minSize:()=>xt,multipleOf:()=>rn,nan:()=>mv,nanoid:()=>xb,nativeEnum:()=>cv,negative:()=>As,never:()=>fa,nonnegative:()=>Ls,nonoptional:()=>Om,nonpositive:()=>Ds,normalize:()=>dr,null:()=>dm,nullable:()=>Si,nullish:()=>pv,number:()=>am,object:()=>Qb,optional:()=>xi,overwrite:()=>lt,parse:()=>Vd,parseAsync:()=>qd,partialRecord:()=>iv,pipe:()=>$i,positive:()=>Cs,prefault:()=>Lm,preprocess:()=>kv,prettifyError:()=>ml,promise:()=>gv,property:()=>Os,readonly:()=>Hm,record:()=>wm,refine:()=>qm,regex:()=>or,regexes:()=>Xe,registry:()=>ds,safeDecode:()=>rm,safeDecodeAsync:()=>om,safeEncode:()=>nm,safeEncodeAsync:()=>im,safeParse:()=>Kd,safeParseAsync:()=>Yd,set:()=>av,setErrorMap:()=>Yk,size:()=>wn,slugify:()=>gr,startsWith:()=>lr,strictObject:()=>ev,string:()=>Vs,stringFormat:()=>Lb,stringbool:()=>$v,success:()=>dv,superRefine:()=>Km,symbol:()=>Jb,templateLiteral:()=>hv,toJSONSchema:()=>Us,toLowerCase:()=>fr,toUpperCase:()=>hr,transform:()=>ya,treeifyError:()=>dl,trim:()=>mr,tuple:()=>$m,uint32:()=>Hb,uint64:()=>Gb,ulid:()=>wb,undefined:()=>Vb,union:()=>ha,unknown:()=>In,uppercase:()=>ar,url:()=>bb,util:()=>U,uuid:()=>fb,uuidv4:()=>hb,uuidv6:()=>gb,uuidv7:()=>yb,void:()=>Kb,xid:()=>kb,xor:()=>nv});var Dt={};Ze(Dt,{$ZodAny:()=>Uu,$ZodArray:()=>Gu,$ZodAsyncError:()=>ct,$ZodBase64:()=>Nu,$ZodBase64URL:()=>zu,$ZodBigInt:()=>os,$ZodBigIntFormat:()=>Ou,$ZodBoolean:()=>di,$ZodCIDRv4:()=>Tu,$ZodCIDRv6:()=>Ru,$ZodCUID:()=>gu,$ZodCUID2:()=>yu,$ZodCatch:()=>up,$ZodCheck:()=>pe,$ZodCheckBigIntFormat:()=>Gl,$ZodCheckEndsWith:()=>iu,$ZodCheckGreaterThan:()=>Xo,$ZodCheckIncludes:()=>nu,$ZodCheckLengthEquals:()=>Xl,$ZodCheckLessThan:()=>Yo,$ZodCheckLowerCase:()=>eu,$ZodCheckMaxLength:()=>Kl,$ZodCheckMaxSize:()=>Jl,$ZodCheckMimeType:()=>su,$ZodCheckMinLength:()=>Yl,$ZodCheckMinSize:()=>Vl,$ZodCheckMultipleOf:()=>Wl,$ZodCheckNumberFormat:()=>Bl,$ZodCheckOverwrite:()=>au,$ZodCheckProperty:()=>ou,$ZodCheckRegex:()=>Ql,$ZodCheckSizeEquals:()=>ql,$ZodCheckStartsWith:()=>ru,$ZodCheckStringFormat:()=>rr,$ZodCheckUpperCase:()=>tu,$ZodCodec:()=>fi,$ZodCustom:()=>bp,$ZodCustomStringFormat:()=>Du,$ZodDate:()=>Bu,$ZodDefault:()=>sp,$ZodDiscriminatedUnion:()=>qu,$ZodE164:()=>Cu,$ZodEmail:()=>du,$ZodEmoji:()=>fu,$ZodEncodeError:()=>Xt,$ZodEnum:()=>ep,$ZodError:()=>si,$ZodExactOptional:()=>ip,$ZodFile:()=>np,$ZodFunction:()=>hp,$ZodGUID:()=>uu,$ZodIPv4:()=>ku,$ZodIPv6:()=>Eu,$ZodISODate:()=>Su,$ZodISODateTime:()=>xu,$ZodISODuration:()=>wu,$ZodISOTime:()=>$u,$ZodIntersection:()=>Ku,$ZodJWT:()=>Au,$ZodKSUID:()=>_u,$ZodLazy:()=>yp,$ZodLiteral:()=>tp,$ZodMAC:()=>Iu,$ZodMap:()=>Xu,$ZodNaN:()=>pp,$ZodNanoID:()=>hu,$ZodNever:()=>Hu,$ZodNonOptional:()=>cp,$ZodNull:()=>Fu,$ZodNullable:()=>op,$ZodNumber:()=>is,$ZodNumberFormat:()=>Lu,$ZodObject:()=>py,$ZodObjectJIT:()=>Ju,$ZodOptional:()=>as,$ZodPipe:()=>dp,$ZodPrefault:()=>ap,$ZodPromise:()=>gp,$ZodReadonly:()=>mp,$ZodRealError:()=>Fe,$ZodRecord:()=>Yu,$ZodRegistry:()=>ps,$ZodSet:()=>Qu,$ZodString:()=>$n,$ZodStringFormat:()=>le,$ZodSuccess:()=>lp,$ZodSymbol:()=>Mu,$ZodTemplateLiteral:()=>fp,$ZodTransform:()=>rp,$ZodTuple:()=>ss,$ZodType:()=>ne,$ZodULID:()=>bu,$ZodURL:()=>mu,$ZodUUID:()=>pu,$ZodUndefined:()=>ju,$ZodUnion:()=>mi,$ZodUnknown:()=>Zu,$ZodVoid:()=>Wu,$ZodXID:()=>vu,$ZodXor:()=>Vu,$brand:()=>Lo,$constructor:()=>w,$input:()=>_p,$output:()=>vp,Doc:()=>pi,JSONSchema:()=>ub,JSONSchemaGenerator:()=>Zs,NEVER:()=>tl,TimePrecision:()=>wp,_any:()=>Bp,_array:()=>Xp,_base64:()=>Rs,_base64url:()=>Ps,_bigint:()=>Mp,_boolean:()=>Lp,_catch:()=>Fk,_check:()=>lb,_cidrv4:()=>Is,_cidrv6:()=>Ts,_coercedBigint:()=>jp,_coercedBoolean:()=>Op,_coercedDate:()=>Kp,_coercedNumber:()=>Pp,_coercedString:()=>Sp,_cuid:()=>_s,_cuid2:()=>xs,_custom:()=>ed,_date:()=>qp,_decode:()=>Zo,_decodeAsync:()=>Wo,_default:()=>Ok,_discriminatedUnion:()=>kk,_e164:()=>Ns,_email:()=>ms,_emoji:()=>bs,_encode:()=>Uo,_encodeAsync:()=>Ho,_endsWith:()=>ur,_enum:()=>Nk,_file:()=>Qp,_float32:()=>zp,_float64:()=>Cp,_gt:()=>_t,_gte:()=>Ae,_guid:()=>yi,_includes:()=>cr,_int:()=>Np,_int32:()=>Ap,_int64:()=>Fp,_intersection:()=>Ek,_ipv4:()=>ks,_ipv6:()=>Es,_isoDate:()=>Ep,_isoDateTime:()=>kp,_isoDuration:()=>Tp,_isoTime:()=>Ip,_jwt:()=>zs,_ksuid:()=>ws,_lazy:()=>Wk,_length:()=>En,_literal:()=>Ck,_lowercase:()=>sr,_lt:()=>vt,_lte:()=>Je,_mac:()=>$p,_map:()=>Rk,_max:()=>Je,_maxLength:()=>kn,_maxSize:()=>on,_mime:()=>pr,_min:()=>Ae,_minLength:()=>At,_minSize:()=>xt,_multipleOf:()=>rn,_nan:()=>Yp,_nanoid:()=>vs,_nativeEnum:()=>zk,_negative:()=>As,_never:()=>Jp,_nonnegative:()=>Ls,_nonoptional:()=>Mk,_nonpositive:()=>Ds,_normalize:()=>dr,_null:()=>Wp,_nullable:()=>Lk,_number:()=>Rp,_optional:()=>Dk,_overwrite:()=>lt,_parse:()=>Qn,_parseAsync:()=>er,_pipe:()=>Uk,_positive:()=>Cs,_promise:()=>Bk,_property:()=>Os,_readonly:()=>Zk,_record:()=>Tk,_refine:()=>td,_regex:()=>or,_safeDecode:()=>Go,_safeDecodeAsync:()=>Vo,_safeEncode:()=>Bo,_safeEncodeAsync:()=>Jo,_safeParse:()=>tr,_safeParseAsync:()=>nr,_set:()=>Pk,_size:()=>wn,_slugify:()=>gr,_startsWith:()=>lr,_string:()=>xp,_stringFormat:()=>yr,_stringbool:()=>od,_success:()=>jk,_superRefine:()=>nd,_symbol:()=>Zp,_templateLiteral:()=>Hk,_toLowerCase:()=>fr,_toUpperCase:()=>hr,_transform:()=>Ak,_trim:()=>mr,_tuple:()=>Ik,_uint32:()=>Dp,_uint64:()=>Up,_ulid:()=>Ss,_undefined:()=>Hp,_union:()=>$k,_unknown:()=>Gp,_uppercase:()=>ar,_url:()=>bi,_uuid:()=>fs,_uuidv4:()=>hs,_uuidv6:()=>gs,_uuidv7:()=>ys,_void:()=>Vp,_xid:()=>$s,_xor:()=>wk,clone:()=>Ce,config:()=>ye,createStandardJSONSchemaMethod:()=>br,createToJSONSchemaMethod:()=>sd,decode:()=>V$,decodeAsync:()=>K$,describe:()=>rd,encode:()=>J$,encodeAsync:()=>q$,extractDefs:()=>an,finalize:()=>cn,flattenError:()=>ai,formatError:()=>ci,globalConfig:()=>Qr,globalRegistry:()=>Ee,initializeContext:()=>sn,isValidBase64:()=>Pu,isValidBase64URL:()=>ay,isValidJWT:()=>cy,locales:()=>gi,meta:()=>id,parse:()=>jo,parseAsync:()=>Fo,prettifyError:()=>ml,process:()=>ae,regexes:()=>Xe,registry:()=>ds,safeDecode:()=>X$,safeDecodeAsync:()=>ew,safeEncode:()=>Y$,safeEncodeAsync:()=>Q$,safeParse:()=>fl,safeParseAsync:()=>hl,toDotPath:()=>Hg,toJSONSchema:()=>Us,treeifyError:()=>dl,util:()=>U,version:()=>cu});var tl=Object.freeze({status:"aborted"});function w(n,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),e(a,c);let l=s.prototype,u=Object.keys(l);for(let p=0;p<u.length;p++){let d=u[p];d in a||(a[d]=l[d].bind(a))}}let t=r?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:n});function s(a){var c;let l=r?.Parent?new o:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(n)}),Object.defineProperty(s,"name",{value:n}),s}var Lo=Symbol("zod_brand"),ct=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Xt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Qr={};function ye(n){return n&&Object.assign(Qr,n),Qr}var U={};Ze(U,{BIGINT_FORMAT_RANGES:()=>pl,Class:()=>rl,NUMBER_FORMAT_RANGES:()=>ul,aborted:()=>nn,allowsEval:()=>sl,assert:()=>k$,assertEqual:()=>x$,assertIs:()=>$$,assertNever:()=>w$,assertNotEqual:()=>S$,assignProp:()=>en,base64ToUint8Array:()=>Fg,base64urlToUint8Array:()=>Z$,cached:()=>Yn,captureStackTrace:()=>Mo,cleanEnum:()=>U$,cleanRegex:()=>ni,clone:()=>Ce,cloneDef:()=>I$,createTransparentProxy:()=>C$,defineLazy:()=>oe,esc:()=>Oo,escapeRegex:()=>Ye,extend:()=>L$,finalizeIssue:()=>je,floatSafeRemainder:()=>il,getElementAtPath:()=>T$,getEnumValues:()=>ti,getLengthableOrigin:()=>oi,getParsedType:()=>z$,getSizableOrigin:()=>ii,hexToUint8Array:()=>W$,isObject:()=>xn,isPlainObject:()=>tn,issue:()=>Xn,joinValues:()=>T,jsonStringifyReplacer:()=>Kn,merge:()=>M$,mergeDefs:()=>Ct,normalizeParams:()=>Z,nullish:()=>Qt,numKeys:()=>N$,objectClone:()=>E$,omit:()=>D$,optionalKeys:()=>ll,parsedType:()=>F,partial:()=>j$,pick:()=>A$,prefixIssues:()=>Ge,primitiveTypes:()=>cl,promiseAllObject:()=>R$,propertyKeyTypes:()=>ri,randomString:()=>P$,required:()=>F$,safeExtend:()=>O$,shallowClone:()=>al,slugify:()=>ol,stringifyPrimitive:()=>j,uint8ArrayToBase64:()=>Ug,uint8ArrayToBase64url:()=>H$,uint8ArrayToHex:()=>B$,unwrapMessage:()=>ei});function x$(n){return n}function S$(n){return n}function $$(n){}function w$(n){throw new Error("Unexpected value in exhaustive check")}function k$(n){}function ti(n){let e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,t])=>e.indexOf(+i)===-1).map(([i,t])=>t)}function T(n,e="|"){return n.map(r=>j(r)).join(e)}function Kn(n,e){return typeof e=="bigint"?e.toString():e}function Yn(n){return{get value(){{let r=n();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Qt(n){return n==null}function ni(n){let e=n.startsWith("^")?1:0,r=n.endsWith("$")?n.length-1:n.length;return n.slice(e,r)}function il(n,e){let r=(n.toString().split(".")[1]||"").length,i=e.toString(),t=(i.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(i)){let c=i.match(/\d?e-(\d?)/);c?.[1]&&(t=Number.parseInt(c[1]))}let o=r>t?r:t,s=Number.parseInt(n.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var jg=Symbol("evaluating");function oe(n,e,r){let i;Object.defineProperty(n,e,{get(){if(i!==jg)return i===void 0&&(i=jg,i=r()),i},set(t){Object.defineProperty(n,e,{value:t})},configurable:!0})}function E$(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function en(n,e,r){Object.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ct(...n){let e={};for(let r of n){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function I$(n){return Ct(n._zod.def)}function T$(n,e){return e?e.reduce((r,i)=>r?.[i],n):n}function R$(n){let e=Object.keys(n),r=e.map(i=>n[i]);return Promise.all(r).then(i=>{let t={};for(let o=0;o<e.length;o++)t[e[o]]=i[o];return t})}function P$(n=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<n;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Oo(n){return JSON.stringify(n)}function ol(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Mo="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function xn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var sl=Yn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let n=Function;return new n(""),!0}catch{return!1}});function tn(n){if(xn(n)===!1)return!1;let e=n.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(xn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function al(n){return tn(n)?{...n}:Array.isArray(n)?[...n]:n}function N$(n){let e=0;for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&e++;return e}var z$=n=>{let e=typeof n;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(n)?"array":n===null?"null":n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?"promise":typeof Map<"u"&&n instanceof Map?"map":typeof Set<"u"&&n instanceof Set?"set":typeof Date<"u"&&n instanceof Date?"date":typeof File<"u"&&n instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},ri=new Set(["string","number","symbol"]),cl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ye(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(n,e,r){let i=new n._zod.constr(e??n._zod.def);return(!e||r?.parent)&&(i._zod.parent=n),i}function Z(n){let e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function C$(n){let e;return new Proxy({},{get(r,i,t){return e??(e=n()),Reflect.get(e,i,t)},set(r,i,t,o){return e??(e=n()),Reflect.set(e,i,t,o)},has(r,i){return e??(e=n()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=n()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=n()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=n()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,t){return e??(e=n()),Reflect.defineProperty(e,i,t)}})}function j(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function ll(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}var ul={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]},pl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function A$(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Ct(n._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return en(this,"shape",s),s},checks:[]});return Ce(n,o)}function D$(n,e){let r=n._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Ct(n._zod.def,{get shape(){let s={...n._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return en(this,"shape",s),s},checks:[]});return Ce(n,o)}function L$(n,e){if(!tn(e))throw new Error("Invalid input to extend: expected a plain object");let r=n._zod.def.checks;if(r&&r.length>0){let o=n._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let t=Ct(n._zod.def,{get shape(){let o={...n._zod.def.shape,...e};return en(this,"shape",o),o}});return Ce(n,t)}function O$(n,e){if(!tn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ct(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e};return en(this,"shape",i),i}});return Ce(n,r)}function M$(n,e){let r=Ct(n._zod.def,{get shape(){let i={...n._zod.def.shape,...e._zod.def.shape};return en(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Ce(n,r)}function j$(n,e,r){let t=e._zod.def.checks;if(t&&t.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Ct(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=n?new n({type:"optional",innerType:a[l]}):a[l])}else for(let l in a)c[l]=n?new n({type:"optional",innerType:a[l]}):a[l];return en(this,"shape",c),c},checks:[]});return Ce(e,s)}function F$(n,e,r){let i=Ct(e._zod.def,{get shape(){let t=e._zod.def.shape,o={...t};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new n({type:"nonoptional",innerType:t[s]}))}else for(let s in t)o[s]=new n({type:"nonoptional",innerType:t[s]});return en(this,"shape",o),o}});return Ce(e,i)}function nn(n,e=0){if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(n.issues[r]?.continue!==!0)return!0;return!1}function Ge(n,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(n),r})}function ei(n){return typeof n=="string"?n:n?.message}function je(n,e,r){let i={...n,path:n.path??[]};if(!n.message){let t=ei(n.inst?._zod.def?.error?.(n))??ei(e?.error?.(n))??ei(r.customError?.(n))??ei(r.localeError?.(n))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function ii(n){return n instanceof Set?"set":n instanceof Map?"map":n instanceof File?"file":"unknown"}function oi(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function F(n){let e=typeof n;switch(e){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let r=n;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Xn(...n){let[e,r,i]=n;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function U$(n){return Object.entries(n).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Fg(n){let e=atob(n),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function Ug(n){let e="";for(let r=0;r<n.length;r++)e+=String.fromCharCode(n[r]);return btoa(e)}function Z$(n){let e=n.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Fg(e+r)}function H$(n){return Ug(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function W$(n){let e=n.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function B$(n){return Array.from(n).map(e=>e.toString(16).padStart(2,"0")).join("")}var rl=class{constructor(...e){}};var Zg=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,Kn,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},si=w("$ZodError",Zg),Fe=w("$ZodError",Zg,{Parent:Error});function ai(n,e=r=>r.message){let r={},i=[];for(let t of n.issues)t.path.length>0?(r[t.path[0]]=r[t.path[0]]||[],r[t.path[0]].push(e(t))):i.push(e(t));return{formErrors:i,fieldErrors:r}}function ci(n,e=r=>r.message){let r={_errors:[]},i=t=>{for(let o of t.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return i(n),r}function dl(n,e=r=>r.message){let r={errors:[]},i=(t,o=[])=>{var s,a;for(let c of t.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,p=0;for(;p<l.length;){let d=l[p],m=p===l.length-1;typeof d=="string"?(u.properties??(u.properties={}),(s=u.properties)[d]??(s[d]={errors:[]}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(e(c)),p++}}};return i(n),r}function Hg(n){let e=[],r=n.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function ml(n){let e=[],r=[...n.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Hg(i.path)}`);return e.join(`
|
|
773
|
+
`)}var Qn=n=>(e,r,i,t)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ct;if(s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>je(c,o,ye())));throw Mo(a,t?.callee),a}return s.value},jo=Qn(Fe),er=n=>async(e,r,i,t)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(t?.Err??n)(s.issues.map(c=>je(c,o,ye())));throw Mo(a,t?.callee),a}return s.value},Fo=er(Fe),tr=n=>(e,r,i)=>{let t=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},t);if(o instanceof Promise)throw new ct;return o.issues.length?{success:!1,error:new(n??si)(o.issues.map(s=>je(s,t,ye())))}:{success:!0,data:o.value}},fl=tr(Fe),nr=n=>async(e,r,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(s=>je(s,t,ye())))}:{success:!0,data:o.value}},hl=nr(Fe),Uo=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Qn(n)(e,r,t)},J$=Uo(Fe),Zo=n=>(e,r,i)=>Qn(n)(e,r,i),V$=Zo(Fe),Ho=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return er(n)(e,r,t)},q$=Ho(Fe),Wo=n=>async(e,r,i)=>er(n)(e,r,i),K$=Wo(Fe),Bo=n=>(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tr(n)(e,r,t)},Y$=Bo(Fe),Go=n=>(e,r,i)=>tr(n)(e,r,i),X$=Go(Fe),Jo=n=>async(e,r,i)=>{let t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nr(n)(e,r,t)},Q$=Jo(Fe),Vo=n=>async(e,r,i)=>nr(n)(e,r,i),ew=Vo(Fe);var Xe={};Ze(Xe,{base64:()=>Nl,base64url:()=>qo,bigint:()=>Ol,boolean:()=>jl,browserEmail:()=>cw,cidrv4:()=>Rl,cidrv6:()=>Pl,cuid:()=>gl,cuid2:()=>yl,date:()=>Cl,datetime:()=>Dl,domain:()=>pw,duration:()=>Sl,e164:()=>zl,email:()=>wl,emoji:()=>kl,extendedDuration:()=>tw,guid:()=>$l,hex:()=>dw,hostname:()=>uw,html5Email:()=>ow,idnEmail:()=>aw,integer:()=>Ml,ipv4:()=>El,ipv6:()=>Il,ksuid:()=>_l,lowercase:()=>Zl,mac:()=>Tl,md5_base64:()=>fw,md5_base64url:()=>hw,md5_hex:()=>mw,nanoid:()=>xl,null:()=>Fl,number:()=>Ko,rfc5322Email:()=>sw,sha1_base64:()=>yw,sha1_base64url:()=>bw,sha1_hex:()=>gw,sha256_base64:()=>_w,sha256_base64url:()=>xw,sha256_hex:()=>vw,sha384_base64:()=>$w,sha384_base64url:()=>ww,sha384_hex:()=>Sw,sha512_base64:()=>Ew,sha512_base64url:()=>Iw,sha512_hex:()=>kw,string:()=>Ll,time:()=>Al,ulid:()=>bl,undefined:()=>Ul,unicodeEmail:()=>Wg,uppercase:()=>Hl,uuid:()=>Sn,uuid4:()=>nw,uuid6:()=>rw,uuid7:()=>iw,xid:()=>vl});var gl=/^[cC][^\s-]{8,}$/,yl=/^[0-9a-z]+$/,bl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,vl=/^[0-9a-vA-V]{20}$/,_l=/^[A-Za-z0-9]{27}$/,xl=/^[a-zA-Z0-9_-]{21}$/,Sl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$l=/^([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})$/,Sn=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,nw=Sn(4),rw=Sn(6),iw=Sn(7),wl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ow=/^[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])?)*$/,sw=/^(([^<>()\[\]\\.,;:\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,}))$/,Wg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,aw=Wg,cw=/^[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])?)*$/,lw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function kl(){return new RegExp(lw,"u")}var El=/^(?:(?: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])$/,Il=/^(([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}|:))$/,Tl=n=>{let e=Ye(n??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Rl=/^((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])$/,Pl=/^(([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])$/,Nl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qo=/^[A-Za-z0-9_-]*$/,uw=/^(?=.{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])?)*\.?$/,pw=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,zl=/^\+[1-9]\d{6,14}$/,Bg="(?:(?:\\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])))",Cl=new RegExp(`^${Bg}$`);function Gg(n){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Al(n){return new RegExp(`^${Gg(n)}$`)}function Dl(n){let e=Gg({precision:n.precision}),r=["Z"];n.local&&r.push(""),n.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${Bg}T(?:${i})$`)}var Ll=n=>{let e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ol=/^-?\d+n?$/,Ml=/^-?\d+$/,Ko=/^-?\d+(?:\.\d+)?$/,jl=/^(?:true|false)$/i,Fl=/^null$/i;var Ul=/^undefined$/i;var Zl=/^[^A-Z]*$/,Hl=/^[^a-z]*$/,dw=/^[0-9a-fA-F]*$/;function li(n,e){return new RegExp(`^[A-Za-z0-9+/]{${n}}${e}$`)}function ui(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var mw=/^[0-9a-fA-F]{32}$/,fw=li(22,"=="),hw=ui(22),gw=/^[0-9a-fA-F]{40}$/,yw=li(27,"="),bw=ui(27),vw=/^[0-9a-fA-F]{64}$/,_w=li(43,"="),xw=ui(43),Sw=/^[0-9a-fA-F]{96}$/,$w=li(64,""),ww=ui(64),kw=/^[0-9a-fA-F]{128}$/,Ew=li(86,"=="),Iw=ui(86);var pe=w("$ZodCheck",(n,e)=>{var r;n._zod??(n._zod={}),n._zod.def=e,(r=n._zod).onattach??(r.onattach=[])}),Vg={number:"number",bigint:"bigint",object:"date"},Yo=w("$ZodCheckLessThan",(n,e)=>{pe.init(n,e);let r=Vg[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?t.maximum=e.value:t.exclusiveMaximum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Xo=w("$ZodCheckGreaterThan",(n,e)=>{pe.init(n,e);let r=Vg[typeof e.value];n._zod.onattach.push(i=>{let t=i._zod.bag,o=(e.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?t.minimum=e.value:t.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),Wl=w("$ZodCheckMultipleOf",(n,e)=>{pe.init(n,e),n._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):il(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:n,continue:!e.abort})}}),Bl=w("$ZodCheckNumberFormat",(n,e)=>{pe.init(n,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[t,o]=ul[e.format];n._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=t,a.maximum=o,r&&(a.pattern=Ml)}),n._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:n});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}a<t&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:t,inclusive:!0,inst:n,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),Gl=w("$ZodCheckBigIntFormat",(n,e)=>{pe.init(n,e);let[r,i]=pl[e.format];n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),n._zod.check=t=>{let o=t.value;o<r&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!e.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:n,continue:!e.abort})}}),Jl=w("$ZodCheckMaxSize",(n,e)=>{var r;pe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Qt(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;t.size<=e.maximum||i.issues.push({origin:ii(t),code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Vl=w("$ZodCheckMinSize",(n,e)=>{var r;pe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Qt(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;t.size>=e.minimum||i.issues.push({origin:ii(t),code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),ql=w("$ZodCheckSizeEquals",(n,e)=>{var r;pe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Qt(t)&&t.size!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.size,t.maximum=e.size,t.size=e.size}),n._zod.check=i=>{let t=i.value,o=t.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:ii(t),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),Kl=w("$ZodCheckMaxLength",(n,e)=>{var r;pe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Qt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<t&&(i._zod.bag.maximum=e.maximum)}),n._zod.check=i=>{let t=i.value;if(t.length<=e.maximum)return;let s=oi(t);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Yl=w("$ZodCheckMinLength",(n,e)=>{var r;pe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Qt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{let t=i.value;if(t.length>=e.minimum)return;let s=oi(t);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:t,inst:n,continue:!e.abort})}}),Xl=w("$ZodCheckLengthEquals",(n,e)=>{var r;pe.init(n,e),(r=n._zod.def).when??(r.when=i=>{let t=i.value;return!Qt(t)&&t.length!==void 0}),n._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),n._zod.check=i=>{let t=i.value,o=t.length;if(o===e.length)return;let s=oi(t),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),rr=w("$ZodCheckStringFormat",(n,e)=>{var r,i;pe.init(n,e),n._zod.onattach.push(t=>{let o=t._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=n._zod).check??(r.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:e.format,input:t.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),Ql=w("$ZodCheckRegex",(n,e)=>{rr.init(n,e),n._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),eu=w("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=Zl),rr.init(n,e)}),tu=w("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=Hl),rr.init(n,e)}),nu=w("$ZodCheckIncludes",(n,e)=>{pe.init(n,e);let r=Ye(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,n._zod.onattach.push(t=>{let o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),n._zod.check=t=>{t.value.includes(e.includes,e.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:t.value,inst:n,continue:!e.abort})}}),ru=w("$ZodCheckStartsWith",(n,e)=>{pe.init(n,e);let r=new RegExp(`^${Ye(e.prefix)}.*`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),iu=w("$ZodCheckEndsWith",(n,e)=>{pe.init(n,e);let r=new RegExp(`.*${Ye(e.suffix)}$`);e.pattern??(e.pattern=r),n._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}});function Jg(n,e,r){n.issues.length&&e.issues.push(...Ge(r,n.issues))}var ou=w("$ZodCheckProperty",(n,e)=>{pe.init(n,e),n._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Jg(t,r,e.property));Jg(i,r,e.property)}}),su=w("$ZodCheckMimeType",(n,e)=>{pe.init(n,e);let r=new Set(e.mime);n._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),n._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:n,continue:!e.abort})}}),au=w("$ZodCheckOverwrite",(n,e)=>{pe.init(n,e),n._zod.check=r=>{r.value=e.tx(r.value)}});var pi=class{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 i=e.split(`
|
|
671
774
|
`).filter(s=>s),t=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(t)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,t=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,t.join(`
|
|
672
|
-
`))}};var Rl={major:4,minor:3,patch:6};var K=x("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=Rl;let i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(let t of i)for(let o of t._zod.onattach)o(n);if(i.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let t=(s,a,c)=>{let l=Ut(s),u;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let d=s.issues.length,m=p._zod.check(s);if(m instanceof Promise&&c?.async===!1)throw new Xe;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=Ut(s,d)))});else{if(s.issues.length===d)continue;l||(l=Ut(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(Ut(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new Xe;return l.then(u=>n._zod.parse(u,c))}return n._zod.parse(l,c)};n._zod.run=(s,a)=>{if(a.skipChecks)return n._zod.parse(s,a);if(a.direction==="backward"){let l=n._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,a)):o(l,s,a)}let c=n._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Xe;return c.then(l=>t(l,i,a))}return t(c,i,a)}}ee(n,"~standard",()=>({validate:t=>{try{let o=Lc(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Cc(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),sn=x("$ZodString",(n,e)=>{K.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??il(n._zod.bag),n._zod.parse=(r,i)=>{if(e.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:n}),r}}),ie=x("$ZodStringFormat",(n,e)=>{Cn.init(n,e),sn.init(n,e)}),zl=x("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=Bc),ie.init(n,e)}),Dl=x("$ZodUUID",(n,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=on(i))}else e.pattern??(e.pattern=on());ie.init(n,e)}),Ol=x("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=Jc),ie.init(n,e)}),Al=x("$ZodURL",(n,e)=>{ie.init(n,e),n._zod.check=r=>{try{let i=r.value.trim(),t=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(t.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:n,continue:!e.abort})),e.normalize?r.value=t.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!e.abort})}}}),Ll=x("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=Gc()),ie.init(n,e)}),Cl=x("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=Hc),ie.init(n,e)}),jl=x("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=jc),ie.init(n,e)}),Ml=x("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=Mc),ie.init(n,e)}),Ul=x("$ZodULID",(n,e)=>{e.pattern??(e.pattern=Uc),ie.init(n,e)}),Fl=x("$ZodXID",(n,e)=>{e.pattern??(e.pattern=Fc),ie.init(n,e)}),Zl=x("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=Zc),ie.init(n,e)}),Hl=x("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=rl(e)),ie.init(n,e)}),Wl=x("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=tl),ie.init(n,e)}),Bl=x("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=nl(e)),ie.init(n,e)}),Jl=x("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=Wc),ie.init(n,e)}),Gl=x("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=Vc),ie.init(n,e),n._zod.bag.format="ipv4"}),Vl=x("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=qc),ie.init(n,e),n._zod.bag.format="ipv6",n._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!e.abort})}}}),ql=x("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=Kc(e.delimiter)),ie.init(n,e),n._zod.bag.format="mac"}),Kl=x("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=Yc),ie.init(n,e)}),Yl=x("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Xc),ie.init(n,e),n._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[t,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!e.abort})}}});function Xl(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Ql=x("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=Qc),ie.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{Xl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function Kh(n){if(!xo.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Xl(r)}var eu=x("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=xo),ie.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{Kh(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),tu=x("$ZodE164",(n,e)=>{e.pattern??(e.pattern=el),ie.init(n,e)});function Yh(n,e=null){try{let r=n.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||e&&(!("alg"in t)||t.alg!==e))}catch{return!1}}var nu=x("$ZodJWT",(n,e)=>{ie.init(n,e),n._zod.check=r=>{Yh(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),ru=x("$ZodCustomStringFormat",(n,e)=>{ie.init(n,e),n._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:n,continue:!e.abort})}}),Ro=x("$ZodNumber",(n,e)=>{K.init(n,e),n._zod.pattern=n._zod.bag.pattern??So,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let t=r.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return r;let o=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:t,inst:n,...o?{received:o}:{}}),r}}),iu=x("$ZodNumberFormat",(n,e)=>{ml.init(n,e),Ro.init(n,e)}),Zr=x("$ZodBoolean",(n,e)=>{K.init(n,e),n._zod.pattern=al,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let t=r.value;return typeof t=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:n}),r}}),No=x("$ZodBigInt",(n,e)=>{K.init(n,e),n._zod.pattern=ol,n._zod.parse=(r,i)=>{if(e.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:n}),r}}),ou=x("$ZodBigIntFormat",(n,e)=>{fl.init(n,e),No.init(n,e)}),su=x("$ZodSymbol",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:n}),r}}),au=x("$ZodUndefined",(n,e)=>{K.init(n,e),n._zod.pattern=ll,n._zod.values=new Set([void 0]),n._zod.optin="optional",n._zod.optout="optional",n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:n}),r}}),cu=x("$ZodNull",(n,e)=>{K.init(n,e),n._zod.pattern=cl,n._zod.values=new Set([null]),n._zod.parse=(r,i)=>{let t=r.value;return t===null||r.issues.push({expected:"null",code:"invalid_type",input:t,inst:n}),r}}),lu=x("$ZodAny",(n,e)=>{K.init(n,e),n._zod.parse=r=>r}),uu=x("$ZodUnknown",(n,e)=>{K.init(n,e),n._zod.parse=r=>r}),pu=x("$ZodNever",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),du=x("$ZodVoid",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"void",code:"invalid_type",input:t,inst:n}),r}}),mu=x("$ZodDate",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let t=r.value,o=t instanceof Date;return o&&!Number.isNaN(t.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:t,...o?{received:"Invalid Date"}:{},inst:n}),r}});function Mh(n,e,r){n.issues.length&&e.issues.push(...Le(r,n.issues)),e.value[r]=n.value}var fu=x("$ZodArray",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Array.isArray(t))return r.issues.push({expected:"array",code:"invalid_type",input:t,inst:n}),r;r.value=Array(t.length);let o=[];for(let s=0;s<t.length;s++){let a=t[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>Mh(l,r,s))):Mh(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Po(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...Le(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function Xh(n){let e=Object.keys(n.shape);for(let i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Nc(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Qh(n,e,r,i,t,o){let s=[],a=t.keySet,c=t.catchall._zod,l=c.def.type,u=c.optout==="optional";for(let p in e){if(a.has(p))continue;if(l==="never"){s.push(p);continue}let d=c.run({value:e[p],issues:[]},i);d instanceof Promise?n.push(d.then(m=>Po(m,r,p,e,u))):Po(d,r,p,e,u)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),n.length?Promise.all(n).then(()=>r):r}var eg=x("$ZodObject",(n,e)=>{if(K.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=Nn(()=>Xh(e));ee(n._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let p of u.values)c[l].add(p)}}return c});let t=rn,o=e.catchall,s;n._zod.parse=(a,c)=>{s??(s=i.value);let l=a.value;if(!t(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:n}),a;a.value={};let u=[],p=s.shape;for(let d of s.keys){let m=p[d],f=m._zod.optout==="optional",h=m._zod.run({value:l[d],issues:[]},c);h instanceof Promise?u.push(h.then(_=>Po(_,a,d,l,f))):Po(h,a,d,l,f)}return o?Qh(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),hu=x("$ZodObjectJIT",(n,e)=>{eg.init(n,e);let r=n._zod.parse,i=Nn(()=>Xh(e)),t=d=>{let m=new Fr(["shape","payload","ctx"]),f=i.value,h=k=>{let S=co(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");let _=Object.create(null),v=0;for(let k of f.keys)_[k]=`key_${v++}`;m.write("const newResult = {};");for(let k of f.keys){let S=_[k],$=co(k),T=d[k]?._zod?.optout==="optional";m.write(`const ${S} = ${h(k)};`),T?m.write(`
|
|
673
|
-
if (${
|
|
674
|
-
if (${
|
|
675
|
-
payload.issues = payload.issues.concat(${
|
|
775
|
+
`))}};var cu={major:4,minor:3,patch:6};var ne=w("$ZodType",(n,e)=>{var r;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=cu;let i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(let t of i)for(let o of t._zod.onattach)o(n);if(i.length===0)(r=n._zod).deferred??(r.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let t=(s,a,c)=>{let l=nn(s),u;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(l)continue;let d=s.issues.length,m=p._zod.check(s);if(m instanceof Promise&&c?.async===!1)throw new ct;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==d&&(l||(l=nn(s,d)))});else{if(s.issues.length===d)continue;l||(l=nn(s,d))}}return u?u.then(()=>s):s},o=(s,a,c)=>{if(nn(s))return s.aborted=!0,s;let l=t(a,i,c);if(l instanceof Promise){if(c.async===!1)throw new ct;return l.then(u=>n._zod.parse(u,c))}return n._zod.parse(l,c)};n._zod.run=(s,a)=>{if(a.skipChecks)return n._zod.parse(s,a);if(a.direction==="backward"){let l=n._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,a)):o(l,s,a)}let c=n._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new ct;return c.then(l=>t(l,i,a))}return t(c,i,a)}}oe(n,"~standard",()=>({validate:t=>{try{let o=fl(n,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return hl(n,t).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),$n=w("$ZodString",(n,e)=>{ne.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Ll(n._zod.bag),n._zod.parse=(r,i)=>{if(e.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:n}),r}}),le=w("$ZodStringFormat",(n,e)=>{rr.init(n,e),$n.init(n,e)}),uu=w("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=$l),le.init(n,e)}),pu=w("$ZodUUID",(n,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Sn(i))}else e.pattern??(e.pattern=Sn());le.init(n,e)}),du=w("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=wl),le.init(n,e)}),mu=w("$ZodURL",(n,e)=>{le.init(n,e),n._zod.check=r=>{try{let i=r.value.trim(),t=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(t.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:n,continue:!e.abort})),e.normalize?r.value=t.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:n,continue:!e.abort})}}}),fu=w("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=kl()),le.init(n,e)}),hu=w("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=xl),le.init(n,e)}),gu=w("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=gl),le.init(n,e)}),yu=w("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=yl),le.init(n,e)}),bu=w("$ZodULID",(n,e)=>{e.pattern??(e.pattern=bl),le.init(n,e)}),vu=w("$ZodXID",(n,e)=>{e.pattern??(e.pattern=vl),le.init(n,e)}),_u=w("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=_l),le.init(n,e)}),xu=w("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=Dl(e)),le.init(n,e)}),Su=w("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=Cl),le.init(n,e)}),$u=w("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=Al(e)),le.init(n,e)}),wu=w("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=Sl),le.init(n,e)}),ku=w("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=El),le.init(n,e),n._zod.bag.format="ipv4"}),Eu=w("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=Il),le.init(n,e),n._zod.bag.format="ipv6",n._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:n,continue:!e.abort})}}}),Iu=w("$ZodMAC",(n,e)=>{e.pattern??(e.pattern=Tl(e.delimiter)),le.init(n,e),n._zod.bag.format="mac"}),Tu=w("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=Rl),le.init(n,e)}),Ru=w("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Pl),le.init(n,e),n._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[t,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:n,continue:!e.abort})}}});function Pu(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Nu=w("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=Nl),le.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=r=>{Pu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:n,continue:!e.abort})}});function ay(n){if(!qo.test(n))return!1;let e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Pu(r)}var zu=w("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=qo),le.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=r=>{ay(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:n,continue:!e.abort})}}),Cu=w("$ZodE164",(n,e)=>{e.pattern??(e.pattern=zl),le.init(n,e)});function cy(n,e=null){try{let r=n.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||e&&(!("alg"in t)||t.alg!==e))}catch{return!1}}var Au=w("$ZodJWT",(n,e)=>{le.init(n,e),n._zod.check=r=>{cy(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:n,continue:!e.abort})}}),Du=w("$ZodCustomStringFormat",(n,e)=>{le.init(n,e),n._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:n,continue:!e.abort})}}),is=w("$ZodNumber",(n,e)=>{ne.init(n,e),n._zod.pattern=n._zod.bag.pattern??Ko,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let t=r.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return r;let o=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:t,inst:n,...o?{received:o}:{}}),r}}),Lu=w("$ZodNumberFormat",(n,e)=>{Bl.init(n,e),is.init(n,e)}),di=w("$ZodBoolean",(n,e)=>{ne.init(n,e),n._zod.pattern=jl,n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let t=r.value;return typeof t=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:n}),r}}),os=w("$ZodBigInt",(n,e)=>{ne.init(n,e),n._zod.pattern=Ol,n._zod.parse=(r,i)=>{if(e.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:n}),r}}),Ou=w("$ZodBigIntFormat",(n,e)=>{Gl.init(n,e),os.init(n,e)}),Mu=w("$ZodSymbol",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:n}),r}}),ju=w("$ZodUndefined",(n,e)=>{ne.init(n,e),n._zod.pattern=Ul,n._zod.values=new Set([void 0]),n._zod.optin="optional",n._zod.optout="optional",n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:n}),r}}),Fu=w("$ZodNull",(n,e)=>{ne.init(n,e),n._zod.pattern=Fl,n._zod.values=new Set([null]),n._zod.parse=(r,i)=>{let t=r.value;return t===null||r.issues.push({expected:"null",code:"invalid_type",input:t,inst:n}),r}}),Uu=w("$ZodAny",(n,e)=>{ne.init(n,e),n._zod.parse=r=>r}),Zu=w("$ZodUnknown",(n,e)=>{ne.init(n,e),n._zod.parse=r=>r}),Hu=w("$ZodNever",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:n}),r)}),Wu=w("$ZodVoid",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return typeof t>"u"||r.issues.push({expected:"void",code:"invalid_type",input:t,inst:n}),r}}),Bu=w("$ZodDate",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let t=r.value,o=t instanceof Date;return o&&!Number.isNaN(t.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:t,...o?{received:"Invalid Date"}:{},inst:n}),r}});function Kg(n,e,r){n.issues.length&&e.issues.push(...Ge(r,n.issues)),e.value[r]=n.value}var Gu=w("$ZodArray",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Array.isArray(t))return r.issues.push({expected:"array",code:"invalid_type",input:t,inst:n}),r;r.value=Array(t.length);let o=[];for(let s=0;s<t.length;s++){let a=t[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(l=>Kg(l,r,s))):Kg(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function rs(n,e,r,i,t){if(n.issues.length){if(t&&!(r in i))return;e.issues.push(...Ge(r,n.issues))}n.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=n.value}function ly(n){let e=Object.keys(n.shape);for(let i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=ll(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function uy(n,e,r,i,t,o){let s=[],a=t.keySet,c=t.catchall._zod,l=c.def.type,u=c.optout==="optional";for(let p in e){if(a.has(p))continue;if(l==="never"){s.push(p);continue}let d=c.run({value:e[p],issues:[]},i);d instanceof Promise?n.push(d.then(m=>rs(m,r,p,e,u))):rs(d,r,p,e,u)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),n.length?Promise.all(n).then(()=>r):r}var py=w("$ZodObject",(n,e)=>{if(ne.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=Yn(()=>ly(e));oe(n._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let p of u.values)c[l].add(p)}}return c});let t=xn,o=e.catchall,s;n._zod.parse=(a,c)=>{s??(s=i.value);let l=a.value;if(!t(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:n}),a;a.value={};let u=[],p=s.shape;for(let d of s.keys){let m=p[d],f=m._zod.optout==="optional",h=m._zod.run({value:l[d],issues:[]},c);h instanceof Promise?u.push(h.then(v=>rs(v,a,d,l,f))):rs(h,a,d,l,f)}return o?uy(u,l,a,c,i.value,n):u.length?Promise.all(u).then(()=>a):a}}),Ju=w("$ZodObjectJIT",(n,e)=>{py.init(n,e);let r=n._zod.parse,i=Yn(()=>ly(e)),t=d=>{let m=new pi(["shape","payload","ctx"]),f=i.value,h=_=>{let x=Oo(_);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};m.write("const input = payload.value;");let v=Object.create(null),y=0;for(let _ of f.keys)v[_]=`key_${y++}`;m.write("const newResult = {};");for(let _ of f.keys){let x=v[_],k=Oo(_),N=d[_]?._zod?.optout==="optional";m.write(`const ${x} = ${h(_)};`),N?m.write(`
|
|
776
|
+
if (${x}.issues.length) {
|
|
777
|
+
if (${k} in input) {
|
|
778
|
+
payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
676
779
|
...iss,
|
|
677
|
-
path: iss.path ? [${
|
|
780
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
678
781
|
})));
|
|
679
782
|
}
|
|
680
783
|
}
|
|
681
784
|
|
|
682
|
-
if (${
|
|
683
|
-
if (${
|
|
684
|
-
newResult[${
|
|
785
|
+
if (${x}.value === undefined) {
|
|
786
|
+
if (${k} in input) {
|
|
787
|
+
newResult[${k}] = undefined;
|
|
685
788
|
}
|
|
686
789
|
} else {
|
|
687
|
-
newResult[${
|
|
790
|
+
newResult[${k}] = ${x}.value;
|
|
688
791
|
}
|
|
689
792
|
|
|
690
793
|
`):m.write(`
|
|
691
|
-
if (${
|
|
692
|
-
payload.issues = payload.issues.concat(${
|
|
794
|
+
if (${x}.issues.length) {
|
|
795
|
+
payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
693
796
|
...iss,
|
|
694
|
-
path: iss.path ? [${
|
|
797
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
695
798
|
})));
|
|
696
799
|
}
|
|
697
800
|
|
|
698
|
-
if (${
|
|
699
|
-
if (${
|
|
700
|
-
newResult[${
|
|
801
|
+
if (${x}.value === undefined) {
|
|
802
|
+
if (${k} in input) {
|
|
803
|
+
newResult[${k}] = undefined;
|
|
701
804
|
}
|
|
702
805
|
} else {
|
|
703
|
-
newResult[${
|
|
806
|
+
newResult[${k}] = ${x}.value;
|
|
704
807
|
}
|
|
705
808
|
|
|
706
|
-
`)}m.write("payload.value = newResult;"),m.write("return payload;");let y=m.compile();return(k,S)=>y(d,k,S)},o,s=rn,a=!Pr.jitless,l=a&&Tc.value,u=e.catchall,p;n._zod.parse=(d,m)=>{p??(p=i.value);let f=d.value;return s(f)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=t(e.shape)),d=o(d,m),u?Qh([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function Uh(n,e,r,i){for(let o of n)if(o.issues.length===0)return e.value=o.value,e;let t=n.filter(o=>!Ut(o));return t.length===1?(e.value=t[0].value,t[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>Pe(s,i,me())))}),e)}var Hr=x("$ZodUnion",(n,e)=>{K.init(n,e),ee(n._zod,"optin",()=>e.options.some(t=>t._zod.optin==="optional")?"optional":void 0),ee(n._zod,"optout",()=>e.options.some(t=>t._zod.optout==="optional")?"optional":void 0),ee(n._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),ee(n._zod,"pattern",()=>{if(e.options.every(t=>t._zod.pattern)){let t=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${t.map(o=>zr(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>Uh(c,t,n,o)):Uh(a,t,n,o)}});function Fh(n,e,r,i){let t=n.filter(o=>o.issues.length===0);return t.length===1?(e.value=t[0].value,e):(t.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>Pe(s,i,me())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var gu=x("$ZodXor",(n,e)=>{Hr.init(n,e),e.inclusive=!1;let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);l instanceof Promise?(a.push(l),s=!0):a.push(l)}return s?Promise.all(a).then(c=>Fh(c,t,n,o)):Fh(a,t,n,o)}}),yu=x("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,Hr.init(n,e);let r=n._zod.parse;ee(n._zod,"propValues",()=>{let t={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){t[a]||(t[a]=new Set);for(let l of c)t[a].add(l)}}return t});let i=Nn(()=>{let t=e.options,o=new Map;for(let s of t){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});n._zod.parse=(t,o)=>{let s=t.value;if(!rn(s))return t.issues.push({code:"invalid_type",expected:"object",input:s,inst:n}),t;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(t,o):e.unionFallback?r(t,o):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:n}),t)}}),vu=x("$ZodIntersection",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value,o=e.left._zod.run({value:t,issues:[]},i),s=e.right._zod.run({value:t,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>Zh(r,c,l)):Zh(r,o,s)}});function Nl(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(Mt(n)&&Mt(e)){let r=Object.keys(e),i=Object.keys(n).filter(o=>r.indexOf(o)!==-1),t={...n,...e};for(let o of i){let s=Nl(n[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t[o]=s.data}return{valid:!0,data:t}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<n.length;i++){let t=n[i],o=e[i],s=Nl(t,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Zh(n,e,r){let i=new Map,t;for(let a of e.issues)if(a.code==="unrecognized_keys"){t??(t=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else n.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else n.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&t&&n.issues.push({...t,keys:o}),Ut(n))return n;let s=Nl(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return n.value=s.data,n}var zo=x("$ZodTuple",(n,e)=>{K.init(n,e);let r=e.items;n._zod.parse=(i,t)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:n,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!e.rest){let u=o.length>r.length,p=o.length<c-1;if(u||p)return i.issues.push({...u?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:n,origin:"array"}),i}let l=-1;for(let u of r){if(l++,l>=o.length&&l>=c)continue;let p=u._zod.run({value:o[l],issues:[]},t);p instanceof Promise?s.push(p.then(d=>wo(d,i,l))):wo(p,i,l)}if(e.rest){let u=o.slice(r.length);for(let p of u){l++;let d=e.rest._zod.run({value:p,issues:[]},t);d instanceof Promise?s.push(d.then(m=>wo(m,i,l))):wo(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function wo(n,e,r){n.issues.length&&e.issues.push(...Le(r,n.issues)),e.value[r]=n.value}var _u=x("$ZodRecord",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!Mt(t))return r.issues.push({expected:"record",code:"invalid_type",input:t,inst:n}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.valueType._zod.run({value:t[l],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Le(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...Le(l,u.issues)),r.value[l]=u.value)}let c;for(let l in t)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:t,inst:n,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&So.test(a)&&c.issues.length){let p=e.keyType._zod.run({value:Number(a),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){e.mode==="loose"?r.value[a]=t[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>Pe(p,i,me())),input:a,path:[a],inst:n});continue}let u=e.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Le(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...Le(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),bu=x("$ZodMap",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:t,inst:n}),r;let o=[];r.value=new Map;for(let[s,a]of t){let c=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,p])=>{Hh(u,p,r,s,t,n,i)})):Hh(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function Hh(n,e,r,i,t,o,s){n.issues.length&&(Dr.has(typeof i)?r.issues.push(...Le(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>Pe(a,s,me()))})),e.issues.length&&(Dr.has(typeof i)?r.issues.push(...Le(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>Pe(a,s,me()))})),r.value.set(n.value,e.value)}var xu=x("$ZodSet",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Set))return r.issues.push({input:t,inst:n,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of t){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>Wh(c,r))):Wh(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function Wh(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var Su=x("$ZodEnum",(n,e)=>{K.init(n,e);let r=Nr(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>Dr.has(typeof t)).map(t=>typeof t=="string"?Ze(t):t.toString()).join("|")})$`),n._zod.parse=(t,o)=>{let s=t.value;return i.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:n}),t}}),$u=x("$ZodLiteral",(n,e)=>{if(K.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ze(i):i?Ze(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,t)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),i}}),ku=x("$ZodFile",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return t instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:t,inst:n}),r}}),wu=x("$ZodTransform",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Lt(n.constructor.name);let t=e.transform(r.value,r);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(s=>(r.value=s,r));if(t instanceof Promise)throw new Xe;return r.value=t,r}});function Bh(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var Do=x("$ZodOptional",(n,e)=>{K.init(n,e),n._zod.optin="optional",n._zod.optout="optional",ee(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ee(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${zr(r.source)})?$`):void 0}),n._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Bh(o,r.value)):Bh(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),Eu=x("$ZodExactOptional",(n,e)=>{Do.init(n,e),ee(n._zod,"values",()=>e.innerType._zod.values),ee(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Iu=x("$ZodNullable",(n,e)=>{K.init(n,e),ee(n._zod,"optin",()=>e.innerType._zod.optin),ee(n._zod,"optout",()=>e.innerType._zod.optout),ee(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${zr(r.source)}|null)$`):void 0}),ee(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),Tu=x("$ZodDefault",(n,e)=>{K.init(n,e),n._zod.optin="optional",ee(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Jh(o,e)):Jh(t,e)}});function Jh(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var Pu=x("$ZodPrefault",(n,e)=>{K.init(n,e),n._zod.optin="optional",ee(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),Ru=x("$ZodNonOptional",(n,e)=>{K.init(n,e),ee(n._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),n._zod.parse=(r,i)=>{let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Gh(o,n)):Gh(t,n)}});function Gh(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}var Nu=x("$ZodSuccess",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Lt("ZodSuccess");let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.issues.length===0,r)):(r.value=t.issues.length===0,r)}}),zu=x("$ZodCatch",(n,e)=>{K.init(n,e),ee(n._zod,"optin",()=>e.innerType._zod.optin),ee(n._zod,"optout",()=>e.innerType._zod.optout),ee(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>Pe(s,i,me()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>Pe(o,i,me()))},input:r.value}),r.issues=[]),r)}}),Du=x("$ZodNaN",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:n,expected:"nan",code:"invalid_type"}),r)}),Ou=x("$ZodPipe",(n,e)=>{K.init(n,e),ee(n._zod,"values",()=>e.in._zod.values),ee(n._zod,"optin",()=>e.in._zod.optin),ee(n._zod,"optout",()=>e.out._zod.optout),ee(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Eo(s,e.in,i)):Eo(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>Eo(o,e.out,i)):Eo(t,e.out,i)}});function Eo(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var Wr=x("$ZodCodec",(n,e)=>{K.init(n,e),ee(n._zod,"values",()=>e.in._zod.values),ee(n._zod,"optin",()=>e.in._zod.optin),ee(n._zod,"optout",()=>e.out._zod.optout),ee(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>Io(s,e,i)):Io(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Io(s,e,i)):Io(o,e,i)}}});function Io(n,e,r){if(n.issues.length)return n.aborted=!0,n;if((r.direction||"forward")==="forward"){let t=e.transform(n.value,n);return t instanceof Promise?t.then(o=>To(n,o,e.out,r)):To(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>To(n,o,e.in,r)):To(n,t,e.in,r)}}function To(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var Au=x("$ZodReadonly",(n,e)=>{K.init(n,e),ee(n._zod,"propValues",()=>e.innerType._zod.propValues),ee(n._zod,"values",()=>e.innerType._zod.values),ee(n._zod,"optin",()=>e.innerType?._zod?.optin),ee(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(Vh):Vh(t)}});function Vh(n){return n.value=Object.freeze(n.value),n}var Lu=x("$ZodTemplateLiteral",(n,e)=>{K.init(n,e);let r=[];for(let i of e.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 t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(o,s))}else if(i===null||Rc.has(typeof i))r.push(Ze(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);n._zod.pattern=new RegExp(`^${r.join("")}$`),n._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:n,expected:"string",code:"invalid_type"}),i):(n._zod.pattern.lastIndex=0,n._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:n,code:"invalid_format",format:e.format??"template_literal",pattern:n._zod.pattern.source}),i)}),Cu=x("$ZodFunction",(n,e)=>(K.init(n,e),n._def=e,n._zod.def=e,n.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let t=n._def.input?uo(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?uo(n._def.output,o):o}},n.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let t=n._def.input?await po(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await po(n._def.output,o):o}},n._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:n}),r):(n._def.output&&n._def.output._zod.def.type==="promise"?r.value=n.implementAsync(r.value):r.value=n.implement(r.value),r),n.input=(...r)=>{let i=n.constructor;return Array.isArray(r[0])?new i({type:"function",input:new zo({type:"tuple",items:r[0],rest:r[1]}),output:n._def.output}):new i({type:"function",input:r[0],output:n._def.output})},n.output=r=>{let i=n.constructor;return new i({type:"function",input:n._def.input,output:r})},n)),ju=x("$ZodPromise",(n,e)=>{K.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),Mu=x("$ZodLazy",(n,e)=>{K.init(n,e),ee(n._zod,"innerType",()=>e.getter()),ee(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),ee(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),ee(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),ee(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=(r,i)=>n._zod.innerType._zod.run(r,i)}),Uu=x("$ZodCustom",(n,e)=>{se.init(n,e),K.init(n,e),n._zod.parse=(r,i)=>r,n._zod.check=r=>{let i=r.value,t=e.fn(i);if(t instanceof Promise)return t.then(o=>qh(o,r,i,n));qh(t,r,i,n)}});function qh(n,e,r,i){if(!n){let t={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),e.issues.push(zn(t))}}var Jr={};Me(Jr,{ar:()=>tg,az:()=>ng,be:()=>ig,bg:()=>og,ca:()=>sg,cs:()=>ag,da:()=>cg,de:()=>lg,en:()=>Oo,eo:()=>ug,es:()=>pg,fa:()=>dg,fi:()=>mg,fr:()=>fg,frCA:()=>hg,he:()=>gg,hu:()=>yg,hy:()=>_g,id:()=>bg,is:()=>xg,it:()=>Sg,ja:()=>$g,ka:()=>kg,kh:()=>wg,km:()=>Ao,ko:()=>Eg,lt:()=>Tg,mk:()=>Pg,ms:()=>Rg,nl:()=>Ng,no:()=>zg,ota:()=>Dg,pl:()=>Ag,ps:()=>Og,pt:()=>Lg,ru:()=>jg,sl:()=>Mg,sv:()=>Ug,ta:()=>Fg,th:()=>Zg,tr:()=>Hg,ua:()=>Wg,uk:()=>Lo,ur:()=>Bg,uz:()=>Jg,vi:()=>Gg,yo:()=>Kg,zhCN:()=>Vg,zhTW:()=>qg});var _S=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return t.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${N(t.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${t.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.format]??t.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${t.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${t.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${t.keys.length>1?"\u0629":""}: ${w(t.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function tg(){return{localeError:_S()}}var bS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${t.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return t.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${N(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??t.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${t.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${t.keys.length>1?"lar":""}: ${w(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${t.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function ng(){return{localeError:bS()}}function rg(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var xS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${t.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${N(t.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=rg(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=rg(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${t.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(t.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${t.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function ig(){return{localeError:xS()}}var SS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${N(t.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 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.maximum.toString()} ${s.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 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??t.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 ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${t.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u043E\u0432\u0435":""}: ${w(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${t.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 ${t.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function og(){return{localeError:SS()}}var $S=()=>{let n={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${t.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return t.values.length===1?`Valor inv\xE0lid: s'esperava ${N(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(t.values," o ")}`;case"too_big":{let o=t.inclusive?"com a m\xE0xim":"menys de",s=e(t.origin);return s?`Massa gran: s'esperava que ${t.origin??"el valor"} contingu\xE9s ${o} ${t.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(t.origin);return s?`Massa petit: s'esperava que ${t.origin} contingu\xE9s ${o} ${t.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${t.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${t.origin}`;default:return"Entrada inv\xE0lida"}}};function sg(){return{localeError:$S()}}var kS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${t.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return t.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${N(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??t.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${t.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(t.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${t.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${t.origin}`;default:return"Neplatn\xFD vstup"}}};function ag(){return{localeError:kS()}}var wS=()=>{let n={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig v\xE6rdi: forventede ${N(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${t.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${t.origin}`;default:return"Ugyldigt input"}}};function cg(){return{localeError:wS()}}var ES=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${t.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return t.values.length===1?`Ung\xFCltige Eingabe: erwartet ${N(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ist`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ist`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??t.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(t.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${t.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${t.origin}`;default:return"Ung\xFCltige Eingabe"}}};function lg(){return{localeError:ES()}}var IS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${N(t.values[0])}`:`Invalid option: expected one of ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Too big: expected ${t.origin??"value"} to have ${o}${t.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${t.origin??"value"} to be ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Too small: expected ${t.origin} to have ${o}${t.minimum.toString()} ${s.unit}`:`Too small: expected ${t.origin} to be ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${t.divisor}`;case"unrecognized_keys":return`Unrecognized key${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Invalid key in ${t.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${t.origin}`;default:return"Invalid input"}}};function Oo(){return{localeError:IS()}}var TS=()=>{let n={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${t.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendi\u011Dis ${N(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Tro malgranda: atendi\u011Dis ke ${t.origin} havu ${o}${t.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${t.origin} estu ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} \u015Dlosilo${t.keys.length>1?"j":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function ug(){return{localeError:TS()}}var PS=()=>{let n={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${t.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: se esperaba ${N(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${t.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[t.origin]??t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[t.origin]??t.origin}`;default:return"Entrada inv\xE1lida"}}};function pg(){return{localeError:PS()}}var RS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${t.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return t.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${N(t.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(t.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??t.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${t.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${t.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(t.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${t.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${t.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function dg(){return{localeError:RS()}}var NS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return t.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${N(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${t.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${t.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function mg(){return{localeError:NS()}}var zS=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}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={nan:"NaN",number:"nombre",array:"tableau"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : instanceof ${t.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : ${N(t.values[0])} attendu`:`Option invalide : une valeur parmi ${w(t.values,"|")} attendue`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Trop grand : ${t.origin??"valeur"} doit ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${t.origin??"valeur"} doit \xEAtre ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Trop petit : ${t.origin} doit ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : ${t.origin} doit \xEAtre ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${w(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function fg(){return{localeError:zS()}}var DS=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : attendu instanceof ${t.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : attendu ${N(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u2264":"<",s=e(t.origin);return s?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${o}${t.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u2265":">",s=e(t.origin);return s?`Trop petit : attendu que ${t.origin} ait ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${t.origin} soit ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${w(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function hg(){return{localeError:DS()}}var OS=()=>{let n={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"}},e={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=l=>l?n[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??n.unknown.label},t=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={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"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=c[u??""]??i(u),d=z(l.input),m=c[d]??n[d]?.label??d;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(l.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 ${N(l.values[0])}`;let u=l.values.map(m=>N(m));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?"<=":"<",m=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let _=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?">=":">",m=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let p=a[u.format],d=p?.label??u.format,f=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${d} \u05DC\u05D0 ${f}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(l.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${t(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function gg(){return{localeError:OS()}}var AS=()=>{let n={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${t.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return t.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${N(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xFAl nagy: ${t.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${t.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${t.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} m\xE9rete t\xFAl kicsi ${o}${t.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} t\xFAl kicsi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??t.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${t.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${t.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${t.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function yg(){return{localeError:AS()}}function vg(n,e,r){return Math.abs(n)===1?e:r}function jn(n){if(!n)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=n[n.length-1];return n+(e.includes(r)?"\u0576":"\u0568")}var LS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return t.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 ${N(t.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 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=vg(a,s.unit.one,s.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 ${jn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.maximum.toString()} ${c}`}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 ${jn(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=vg(a,s.unit.one,s.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 ${jn(t.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.minimum.toString()} ${c}`}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 ${jn(t.origin)} \u056C\u056B\u0576\u056B ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??t.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 ${t.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${t.keys.length>1?"\u0576\u0565\u0580":""}. ${w(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${jn(t.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 ${jn(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function _g(){return{localeError:LS()}}var CS=()=>{let n={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${N(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: diharapkan ${t.origin} memiliki ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function bg(){return{localeError:CS()}}var jS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${t.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${N(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} hafi ${o}${t.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} s\xE9 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} hafi ${o}${t.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} s\xE9 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??t.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${w(t.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${t.origin}`;default:return"Rangt gildi"}}};function xg(){return{localeError:jS()}}var MS=()=>{let n={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${N(t.values[0])}`:`Opzione non valida: atteso uno tra ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Troppo grande: ${t.origin??"valore"} deve avere ${o}${t.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Troppo piccolo: ${t.origin} deve avere ${o}${t.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${t.origin} deve essere ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${w(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function Sg(){return{localeError:MS()}}var US=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${t.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return t.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${N(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(t.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=t.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(t.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=t.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(t.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${t.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${t.keys.length>1?"\u7FA4":""}: ${w(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function $g(){return{localeError:US()}}var FS=()=>{let n={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 e(t){return n[t]??null}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 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return t.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 ${N(t.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(t.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\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 ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.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 ${t.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??t.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 ${t.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${t.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(t.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${t.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 ${t.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function kg(){return{localeError:FS()}}var ZS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return t.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${N(t.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${t.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(t.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Ao(){return{localeError:ZS()}}function wg(){return Ao()}var HS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${t.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return t.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${N(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(t.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=t.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()} ${o}${s}`}case"too_small":{let o=t.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??t.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${t.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(t.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${t.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${t.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Eg(){return{localeError:HS()}}var Br=n=>n.charAt(0).toUpperCase()+n.slice(1);function Ig(n){let e=Math.abs(n),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var WS=()=>{let n={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 e(t,o,s,a){let c=n[t]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${t.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return t.values.length===1?`Privalo b\u016Bti ${N(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,Ig(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${Br(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.maximum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Br(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[t.origin]??t.origin,s=e(t.origin,Ig(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${Br(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.minimum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Br(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??t.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${w(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[t.origin]??t.origin;return`${Br(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Tg(){return{localeError:WS()}}var BS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${t.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${N(t.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(t.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${t.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${t.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Pg(){return{localeError:BS()}}var JS=()=>{let n={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${N(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: dijangka ${t.origin??"nilai"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: dijangka ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function Rg(){return{localeError:JS()}}var GS=()=>{let n={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${N(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} is`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} is`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function Ng(){return{localeError:GS()}}var VS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${N(t.values[0])}`:`Ugyldig valg: forventet en av ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function zg(){return{localeError:VS()}}var qS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`F\xE2sit giren: umulan instanceof ${t.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`F\xE2sit giren: umulan ${N(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=t;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??t.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${t.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${t.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Dg(){return{localeError:qS()}}var KS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${t.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return t.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${N(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(t.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0648\u064A`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??t.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${t.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${t.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(t.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${t.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${t.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Og(){return{localeError:KS()}}var YS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${t.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return t.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${N(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??t.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${t.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${t.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Ag(){return{localeError:YS()}}var XS=()=>{let n={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipo inv\xE1lido: esperado instanceof ${t.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: esperado ${N(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Muito pequeno: esperado que ${t.origin} tivesse ${o}${t.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??t.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${w(t.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${t.origin}`;default:return"Campo inv\xE1lido"}}};function Lg(){return{localeError:XS()}}function Cg(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var QS=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${N(t.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Cg(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Cg(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${t.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0438":""}: ${w(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function jg(){return{localeError:QS()}}var e$=()=>{let n={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${t.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${N(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} imelo ${o}${t.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${t.origin} imelo ${o}${t.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??t.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(t.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Mg(){return{localeError:e$()}}var t$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${t.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${N(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${t.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Ug(){return{localeError:t$()}}var n$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return t.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${N(t.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(t.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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[o.format]??t.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${t.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${t.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Fg(){return{localeError:n$()}}var r$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return t.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${N(t.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${t.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(t.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Zg(){return{localeError:r$()}}var i$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${t.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${N(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??t.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${t.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${t.keys.length>1?"lar":""}: ${w(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${t.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Hg(){return{localeError:i$()}}var o$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${N(t.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} \u0431\u0443\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0456":""}: ${w(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${t.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Lo(){return{localeError:o$()}}function Wg(){return Lo()}var s$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${t.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return t.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${N(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(t.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${t.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u06D2 ${o}${t.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u0627 ${o}${t.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${t.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${t.keys.length>1?"\u0632":""}: ${w(t.keys,"\u060C ")}`;case"invalid_key":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Bg(){return{localeError:s$()}}var a$=()=>{let n={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"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return t.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${N(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??t.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${t.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${t.keys.length>1?"lar":""}: ${w(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${t.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Jg(){return{localeError:a$()}}var c$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${t.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return t.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${N(t.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??t.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${t.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(t.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Gg(){return{localeError:c$()}}var l$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${t.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return t.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${N(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??t.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${t.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${t.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Vg(){return{localeError:l$()}}var u$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${t.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return t.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${N(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${t.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${t.keys.length>1?"\u5011":""}\uFF1A${w(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function qg(){return{localeError:u$()}}var p$=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=z(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${t.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return t.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${N(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin??"iye"} ${s.verb} ${o}${t.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.maximum}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin} ${s.verb} ${o}${t.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.minimum}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??t.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 ${t.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(t.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${t.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 ${t.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Kg(){return{localeError:p$()}}var Yg,Fu=Symbol("ZodOutput"),Zu=Symbol("ZodInput"),Co=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let t={...i,...this._map.get(e)};return Object.keys(t).length?t:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function jo(){return new Co}(Yg=globalThis).__zod_globalRegistry??(Yg.__zod_globalRegistry=jo());var _e=globalThis.__zod_globalRegistry;function Hu(n,e){return new n({type:"string",...A(e)})}function Wu(n,e){return new n({type:"string",coerce:!0,...A(e)})}function Mo(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...A(e)})}function Gr(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...A(e)})}function Uo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...A(e)})}function Fo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(e)})}function Zo(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(e)})}function Ho(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(e)})}function Vr(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...A(e)})}function Wo(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...A(e)})}function Bo(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(e)})}function Jo(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...A(e)})}function Go(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(e)})}function Vo(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...A(e)})}function qo(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...A(e)})}function Ko(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(e)})}function Yo(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(e)})}function Xo(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(e)})}function Bu(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...A(e)})}function Qo(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(e)})}function es(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(e)})}function ts(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...A(e)})}function ns(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...A(e)})}function rs(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...A(e)})}function is(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...A(e)})}var Ju={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Gu(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(e)})}function Vu(n,e){return new n({type:"string",format:"date",check:"string_format",...A(e)})}function qu(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...A(e)})}function Ku(n,e){return new n({type:"string",format:"duration",check:"string_format",...A(e)})}function Yu(n,e){return new n({type:"number",checks:[],...A(e)})}function Xu(n,e){return new n({type:"number",coerce:!0,checks:[],...A(e)})}function Qu(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...A(e)})}function ep(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...A(e)})}function tp(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...A(e)})}function np(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...A(e)})}function rp(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...A(e)})}function ip(n,e){return new n({type:"boolean",...A(e)})}function op(n,e){return new n({type:"boolean",coerce:!0,...A(e)})}function sp(n,e){return new n({type:"bigint",...A(e)})}function ap(n,e){return new n({type:"bigint",coerce:!0,...A(e)})}function cp(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(e)})}function lp(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(e)})}function up(n,e){return new n({type:"symbol",...A(e)})}function pp(n,e){return new n({type:"undefined",...A(e)})}function dp(n,e){return new n({type:"null",...A(e)})}function mp(n){return new n({type:"any"})}function fp(n){return new n({type:"unknown"})}function hp(n,e){return new n({type:"never",...A(e)})}function gp(n,e){return new n({type:"void",...A(e)})}function yp(n,e){return new n({type:"date",...A(e)})}function vp(n,e){return new n({type:"date",coerce:!0,...A(e)})}function _p(n,e){return new n({type:"nan",...A(e)})}function ot(n,e){return new $o({check:"less_than",...A(e),value:n,inclusive:!1})}function Ce(n,e){return new $o({check:"less_than",...A(e),value:n,inclusive:!0})}function st(n,e){return new ko({check:"greater_than",...A(e),value:n,inclusive:!1})}function ke(n,e){return new ko({check:"greater_than",...A(e),value:n,inclusive:!0})}function os(n){return st(0,n)}function ss(n){return ot(0,n)}function as(n){return Ce(0,n)}function cs(n){return ke(0,n)}function Ft(n,e){return new dl({check:"multiple_of",...A(e),value:n})}function Zt(n,e){return new hl({check:"max_size",...A(e),maximum:n})}function at(n,e){return new gl({check:"min_size",...A(e),minimum:n})}function an(n,e){return new yl({check:"size_equals",...A(e),size:n})}function cn(n,e){return new vl({check:"max_length",...A(e),maximum:n})}function bt(n,e){return new _l({check:"min_length",...A(e),minimum:n})}function ln(n,e){return new bl({check:"length_equals",...A(e),length:n})}function Mn(n,e){return new xl({check:"string_format",format:"regex",...A(e),pattern:n})}function Un(n){return new Sl({check:"string_format",format:"lowercase",...A(n)})}function Fn(n){return new $l({check:"string_format",format:"uppercase",...A(n)})}function Zn(n,e){return new kl({check:"string_format",format:"includes",...A(e),includes:n})}function Hn(n,e){return new wl({check:"string_format",format:"starts_with",...A(e),prefix:n})}function Wn(n,e){return new El({check:"string_format",format:"ends_with",...A(e),suffix:n})}function ls(n,e,r){return new Il({check:"property",property:n,schema:e,...A(r)})}function Bn(n,e){return new Tl({check:"mime_type",mime:n,...A(e)})}function Qe(n){return new Pl({check:"overwrite",tx:n})}function Jn(n){return Qe(e=>e.normalize(n))}function Gn(){return Qe(n=>n.trim())}function Vn(){return Qe(n=>n.toLowerCase())}function qn(){return Qe(n=>n.toUpperCase())}function Kn(){return Qe(n=>Ic(n))}function bp(n,e,r){return new n({type:"array",element:e,...A(r)})}function m$(n,e,r){return new n({type:"union",options:e,...A(r)})}function f$(n,e,r){return new n({type:"union",options:e,inclusive:!1,...A(r)})}function h$(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...A(i)})}function g$(n,e,r){return new n({type:"intersection",left:e,right:r})}function y$(n,e,r,i){let t=r instanceof K,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...A(o)})}function v$(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...A(i)})}function _$(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...A(i)})}function b$(n,e,r){return new n({type:"set",valueType:e,...A(r)})}function x$(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...A(r)})}function S$(n,e,r){return new n({type:"enum",entries:e,...A(r)})}function $$(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...A(r)})}function xp(n,e){return new n({type:"file",...A(e)})}function k$(n,e){return new n({type:"transform",transform:e})}function w$(n,e){return new n({type:"optional",innerType:e})}function E$(n,e){return new n({type:"nullable",innerType:e})}function I$(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Pc(r)}})}function T$(n,e,r){return new n({type:"nonoptional",innerType:e,...A(r)})}function P$(n,e){return new n({type:"success",innerType:e})}function R$(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function N$(n,e,r){return new n({type:"pipe",in:e,out:r})}function z$(n,e){return new n({type:"readonly",innerType:e})}function D$(n,e,r){return new n({type:"template_literal",parts:e,...A(r)})}function O$(n,e){return new n({type:"lazy",getter:e})}function A$(n,e){return new n({type:"promise",innerType:e})}function Sp(n,e,r){let i=A(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function $p(n,e,r){return new n({type:"custom",check:"custom",fn:e,...A(r)})}function kp(n){let e=Xg(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(zn(i,r.value,e._zod.def));else{let t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),t.continue??(t.continue=!e._zod.def.abort),r.issues.push(zn(t))}},n(r.value,r)));return e}function Xg(n,e){let r=new se({check:"custom",...A(e)});return r._zod.check=n,r}function wp(n){let e=new se({check:"describe"});return e._zod.onattach=[r=>{let i=_e.get(r)??{};_e.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function Ep(n){let e=new se({check:"meta"});return e._zod.onattach=[r=>{let i=_e.get(r)??{};_e.add(r,{...i,...n})}],e._zod.check=()=>{},e}function Ip(n,e){let r=A(e),i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(t),a=n.Codec??Wr,c=n.Boolean??Zr,l=n.String??sn,u=new l({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),d=new a({type:"pipe",in:u,out:p,transform:((m,f)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:f.value,inst:d,continue:!1}),{})}),reverseTransform:((m,f)=>m===!0?i[0]||"true":t[0]||"false"),error:r.error});return d}function Yn(n,e,r,i={}){let t=A(i),o={...A(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...t};return r instanceof RegExp&&(o.pattern=r),new n(o)}function Ht(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??_e,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function ne(n,e,r={path:[],schemaPath:[]}){var i;let t=n._zod.def,o=e.seen.get(n);if(o)return o.count++,r.schemaPath.includes(n)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(n,s);let a=n._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,s.schema,u);else{let d=s.schema,m=e.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(n,e,d,u)}let p=n._zod.parent;p&&(s.ref||(s.ref=p),ne(p,e,u),e.seen.get(p).isParent=!0)}let c=e.metadataRegistry.get(n);return c&&Object.assign(s.schema,c),e.io==="input"&&we(n)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(n).schema}function Wt(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of n.seen.entries()){let a=n.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let t=s=>{let a=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let p=n.external.registry.get(s[0])?.id,d=n.external.uri??(f=>f);if(p)return{ref:d(p)};let m=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${a}/${m}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${n.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=t(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let p in u)delete u[p];u.$ref=c};if(n.cycles==="throw")for(let s of n.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
809
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");let b=m.compile();return(_,x)=>b(d,_,x)},o,s=xn,a=!Qr.jitless,l=a&&sl.value,u=e.catchall,p;n._zod.parse=(d,m)=>{p??(p=i.value);let f=d.value;return s(f)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=t(e.shape)),d=o(d,m),u?uy([],f,d,m,p,n):d):r(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:n}),d)}});function Yg(n,e,r,i){for(let o of n)if(o.issues.length===0)return e.value=o.value,e;let t=n.filter(o=>!nn(o));return t.length===1?(e.value=t[0].value,t[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>je(s,i,ye())))}),e)}var mi=w("$ZodUnion",(n,e)=>{ne.init(n,e),oe(n._zod,"optin",()=>e.options.some(t=>t._zod.optin==="optional")?"optional":void 0),oe(n._zod,"optout",()=>e.options.some(t=>t._zod.optout==="optional")?"optional":void 0),oe(n._zod,"values",()=>{if(e.options.every(t=>t._zod.values))return new Set(e.options.flatMap(t=>Array.from(t._zod.values)))}),oe(n._zod,"pattern",()=>{if(e.options.every(t=>t._zod.pattern)){let t=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${t.map(o=>ni(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>Yg(c,t,n,o)):Yg(a,t,n,o)}});function Xg(n,e,r,i){let t=n.filter(o=>o.issues.length===0);return t.length===1?(e.value=t[0].value,e):(t.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:n.map(o=>o.issues.map(s=>je(s,i,ye())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Vu=w("$ZodXor",(n,e)=>{mi.init(n,e),e.inclusive=!1;let r=e.options.length===1,i=e.options[0]._zod.run;n._zod.parse=(t,o)=>{if(r)return i(t,o);let s=!1,a=[];for(let c of e.options){let l=c._zod.run({value:t.value,issues:[]},o);l instanceof Promise?(a.push(l),s=!0):a.push(l)}return s?Promise.all(a).then(c=>Xg(c,t,n,o)):Xg(a,t,n,o)}}),qu=w("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,mi.init(n,e);let r=n._zod.parse;oe(n._zod,"propValues",()=>{let t={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){t[a]||(t[a]=new Set);for(let l of c)t[a].add(l)}}return t});let i=Yn(()=>{let t=e.options,o=new Map;for(let s of t){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});n._zod.parse=(t,o)=>{let s=t.value;if(!xn(s))return t.issues.push({code:"invalid_type",expected:"object",input:s,inst:n}),t;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(t,o):e.unionFallback?r(t,o):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:n}),t)}}),Ku=w("$ZodIntersection",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value,o=e.left._zod.run({value:t,issues:[]},i),s=e.right._zod.run({value:t,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>Qg(r,c,l)):Qg(r,o,s)}});function lu(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(tn(n)&&tn(e)){let r=Object.keys(e),i=Object.keys(n).filter(o=>r.indexOf(o)!==-1),t={...n,...e};for(let o of i){let s=lu(n[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t[o]=s.data}return{valid:!0,data:t}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<n.length;i++){let t=n[i],o=e[i],s=lu(t,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Qg(n,e,r){let i=new Map,t;for(let a of e.issues)if(a.code==="unrecognized_keys"){t??(t=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else n.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else n.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&t&&n.issues.push({...t,keys:o}),nn(n))return n;let s=lu(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return n.value=s.data,n}var ss=w("$ZodTuple",(n,e)=>{ne.init(n,e);let r=e.items;n._zod.parse=(i,t)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:n,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!e.rest){let u=o.length>r.length,p=o.length<c-1;if(u||p)return i.issues.push({...u?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:n,origin:"array"}),i}let l=-1;for(let u of r){if(l++,l>=o.length&&l>=c)continue;let p=u._zod.run({value:o[l],issues:[]},t);p instanceof Promise?s.push(p.then(d=>Qo(d,i,l))):Qo(p,i,l)}if(e.rest){let u=o.slice(r.length);for(let p of u){l++;let d=e.rest._zod.run({value:p,issues:[]},t);d instanceof Promise?s.push(d.then(m=>Qo(m,i,l))):Qo(d,i,l)}}return s.length?Promise.all(s).then(()=>i):i}});function Qo(n,e,r){n.issues.length&&e.issues.push(...Ge(r,n.issues)),e.value[r]=n.value}var Yu=w("$ZodRecord",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!tn(t))return r.issues.push({expected:"record",code:"invalid_type",input:t,inst:n}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.valueType._zod.run({value:t[l],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Ge(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...Ge(l,u.issues)),r.value[l]=u.value)}let c;for(let l in t)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:t,inst:n,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Ko.test(a)&&c.issues.length){let p=e.keyType._zod.run({value:Number(a),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){e.mode==="loose"?r.value[a]=t[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>je(p,i,ye())),input:a,path:[a],inst:n});continue}let u=e.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...Ge(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...Ge(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Xu=w("$ZodMap",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:t,inst:n}),r;let o=[];r.value=new Map;for(let[s,a]of t){let c=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,p])=>{ey(u,p,r,s,t,n,i)})):ey(c,l,r,s,t,n,i)}return o.length?Promise.all(o).then(()=>r):r}});function ey(n,e,r,i,t,o,s){n.issues.length&&(ri.has(typeof i)?r.issues.push(...Ge(i,n.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:n.issues.map(a=>je(a,s,ye()))})),e.issues.length&&(ri.has(typeof i)?r.issues.push(...Ge(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:e.issues.map(a=>je(a,s,ye()))})),r.value.set(n.value,e.value)}var Qu=w("$ZodSet",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;if(!(t instanceof Set))return r.issues.push({input:t,inst:n,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of t){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>ty(c,r))):ty(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function ty(n,e){n.issues.length&&e.issues.push(...n.issues),e.value.add(n.value)}var ep=w("$ZodEnum",(n,e)=>{ne.init(n,e);let r=ti(e.entries),i=new Set(r);n._zod.values=i,n._zod.pattern=new RegExp(`^(${r.filter(t=>ri.has(typeof t)).map(t=>typeof t=="string"?Ye(t):t.toString()).join("|")})$`),n._zod.parse=(t,o)=>{let s=t.value;return i.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:n}),t}}),tp=w("$ZodLiteral",(n,e)=>{if(ne.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ye(i):i?Ye(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,t)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),i}}),np=w("$ZodFile",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{let t=r.value;return t instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:t,inst:n}),r}}),rp=w("$ZodTransform",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Xt(n.constructor.name);let t=e.transform(r.value,r);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(s=>(r.value=s,r));if(t instanceof Promise)throw new ct;return r.value=t,r}});function ny(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}var as=w("$ZodOptional",(n,e)=>{ne.init(n,e),n._zod.optin="optional",n._zod.optout="optional",oe(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),oe(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ni(r.source)})?$`):void 0}),n._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>ny(o,r.value)):ny(t,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),ip=w("$ZodExactOptional",(n,e)=>{as.init(n,e),oe(n._zod,"values",()=>e.innerType._zod.values),oe(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),op=w("$ZodNullable",(n,e)=>{ne.init(n,e),oe(n._zod,"optin",()=>e.innerType._zod.optin),oe(n._zod,"optout",()=>e.innerType._zod.optout),oe(n._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ni(r.source)}|null)$`):void 0}),oe(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),sp=w("$ZodDefault",(n,e)=>{ne.init(n,e),n._zod.optin="optional",oe(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>ry(o,e)):ry(t,e)}});function ry(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}var ap=w("$ZodPrefault",(n,e)=>{ne.init(n,e),n._zod.optin="optional",oe(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),cp=w("$ZodNonOptional",(n,e)=>{ne.init(n,e),oe(n._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),n._zod.parse=(r,i)=>{let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>iy(o,n)):iy(t,n)}});function iy(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}var lp=w("$ZodSuccess",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Xt("ZodSuccess");let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.issues.length===0,r)):(r.value=t.issues.length===0,r)}}),up=w("$ZodCatch",(n,e)=>{ne.init(n,e),oe(n._zod,"optin",()=>e.innerType._zod.optin),oe(n._zod,"optout",()=>e.innerType._zod.optout),oe(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>je(s,i,ye()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=e.catchValue({...r,error:{issues:t.issues.map(o=>je(o,i,ye()))},input:r.value}),r.issues=[]),r)}}),pp=w("$ZodNaN",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:n,expected:"nan",code:"invalid_type"}),r)}),dp=w("$ZodPipe",(n,e)=>{ne.init(n,e),oe(n._zod,"values",()=>e.in._zod.values),oe(n._zod,"optin",()=>e.in._zod.optin),oe(n._zod,"optout",()=>e.out._zod.optout),oe(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>es(s,e.in,i)):es(o,e.in,i)}let t=e.in._zod.run(r,i);return t instanceof Promise?t.then(o=>es(o,e.out,i)):es(t,e.out,i)}});function es(n,e,r){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},r)}var fi=w("$ZodCodec",(n,e)=>{ne.init(n,e),oe(n._zod,"values",()=>e.in._zod.values),oe(n._zod,"optin",()=>e.in._zod.optin),oe(n._zod,"optout",()=>e.out._zod.optout),oe(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>ts(s,e,i)):ts(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>ts(s,e,i)):ts(o,e,i)}}});function ts(n,e,r){if(n.issues.length)return n.aborted=!0,n;if((r.direction||"forward")==="forward"){let t=e.transform(n.value,n);return t instanceof Promise?t.then(o=>ns(n,o,e.out,r)):ns(n,t,e.out,r)}else{let t=e.reverseTransform(n.value,n);return t instanceof Promise?t.then(o=>ns(n,o,e.in,r)):ns(n,t,e.in,r)}}function ns(n,e,r,i){return n.issues.length?(n.aborted=!0,n):r._zod.run({value:e,issues:n.issues},i)}var mp=w("$ZodReadonly",(n,e)=>{ne.init(n,e),oe(n._zod,"propValues",()=>e.innerType._zod.propValues),oe(n._zod,"values",()=>e.innerType._zod.values),oe(n._zod,"optin",()=>e.innerType?._zod?.optin),oe(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let t=e.innerType._zod.run(r,i);return t instanceof Promise?t.then(oy):oy(t)}});function oy(n){return n.value=Object.freeze(n.value),n}var fp=w("$ZodTemplateLiteral",(n,e)=>{ne.init(n,e);let r=[];for(let i of e.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 t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(o,s))}else if(i===null||cl.has(typeof i))r.push(Ye(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);n._zod.pattern=new RegExp(`^${r.join("")}$`),n._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:n,expected:"string",code:"invalid_type"}),i):(n._zod.pattern.lastIndex=0,n._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:n,code:"invalid_format",format:e.format??"template_literal",pattern:n._zod.pattern.source}),i)}),hp=w("$ZodFunction",(n,e)=>(ne.init(n,e),n._def=e,n._zod.def=e,n.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let t=n._def.input?jo(n._def.input,i):i,o=Reflect.apply(r,this,t);return n._def.output?jo(n._def.output,o):o}},n.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let t=n._def.input?await Fo(n._def.input,i):i,o=await Reflect.apply(r,this,t);return n._def.output?await Fo(n._def.output,o):o}},n._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:n}),r):(n._def.output&&n._def.output._zod.def.type==="promise"?r.value=n.implementAsync(r.value):r.value=n.implement(r.value),r),n.input=(...r)=>{let i=n.constructor;return Array.isArray(r[0])?new i({type:"function",input:new ss({type:"tuple",items:r[0],rest:r[1]}),output:n._def.output}):new i({type:"function",input:r[0],output:n._def.output})},n.output=r=>{let i=n.constructor;return new i({type:"function",input:n._def.input,output:r})},n)),gp=w("$ZodPromise",(n,e)=>{ne.init(n,e),n._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>e.innerType._zod.run({value:t,issues:[]},i))}),yp=w("$ZodLazy",(n,e)=>{ne.init(n,e),oe(n._zod,"innerType",()=>e.getter()),oe(n._zod,"pattern",()=>n._zod.innerType?._zod?.pattern),oe(n._zod,"propValues",()=>n._zod.innerType?._zod?.propValues),oe(n._zod,"optin",()=>n._zod.innerType?._zod?.optin??void 0),oe(n._zod,"optout",()=>n._zod.innerType?._zod?.optout??void 0),n._zod.parse=(r,i)=>n._zod.innerType._zod.run(r,i)}),bp=w("$ZodCustom",(n,e)=>{pe.init(n,e),ne.init(n,e),n._zod.parse=(r,i)=>r,n._zod.check=r=>{let i=r.value,t=e.fn(i);if(t instanceof Promise)return t.then(o=>sy(o,r,i,n));sy(t,r,i,n)}});function sy(n,e,r,i){if(!n){let t={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),e.issues.push(Xn(t))}}var gi={};Ze(gi,{ar:()=>dy,az:()=>my,be:()=>hy,bg:()=>gy,ca:()=>yy,cs:()=>by,da:()=>vy,de:()=>_y,en:()=>cs,eo:()=>xy,es:()=>Sy,fa:()=>$y,fi:()=>wy,fr:()=>ky,frCA:()=>Ey,he:()=>Iy,hu:()=>Ty,hy:()=>Py,id:()=>Ny,is:()=>zy,it:()=>Cy,ja:()=>Ay,ka:()=>Dy,kh:()=>Ly,km:()=>ls,ko:()=>Oy,lt:()=>jy,mk:()=>Fy,ms:()=>Uy,nl:()=>Zy,no:()=>Hy,ota:()=>Wy,pl:()=>Gy,ps:()=>By,pt:()=>Jy,ru:()=>qy,sl:()=>Ky,sv:()=>Yy,ta:()=>Xy,th:()=>Qy,tr:()=>eb,ua:()=>tb,uk:()=>us,ur:()=>nb,uz:()=>rb,vi:()=>ib,yo:()=>ab,zhCN:()=>ob,zhTW:()=>sb});var Rw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return t.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${j(t.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${t.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.format]??t.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${t.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${t.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${t.keys.length>1?"\u0629":""}: ${T(t.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function dy(){return{localeError:Rw()}}var Pw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${t.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return t.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${j(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??t.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${t.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${t.keys.length>1?"lar":""}: ${T(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${t.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function my(){return{localeError:Pw()}}function fy(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var Nw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${t.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${j(t.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=fy(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=fy(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${t.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${t.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${T(t.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${t.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function hy(){return{localeError:Nw()}}var zw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${j(t.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 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.maximum.toString()} ${s.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 ${t.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${t.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??t.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 ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${t.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u043E\u0432\u0435":""}: ${T(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${t.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 ${t.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function gy(){return{localeError:zw()}}var Cw=()=>{let n={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${t.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return t.values.length===1?`Valor inv\xE0lid: s'esperava ${j(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(t.values," o ")}`;case"too_big":{let o=t.inclusive?"com a m\xE0xim":"menys de",s=e(t.origin);return s?`Massa gran: s'esperava que ${t.origin??"el valor"} contingu\xE9s ${o} ${t.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(t.origin);return s?`Massa petit: s'esperava que ${t.origin} contingu\xE9s ${o} ${t.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${t.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${t.origin}`;default:return"Entrada inv\xE0lida"}}};function yy(){return{localeError:Cw()}}var Aw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${t.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return t.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${j(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${o}${t.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??t.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${t.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${T(t.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${t.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${t.origin}`;default:return"Neplatn\xFD vstup"}}};function by(){return{localeError:Aw()}}var Dw=()=>{let n={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldigt input: forventede instanceof ${t.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig v\xE6rdi: forventede ${j(t.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${t.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${T(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${t.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${t.origin}`;default:return"Ugyldigt input"}}};function vy(){return{localeError:Dw()}}var Lw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${t.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return t.values.length===1?`Ung\xFCltige Eingabe: erwartet ${j(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ist`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ist`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??t.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${T(t.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${t.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${t.origin}`;default:return"Ung\xFCltige Eingabe"}}};function _y(){return{localeError:Lw()}}var Ow=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${j(t.values[0])}`:`Invalid option: expected one of ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Too big: expected ${t.origin??"value"} to have ${o}${t.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${t.origin??"value"} to be ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Too small: expected ${t.origin} to have ${o}${t.minimum.toString()} ${s.unit}`:`Too small: expected ${t.origin} to be ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${t.divisor}`;case"unrecognized_keys":return`Unrecognized key${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Invalid key in ${t.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${t.origin}`;default:return"Invalid input"}}};function cs(){return{localeError:Ow()}}var Mw=()=>{let n={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${t.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return t.values.length===1?`Nevalida enigo: atendi\u011Dis ${j(t.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${t.origin??"valoro"} havu ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Tro malgranda: atendi\u011Dis ke ${t.origin} havu ${o}${t.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${t.origin} estu ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??t.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${t.divisor}`;case"unrecognized_keys":return`Nekonata${t.keys.length>1?"j":""} \u015Dlosilo${t.keys.length>1?"j":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${t.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${t.origin}`;default:return"Nevalida enigo"}}};function xy(){return{localeError:Mw()}}var jw=()=>{let n={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${t.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: se esperaba ${j(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=i[t.origin]??t.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${t.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[t.origin]??t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[t.origin]??t.origin}`;default:return"Entrada inv\xE1lida"}}};function Sy(){return{localeError:jw()}}var Fw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${t.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return t.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${j(t.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${T(t.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??t.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${t.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${t.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${T(t.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${t.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${t.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function $y(){return{localeError:Fw()}}var Uw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Virheellinen tyyppi: odotettiin instanceof ${t.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return t.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${j(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${t.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${t.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${T(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function wy(){return{localeError:Uw()}}var Zw=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}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={nan:"NaN",number:"nombre",array:"tableau"};return t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : instanceof ${t.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : ${j(t.values[0])} attendu`:`Option invalide : une valeur parmi ${T(t.values,"|")} attendue`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Trop grand : ${t.origin??"valeur"} doit ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${t.origin??"valeur"} doit \xEAtre ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Trop petit : ${t.origin} doit ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : ${t.origin} doit \xEAtre ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${T(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function ky(){return{localeError:Zw()}}var Hw=()=>{let n={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Entr\xE9e invalide : attendu instanceof ${t.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : attendu ${j(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u2264":"<",s=e(t.origin);return s?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${o}${t.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u2265":">",s=e(t.origin);return s?`Trop petit : attendu que ${t.origin} ait ${o}${t.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${t.origin} soit ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${T(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function Ey(){return{localeError:Hw()}}var Ww=()=>{let n={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"}},e={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=l=>l?n[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??n.unknown.label},t=l=>`\u05D4${i(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={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"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=c[u??""]??i(u),d=F(l.input),m=c[d]??n[d]?.label??d;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(l.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(l.values[0])}`;let u=l.values.map(m=>j(m));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?"<=":"<",m=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),p=t(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let f=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}`}if(l.origin==="array"||l.origin==="set"){let f=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let v=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${f} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let d=l.inclusive?">=":">",m=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${m} ${d}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let p=a[u.format],d=p?.label??u.format,f=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${d} \u05DC\u05D0 ${f}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${T(l.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${t(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Iy(){return{localeError:Ww()}}var Bw=()=>{let n={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${t.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return t.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${j(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xFAl nagy: ${t.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${t.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${t.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} m\xE9rete t\xFAl kicsi ${o}${t.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} t\xFAl kicsi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??t.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${t.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${t.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${t.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Ty(){return{localeError:Bw()}}function Ry(n,e,r){return Math.abs(n)===1?e:r}function ir(n){if(!n)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=n[n.length-1];return n+(e.includes(r)?"\u0576":"\u0568")}var Gw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return t.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(t.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 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Ry(a,s.unit.one,s.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 ${ir(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.maximum.toString()} ${c}`}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 ${ir(t.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Ry(a,s.unit.one,s.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 ${ir(t.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${t.minimum.toString()} ${c}`}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 ${ir(t.origin)} \u056C\u056B\u0576\u056B ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??t.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 ${t.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${t.keys.length>1?"\u0576\u0565\u0580":""}. ${T(t.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ir(t.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 ${ir(t.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Py(){return{localeError:Gw()}}var Jw=()=>{let n={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak valid: diharapkan instanceof ${t.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${j(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: diharapkan ${t.origin} memiliki ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function Ny(){return{localeError:Jw()}}var Vw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${t.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return t.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${j(t.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} hafi ${o}${t.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin??"gildi"} s\xE9 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} hafi ${o}${t.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${t.origin} s\xE9 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??t.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${t.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${t.keys.length>1?"ir lyklar":"ur lykill"}: ${T(t.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${t.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${t.origin}`;default:return"Rangt gildi"}}};function zy(){return{localeError:Vw()}}var qw=()=>{let n={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input non valido: atteso instanceof ${t.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return t.values.length===1?`Input non valido: atteso ${j(t.values[0])}`:`Opzione non valida: atteso uno tra ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Troppo grande: ${t.origin??"valore"} deve avere ${o}${t.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Troppo piccolo: ${t.origin} deve avere ${o}${t.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${t.origin} deve essere ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${T(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function Cy(){return{localeError:qw()}}var Kw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${t.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return t.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${j(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(t.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=t.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(t.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=t.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(t.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${t.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${t.keys.length>1?"\u7FA4":""}: ${T(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Ay(){return{localeError:Kw()}}var Yw=()=>{let n={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 e(t){return n[t]??null}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 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return t.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(t.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 ${T(t.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${t.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\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 ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.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 ${t.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??t.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 ${t.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${t.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${T(t.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${t.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 ${t.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Dy(){return{localeError:Yw()}}var Xw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return t.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${j(t.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${t.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${T(t.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function ls(){return{localeError:Xw()}}function Ly(){return ls()}var Qw=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${t.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return t.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${j(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(t.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=t.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()} ${o}${s}`}case"too_small":{let o=t.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(t.origin),c=a?.unit??"\uC694\uC18C";return a?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()}${c} ${o}${s}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??t.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${t.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${T(t.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${t.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${t.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Oy(){return{localeError:Qw()}}var hi=n=>n.charAt(0).toUpperCase()+n.slice(1);function My(n){let e=Math.abs(n),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var ek=()=>{let n={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 e(t,o,s,a){let c=n[t]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${t.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return t.values.length===1?`Privalo b\u016Bti ${j(t.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(t.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[t.origin]??t.origin,s=e(t.origin,My(Number(t.maximum)),t.inclusive??!1,"smaller");if(s?.verb)return`${hi(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.maximum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${hi(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[t.origin]??t.origin,s=e(t.origin,My(Number(t.minimum)),t.inclusive??!1,"bigger");if(s?.verb)return`${hi(o??t.origin??"reik\u0161m\u0117")} ${s.verb} ${t.minimum.toString()} ${s.unit??"element\u0173"}`;let a=t.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${hi(o??t.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${t.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??t.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${t.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${t.keys.length>1?"i":"as"} rakt${t.keys.length>1?"ai":"as"}: ${T(t.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[t.origin]??t.origin;return`${hi(o??t.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function jy(){return{localeError:ek()}}var tk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${t.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`Invalid input: expected ${j(t.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${t.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${T(t.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${t.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${t.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Fy(){return{localeError:tk()}}var nk=()=>{let n={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Input tidak sah: dijangka instanceof ${t.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${j(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Terlalu besar: dijangka ${t.origin??"nilai"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Terlalu kecil: dijangka ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${T(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function Uy(){return{localeError:nk()}}var rk=()=>{let n={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ongeldige invoer: verwacht instanceof ${t.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${j(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin),a=t.origin==="date"?"laat":t.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} is`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin),a=t.origin==="date"?"vroeg":t.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${t.origin} ${o}${t.minimum.toString()} is`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function Zy(){return{localeError:rk()}}var ik=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ugyldig input: forventet instanceof ${t.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${j(t.values[0])}`:`Ugyldig valg: forventet en av ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${t.origin} til \xE5 ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${T(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Hy(){return{localeError:ik()}}var ok=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`F\xE2sit giren: umulan instanceof ${t.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`F\xE2sit giren: umulan ${j(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${o}${t.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${o}${t.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=t;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??t.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${t.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${t.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Wy(){return{localeError:ok()}}var sk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${t.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return t.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${j(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(t.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${t.maximum.toString()} \u0648\u064A`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${o}${t.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??t.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${t.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${t.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${T(t.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${t.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${t.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function By(){return{localeError:sk()}}var ak=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${t.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return t.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${j(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${t.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??t.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${t.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${t.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Gy(){return{localeError:ak()}}var ck=()=>{let n={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Tipo inv\xE1lido: esperado instanceof ${t.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: esperado ${j(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${o}${t.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Muito pequeno: esperado que ${t.origin} tivesse ${o}${t.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??t.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${T(t.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${t.origin}`;default:return"Campo inv\xE1lido"}}};function Jy(){return{localeError:ck()}}function Vy(n,e,r,i){let t=Math.abs(n),o=t%10,s=t%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var lk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${j(t.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);if(s){let a=Number(t.maximum),c=Vy(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);if(s){let a=Number(t.minimum),c=Vy(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${t.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${t.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0438":""}: ${T(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function qy(){return{localeError:lk()}}var uk=()=>{let n={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${t.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return t.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${j(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} imelo ${o}${t.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${t.origin} imelo ${o}${t.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??t.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${T(t.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Ky(){return{localeError:uk()}}var pk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${t.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return t.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${j(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${t.origin??"v\xE4rdet"} att ha ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${T(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${t.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Yy(){return{localeError:pk()}}var dk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return t.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${j(t.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${T(t.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${t.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${o}${t.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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[o.format]??t.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${t.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${t.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${T(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Xy(){return{localeError:dk()}}var mk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return t.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${j(t.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(t.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??t.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${t.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${T(t.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Qy(){return{localeError:mk()}}var fk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${t.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return t.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${j(t.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${t.origin??"de\u011Fer"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??t.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${t.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${t.keys.length>1?"lar":""}: ${T(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${t.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function eb(){return{localeError:fk()}}var hk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.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 ${t.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return t.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${j(t.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} \u0431\u0443\u0434\u0435 ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0456":""}: ${T(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${t.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function us(){return{localeError:hk()}}function tb(){return us()}var gk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${t.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return t.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${j(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(t.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${t.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${t.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u06D2 ${o}${t.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u0627 ${o}${t.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${t.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${t.keys.length>1?"\u0632":""}: ${T(t.keys,"\u060C ")}`;case"invalid_key":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function nb(){return{localeError:gk()}}var yk=()=>{let n={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"}};function e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${t.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return t.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${j(t.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${t.origin??"qiymat"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??t.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${t.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${t.keys.length>1?"lar":""}: ${T(t.keys,", ")}`;case"invalid_key":return`${t.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${t.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function rb(){return{localeError:yk()}}var bk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${t.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return t.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${j(t.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${t.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${s.verb} ${o}${t.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??t.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${t.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${T(t.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function ib(){return{localeError:bk()}}var vk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${t.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return t.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${j(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??t.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${t.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${T(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${t.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function ob(){return{localeError:vk()}}var _k=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${t.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return t.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${j(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${o}${t.maximum.toString()}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${o}${t.minimum.toString()}`}case"invalid_format":{let o=t;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??t.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${t.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${t.keys.length>1?"\u5011":""}\uFF1A${T(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function sb(){return{localeError:_k()}}var xk=()=>{let n={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 e(t){return n[t]??null}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 t=>{switch(t.code){case"invalid_type":{let o=i[t.expected]??t.expected,s=F(t.input),a=i[s]??s;return/^[A-Z]/.test(t.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${t.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return t.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${j(t.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(t.values,"|")}`;case"too_big":{let o=t.inclusive?"<=":"<",s=e(t.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin??"iye"} ${s.verb} ${o}${t.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.maximum}`}case"too_small":{let o=t.inclusive?">=":">",s=e(t.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${t.origin} ${s.verb} ${o}${t.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${t.minimum}`}case"invalid_format":{let o=t;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??t.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 ${t.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${T(t.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${t.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 ${t.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function ab(){return{localeError:xk()}}var cb,vp=Symbol("ZodOutput"),_p=Symbol("ZodInput"),ps=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let t={...i,...this._map.get(e)};return Object.keys(t).length?t:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ds(){return new ps}(cb=globalThis).__zod_globalRegistry??(cb.__zod_globalRegistry=ds());var Ee=globalThis.__zod_globalRegistry;function xp(n,e){return new n({type:"string",...Z(e)})}function Sp(n,e){return new n({type:"string",coerce:!0,...Z(e)})}function ms(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Z(e)})}function yi(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Z(e)})}function fs(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(e)})}function hs(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(e)})}function gs(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(e)})}function ys(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(e)})}function bi(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Z(e)})}function bs(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(e)})}function vs(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(e)})}function _s(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(e)})}function xs(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(e)})}function Ss(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(e)})}function $s(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Z(e)})}function ws(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(e)})}function ks(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(e)})}function Es(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(e)})}function $p(n,e){return new n({type:"string",format:"mac",check:"string_format",abort:!1,...Z(e)})}function Is(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(e)})}function Ts(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(e)})}function Rs(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Z(e)})}function Ps(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(e)})}function Ns(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Z(e)})}function zs(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(e)})}var wp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function kp(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(e)})}function Ep(n,e){return new n({type:"string",format:"date",check:"string_format",...Z(e)})}function Ip(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...Z(e)})}function Tp(n,e){return new n({type:"string",format:"duration",check:"string_format",...Z(e)})}function Rp(n,e){return new n({type:"number",checks:[],...Z(e)})}function Pp(n,e){return new n({type:"number",coerce:!0,checks:[],...Z(e)})}function Np(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(e)})}function zp(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float32",...Z(e)})}function Cp(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"float64",...Z(e)})}function Ap(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"int32",...Z(e)})}function Dp(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(e)})}function Lp(n,e){return new n({type:"boolean",...Z(e)})}function Op(n,e){return new n({type:"boolean",coerce:!0,...Z(e)})}function Mp(n,e){return new n({type:"bigint",...Z(e)})}function jp(n,e){return new n({type:"bigint",coerce:!0,...Z(e)})}function Fp(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(e)})}function Up(n,e){return new n({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(e)})}function Zp(n,e){return new n({type:"symbol",...Z(e)})}function Hp(n,e){return new n({type:"undefined",...Z(e)})}function Wp(n,e){return new n({type:"null",...Z(e)})}function Bp(n){return new n({type:"any"})}function Gp(n){return new n({type:"unknown"})}function Jp(n,e){return new n({type:"never",...Z(e)})}function Vp(n,e){return new n({type:"void",...Z(e)})}function qp(n,e){return new n({type:"date",...Z(e)})}function Kp(n,e){return new n({type:"date",coerce:!0,...Z(e)})}function Yp(n,e){return new n({type:"nan",...Z(e)})}function vt(n,e){return new Yo({check:"less_than",...Z(e),value:n,inclusive:!1})}function Je(n,e){return new Yo({check:"less_than",...Z(e),value:n,inclusive:!0})}function _t(n,e){return new Xo({check:"greater_than",...Z(e),value:n,inclusive:!1})}function Ae(n,e){return new Xo({check:"greater_than",...Z(e),value:n,inclusive:!0})}function Cs(n){return _t(0,n)}function As(n){return vt(0,n)}function Ds(n){return Je(0,n)}function Ls(n){return Ae(0,n)}function rn(n,e){return new Wl({check:"multiple_of",...Z(e),value:n})}function on(n,e){return new Jl({check:"max_size",...Z(e),maximum:n})}function xt(n,e){return new Vl({check:"min_size",...Z(e),minimum:n})}function wn(n,e){return new ql({check:"size_equals",...Z(e),size:n})}function kn(n,e){return new Kl({check:"max_length",...Z(e),maximum:n})}function At(n,e){return new Yl({check:"min_length",...Z(e),minimum:n})}function En(n,e){return new Xl({check:"length_equals",...Z(e),length:n})}function or(n,e){return new Ql({check:"string_format",format:"regex",...Z(e),pattern:n})}function sr(n){return new eu({check:"string_format",format:"lowercase",...Z(n)})}function ar(n){return new tu({check:"string_format",format:"uppercase",...Z(n)})}function cr(n,e){return new nu({check:"string_format",format:"includes",...Z(e),includes:n})}function lr(n,e){return new ru({check:"string_format",format:"starts_with",...Z(e),prefix:n})}function ur(n,e){return new iu({check:"string_format",format:"ends_with",...Z(e),suffix:n})}function Os(n,e,r){return new ou({check:"property",property:n,schema:e,...Z(r)})}function pr(n,e){return new su({check:"mime_type",mime:n,...Z(e)})}function lt(n){return new au({check:"overwrite",tx:n})}function dr(n){return lt(e=>e.normalize(n))}function mr(){return lt(n=>n.trim())}function fr(){return lt(n=>n.toLowerCase())}function hr(){return lt(n=>n.toUpperCase())}function gr(){return lt(n=>ol(n))}function Xp(n,e,r){return new n({type:"array",element:e,...Z(r)})}function $k(n,e,r){return new n({type:"union",options:e,...Z(r)})}function wk(n,e,r){return new n({type:"union",options:e,inclusive:!1,...Z(r)})}function kk(n,e,r,i){return new n({type:"union",options:r,discriminator:e,...Z(i)})}function Ek(n,e,r){return new n({type:"intersection",left:e,right:r})}function Ik(n,e,r,i){let t=r instanceof ne,o=t?i:r,s=t?r:null;return new n({type:"tuple",items:e,rest:s,...Z(o)})}function Tk(n,e,r,i){return new n({type:"record",keyType:e,valueType:r,...Z(i)})}function Rk(n,e,r,i){return new n({type:"map",keyType:e,valueType:r,...Z(i)})}function Pk(n,e,r){return new n({type:"set",valueType:e,...Z(r)})}function Nk(n,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(t=>[t,t])):e;return new n({type:"enum",entries:i,...Z(r)})}function zk(n,e,r){return new n({type:"enum",entries:e,...Z(r)})}function Ck(n,e,r){return new n({type:"literal",values:Array.isArray(e)?e:[e],...Z(r)})}function Qp(n,e){return new n({type:"file",...Z(e)})}function Ak(n,e){return new n({type:"transform",transform:e})}function Dk(n,e){return new n({type:"optional",innerType:e})}function Lk(n,e){return new n({type:"nullable",innerType:e})}function Ok(n,e,r){return new n({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():al(r)}})}function Mk(n,e,r){return new n({type:"nonoptional",innerType:e,...Z(r)})}function jk(n,e){return new n({type:"success",innerType:e})}function Fk(n,e,r){return new n({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Uk(n,e,r){return new n({type:"pipe",in:e,out:r})}function Zk(n,e){return new n({type:"readonly",innerType:e})}function Hk(n,e,r){return new n({type:"template_literal",parts:e,...Z(r)})}function Wk(n,e){return new n({type:"lazy",getter:e})}function Bk(n,e){return new n({type:"promise",innerType:e})}function ed(n,e,r){let i=Z(r);return i.abort??(i.abort=!0),new n({type:"custom",check:"custom",fn:e,...i})}function td(n,e,r){return new n({type:"custom",check:"custom",fn:e,...Z(r)})}function nd(n){let e=lb(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Xn(i,r.value,e._zod.def));else{let t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),t.continue??(t.continue=!e._zod.def.abort),r.issues.push(Xn(t))}},n(r.value,r)));return e}function lb(n,e){let r=new pe({check:"custom",...Z(e)});return r._zod.check=n,r}function rd(n){let e=new pe({check:"describe"});return e._zod.onattach=[r=>{let i=Ee.get(r)??{};Ee.add(r,{...i,description:n})}],e._zod.check=()=>{},e}function id(n){let e=new pe({check:"meta"});return e._zod.onattach=[r=>{let i=Ee.get(r)??{};Ee.add(r,{...i,...n})}],e._zod.check=()=>{},e}function od(n,e){let r=Z(e),i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(t),a=n.Codec??fi,c=n.Boolean??di,l=n.String??$n,u=new l({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),d=new a({type:"pipe",in:u,out:p,transform:((m,f)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:f.value,inst:d,continue:!1}),{})}),reverseTransform:((m,f)=>m===!0?i[0]||"true":t[0]||"false"),error:r.error});return d}function yr(n,e,r,i={}){let t=Z(i),o={...Z(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...t};return r instanceof RegExp&&(o.pattern=r),new n(o)}function sn(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Ee,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function ae(n,e,r={path:[],schemaPath:[]}){var i;let t=n._zod.def,o=e.seen.get(n);if(o)return o.count++,r.schemaPath.includes(n)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(n,s);let a=n._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,n],path:r.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,s.schema,u);else{let d=s.schema,m=e.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(n,e,d,u)}let p=n._zod.parent;p&&(s.ref||(s.ref=p),ae(p,e,u),e.seen.get(p).isParent=!0)}let c=e.metadataRegistry.get(n);return c&&Object.assign(s.schema,c),e.io==="input"&&De(n)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(n).schema}function an(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of n.seen.entries()){let a=n.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let t=s=>{let a=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let p=n.external.registry.get(s[0])?.id,d=n.external.uri??(f=>f);if(p)return{ref:d(p)};let m=s[1].defId??s[1].schema.id??`schema${n.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${a}/${m}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${n.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=t(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let p in u)delete u[p];u.$ref=c};if(n.cycles==="throw")for(let s of n.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
707
810
|
|
|
708
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of n.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(n.external){let l=n.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(n.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&n.reused==="ref"){o(s);continue}}}function Bt(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let a=n.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){i(u);let d=n.seen.get(u),m=d.schema;if(m.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),s._zod.parent===u)for(let h in c)h==="$ref"||h==="allOf"||h in l||delete c[h];if(m.$ref&&d.def)for(let h in c)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(c[h])===JSON.stringify(d.def[h])&&delete c[h]}let p=s._zod.parent;if(p&&p!==u){i(p);let d=n.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(let m in c)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(c[m])===JSON.stringify(d.def[m])&&delete c[m]}n.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...n.seen.entries()].reverse())i(s[0]);let t={};if(n.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){let s=n.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");t.$id=n.external.uri(s)}Object.assign(t,r.def??r.schema);let o=n.external?.defs??{};for(let s of n.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?t.$defs=o:t.definitions=o);try{let s=JSON.parse(JSON.stringify(t));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Xn(e,"input",n.processors),output:Xn(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function we(n,e){let r=e??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);let i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return we(i.element,r);if(i.type==="set")return we(i.valueType,r);if(i.type==="lazy")return we(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 we(i.innerType,r);if(i.type==="intersection")return we(i.left,r)||we(i.right,r);if(i.type==="record"||i.type==="map")return we(i.keyType,r)||we(i.valueType,r);if(i.type==="pipe")return we(i.in,r)||we(i.out,r);if(i.type==="object"){for(let t in i.shape)if(we(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(we(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(we(t,r))return!0;return!!(i.rest&&we(i.rest,r))}return!1}var Tp=(n,e={})=>r=>{let i=Ht({...r,processors:e});return ne(n,i),Wt(i,n),Bt(i,n)},Xn=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=Ht({...t??{},target:o,io:e,processors:r});return ne(n,s),Wt(s,n),Bt(s,n)};var L$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Pp=(n,e,r,i)=>{let t=r;t.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=n._zod.bag;if(typeof o=="number"&&(t.minLength=o),typeof s=="number"&&(t.maxLength=s),a&&(t.format=L$[a]??a,t.format===""&&delete t.format,a==="time"&&delete t.format),l&&(t.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?t.pattern=u[0].source:u.length>1&&(t.allOf=[...u.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Rp=(n,e,r,i)=>{let t=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=n._zod.bag;typeof a=="string"&&a.includes("int")?t.type="integer":t.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.minimum=u,t.exclusiveMinimum=!0):t.exclusiveMinimum=u),typeof o=="number"&&(t.minimum=o,typeof u=="number"&&e.target!=="draft-04"&&(u>=o?delete t.minimum:delete t.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.maximum=l,t.exclusiveMaximum=!0):t.exclusiveMaximum=l),typeof s=="number"&&(t.maximum=s,typeof l=="number"&&e.target!=="draft-04"&&(l<=s?delete t.maximum:delete t.exclusiveMaximum)),typeof c=="number"&&(t.multipleOf=c)},Np=(n,e,r,i)=>{r.type="boolean"},zp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Dp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Op=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ap=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Lp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Cp=(n,e,r,i)=>{r.not={}},jp=(n,e,r,i)=>{},Mp=(n,e,r,i)=>{},Up=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Fp=(n,e,r,i)=>{let t=n._zod.def,o=Nr(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Zp=(n,e,r,i)=>{let t=n._zod.def,o=[];for(let s of t.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},Hp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Wp=(n,e,r,i)=>{let t=r,o=n._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=o.source},Bp=(n,e,r,i)=>{let t=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=n._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(t,o)):(Object.assign(t,o),t.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(t,o)},Jp=(n,e,r,i)=>{r.type="boolean"},Gp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},qp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Kp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Yp=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Xp=(n,e,r,i)=>{let t=r,o=n._zod.def,{minimum:s,maximum:a}=n._zod.bag;typeof s=="number"&&(t.minItems=s),typeof a=="number"&&(t.maxItems=a),t.type="array",t.items=ne(o.element,e,{...i,path:[...i.path,"items"]})},Qp=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object",t.properties={};let s=o.shape;for(let l in s)t.properties[l]=ne(s[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(t.required=Array.from(c)),o.catchall?._zod.def.type==="never"?t.additionalProperties=!1:o.catchall?o.catchall&&(t.additionalProperties=ne(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},ps=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>ne(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},ed=(n,e,r,i)=>{let t=n._zod.def,o=ne(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=ne(t.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},td=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,m)=>ne(d,e,{...i,path:[...i.path,s,m]})),l=o.rest?ne(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(t.prefixItems=c,l&&(t.items=l)):e.target==="openapi-3.0"?(t.items={anyOf:c},l&&t.items.anyOf.push(l),t.minItems=c.length,l||(t.maxItems=c.length)):(t.items=c,l&&(t.additionalItems=l));let{minimum:u,maximum:p}=n._zod.bag;typeof u=="number"&&(t.minItems=u),typeof p=="number"&&(t.maxItems=p)},nd=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=ne(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)t.patternProperties[p.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(t.propertyNames=ne(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=ne(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(t.required=u)}},rd=(n,e,r,i)=>{let t=n._zod.def,o=ne(t.innerType,e,i),s=e.seen.get(n);e.target==="openapi-3.0"?(s.ref=t.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},id=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},od=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},sd=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(t.defaultValue)))},ad=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType;let s;try{s=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},cd=(n,e,r,i)=>{let t=n._zod.def,o=e.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;ne(o,e,i);let s=e.seen.get(n);s.ref=o},ld=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},ud=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},ds=(n,e,r,i)=>{let t=n._zod.def;ne(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},pd=(n,e,r,i)=>{let t=n._zod.innerType;ne(t,e,i);let o=e.seen.get(n);o.ref=t},us={string:Pp,number:Rp,boolean:Np,bigint:zp,symbol:Dp,null:Op,undefined:Ap,void:Lp,never:Cp,any:jp,unknown:Mp,date:Up,enum:Fp,literal:Zp,nan:Hp,template_literal:Wp,file:Bp,success:Jp,custom:Gp,function:Vp,transform:qp,map:Kp,set:Yp,array:Xp,object:Qp,union:ps,intersection:ed,tuple:td,record:nd,nullable:rd,nonoptional:id,default:od,prefault:sd,catch:ad,pipe:cd,readonly:ld,promise:ud,optional:ds,lazy:pd};function ms(n,e){if("_idmap"in n){let i=n,t=Ht({...e,processors:us}),o={};for(let c of i._idmap.entries()){let[l,u]=c;ne(u,t)}let s={},a={registry:i,uri:e?.uri,defs:o};t.external=a;for(let c of i._idmap.entries()){let[l,u]=c;Wt(t,u),s[l]=Bt(t,u)}if(Object.keys(o).length>0){let c=t.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Ht({...e,processors:us});return ne(n,r),Wt(r,n),Bt(r,n)}var fs=class{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 r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Ht({processors:us,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ne(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Wt(this.ctx,e);let i=Bt(this.ctx,e),{"~standard":t,...o}=i;return o}};var Qg={};var qr={};Me(qr,{ZodAny:()=>Ad,ZodArray:()=>Md,ZodBase64:()=>As,ZodBase64URL:()=>Ls,ZodBigInt:()=>or,ZodBigIntFormat:()=>Ms,ZodBoolean:()=>ir,ZodCIDRv4:()=>Ds,ZodCIDRv6:()=>Os,ZodCUID:()=>Es,ZodCUID2:()=>Is,ZodCatch:()=>am,ZodCodec:()=>Gs,ZodCustom:()=>si,ZodCustomStringFormat:()=>nr,ZodDate:()=>ti,ZodDefault:()=>tm,ZodDiscriminatedUnion:()=>Fd,ZodE164:()=>Cs,ZodEmail:()=>$s,ZodEmoji:()=>ks,ZodEnum:()=>er,ZodExactOptional:()=>Xd,ZodFile:()=>Kd,ZodFunction:()=>gm,ZodGUID:()=>Kr,ZodIPv4:()=>Ns,ZodIPv6:()=>zs,ZodIntersection:()=>Zd,ZodJWT:()=>js,ZodKSUID:()=>Rs,ZodLazy:()=>mm,ZodLiteral:()=>qd,ZodMAC:()=>Td,ZodMap:()=>Gd,ZodNaN:()=>lm,ZodNanoID:()=>ws,ZodNever:()=>Cd,ZodNonOptional:()=>Bs,ZodNull:()=>Dd,ZodNullable:()=>em,ZodNumber:()=>rr,ZodNumberFormat:()=>pn,ZodObject:()=>ri,ZodOptional:()=>Ws,ZodPipe:()=>Js,ZodPrefault:()=>rm,ZodPromise:()=>hm,ZodReadonly:()=>um,ZodRecord:()=>oi,ZodSet:()=>Vd,ZodString:()=>tr,ZodStringFormat:()=>oe,ZodSuccess:()=>sm,ZodSymbol:()=>Nd,ZodTemplateLiteral:()=>dm,ZodTransform:()=>Yd,ZodTuple:()=>Wd,ZodType:()=>Y,ZodULID:()=>Ts,ZodURL:()=>ei,ZodUUID:()=>ct,ZodUndefined:()=>zd,ZodUnion:()=>ii,ZodUnknown:()=>Ld,ZodVoid:()=>jd,ZodXID:()=>Ps,ZodXor:()=>Ud,_ZodString:()=>Ss,_default:()=>nm,_function:()=>sv,any:()=>jy,array:()=>ni,base64:()=>xy,base64url:()=>Sy,bigint:()=>Dy,boolean:()=>Rd,catch:()=>cm,check:()=>av,cidrv4:()=>_y,cidrv6:()=>by,codec:()=>rv,cuid:()=>py,cuid2:()=>dy,custom:()=>cv,date:()=>Uy,describe:()=>lv,discriminatedUnion:()=>Jy,e164:()=>$y,email:()=>ty,emoji:()=>ly,enum:()=>Zs,exactOptional:()=>Qd,file:()=>Qy,float32:()=>Py,float64:()=>Ry,function:()=>sv,guid:()=>ny,hash:()=>Ty,hex:()=>Iy,hostname:()=>Ey,httpUrl:()=>cy,instanceof:()=>pv,int:()=>xs,int32:()=>Ny,int64:()=>Oy,intersection:()=>Hd,ipv4:()=>gy,ipv6:()=>vy,json:()=>mv,jwt:()=>ky,keyof:()=>Fy,ksuid:()=>hy,lazy:()=>fm,literal:()=>Xy,looseObject:()=>Wy,looseRecord:()=>Vy,mac:()=>yy,map:()=>qy,meta:()=>uv,nan:()=>nv,nanoid:()=>uy,nativeEnum:()=>Yy,never:()=>Us,nonoptional:()=>om,null:()=>Od,nullable:()=>Xr,nullish:()=>ev,number:()=>Pd,object:()=>Zy,optional:()=>Yr,partialRecord:()=>Gy,pipe:()=>Qr,prefault:()=>im,preprocess:()=>fv,promise:()=>ov,readonly:()=>pm,record:()=>Jd,refine:()=>ym,set:()=>Ky,strictObject:()=>Hy,string:()=>bs,stringFormat:()=>wy,stringbool:()=>dv,success:()=>tv,superRefine:()=>vm,symbol:()=>Ly,templateLiteral:()=>iv,transform:()=>Hs,tuple:()=>Bd,uint32:()=>zy,uint64:()=>Ay,ulid:()=>my,undefined:()=>Cy,union:()=>Fs,unknown:()=>un,url:()=>ay,uuid:()=>ry,uuidv4:()=>iy,uuidv6:()=>oy,uuidv7:()=>sy,void:()=>My,xid:()=>fy,xor:()=>By});var hs={};Me(hs,{endsWith:()=>Wn,gt:()=>st,gte:()=>ke,includes:()=>Zn,length:()=>ln,lowercase:()=>Un,lt:()=>ot,lte:()=>Ce,maxLength:()=>cn,maxSize:()=>Zt,mime:()=>Bn,minLength:()=>bt,minSize:()=>at,multipleOf:()=>Ft,negative:()=>ss,nonnegative:()=>cs,nonpositive:()=>as,normalize:()=>Jn,overwrite:()=>Qe,positive:()=>os,property:()=>ls,regex:()=>Mn,size:()=>an,slugify:()=>Kn,startsWith:()=>Hn,toLowerCase:()=>Vn,toUpperCase:()=>qn,trim:()=>Gn,uppercase:()=>Fn});var Qn={};Me(Qn,{ZodISODate:()=>ys,ZodISODateTime:()=>gs,ZodISODuration:()=>_s,ZodISOTime:()=>vs,date:()=>md,datetime:()=>dd,duration:()=>hd,time:()=>fd});var gs=x("ZodISODateTime",(n,e)=>{Hl.init(n,e),oe.init(n,e)});function dd(n){return Gu(gs,n)}var ys=x("ZodISODate",(n,e)=>{Wl.init(n,e),oe.init(n,e)});function md(n){return Vu(ys,n)}var vs=x("ZodISOTime",(n,e)=>{Bl.init(n,e),oe.init(n,e)});function fd(n){return qu(vs,n)}var _s=x("ZodISODuration",(n,e)=>{Jl.init(n,e),oe.init(n,e)});function hd(n){return Ku(_s,n)}var ey=(n,e)=>{Lr.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>jr(n,r)},flatten:{value:r=>Cr(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,Rn,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,Rn,2)}},isEmpty:{get(){return n.issues.length===0}}})},j$=x("ZodError",ey),Ne=x("ZodError",ey,{Parent:Error});var gd=Dn(Ne),yd=On(Ne),vd=An(Ne),_d=Ln(Ne),bd=mo(Ne),xd=fo(Ne),Sd=ho(Ne),$d=go(Ne),kd=yo(Ne),wd=vo(Ne),Ed=_o(Ne),Id=bo(Ne);var Y=x("ZodType",(n,e)=>(K.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:Xn(n,"input"),output:Xn(n,"output")}}),n.toJSONSchema=Tp(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(D.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),n.with=n.check,n.clone=(r,i)=>$e(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>gd(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>vd(n,r,i),n.parseAsync=async(r,i)=>yd(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>_d(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>bd(n,r,i),n.decode=(r,i)=>xd(n,r,i),n.encodeAsync=async(r,i)=>Sd(n,r,i),n.decodeAsync=async(r,i)=>$d(n,r,i),n.safeEncode=(r,i)=>kd(n,r,i),n.safeDecode=(r,i)=>wd(n,r,i),n.safeEncodeAsync=async(r,i)=>Ed(n,r,i),n.safeDecodeAsync=async(r,i)=>Id(n,r,i),n.refine=(r,i)=>n.check(ym(r,i)),n.superRefine=r=>n.check(vm(r)),n.overwrite=r=>n.check(Qe(r)),n.optional=()=>Yr(n),n.exactOptional=()=>Qd(n),n.nullable=()=>Xr(n),n.nullish=()=>Yr(Xr(n)),n.nonoptional=r=>om(n,r),n.array=()=>ni(n),n.or=r=>Fs([n,r]),n.and=r=>Hd(n,r),n.transform=r=>Qr(n,Hs(r)),n.default=r=>nm(n,r),n.prefault=r=>im(n,r),n.catch=r=>cm(n,r),n.pipe=r=>Qr(n,r),n.readonly=()=>pm(n),n.describe=r=>{let i=n.clone();return _e.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return _e.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return _e.get(n);let i=n.clone();return _e.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),Ss=x("_ZodString",(n,e)=>{sn.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Pp(n,i,t,o);let r=n._zod.bag;n.format=r.format??null,n.minLength=r.minimum??null,n.maxLength=r.maximum??null,n.regex=(...i)=>n.check(Mn(...i)),n.includes=(...i)=>n.check(Zn(...i)),n.startsWith=(...i)=>n.check(Hn(...i)),n.endsWith=(...i)=>n.check(Wn(...i)),n.min=(...i)=>n.check(bt(...i)),n.max=(...i)=>n.check(cn(...i)),n.length=(...i)=>n.check(ln(...i)),n.nonempty=(...i)=>n.check(bt(1,...i)),n.lowercase=i=>n.check(Un(i)),n.uppercase=i=>n.check(Fn(i)),n.trim=()=>n.check(Gn()),n.normalize=(...i)=>n.check(Jn(...i)),n.toLowerCase=()=>n.check(Vn()),n.toUpperCase=()=>n.check(qn()),n.slugify=()=>n.check(Kn())}),tr=x("ZodString",(n,e)=>{sn.init(n,e),Ss.init(n,e),n.email=r=>n.check(Mo($s,r)),n.url=r=>n.check(Vr(ei,r)),n.jwt=r=>n.check(is(js,r)),n.emoji=r=>n.check(Wo(ks,r)),n.guid=r=>n.check(Gr(Kr,r)),n.uuid=r=>n.check(Uo(ct,r)),n.uuidv4=r=>n.check(Fo(ct,r)),n.uuidv6=r=>n.check(Zo(ct,r)),n.uuidv7=r=>n.check(Ho(ct,r)),n.nanoid=r=>n.check(Bo(ws,r)),n.guid=r=>n.check(Gr(Kr,r)),n.cuid=r=>n.check(Jo(Es,r)),n.cuid2=r=>n.check(Go(Is,r)),n.ulid=r=>n.check(Vo(Ts,r)),n.base64=r=>n.check(ts(As,r)),n.base64url=r=>n.check(ns(Ls,r)),n.xid=r=>n.check(qo(Ps,r)),n.ksuid=r=>n.check(Ko(Rs,r)),n.ipv4=r=>n.check(Yo(Ns,r)),n.ipv6=r=>n.check(Xo(zs,r)),n.cidrv4=r=>n.check(Qo(Ds,r)),n.cidrv6=r=>n.check(es(Os,r)),n.e164=r=>n.check(rs(Cs,r)),n.datetime=r=>n.check(dd(r)),n.date=r=>n.check(md(r)),n.time=r=>n.check(fd(r)),n.duration=r=>n.check(hd(r))});function bs(n){return Hu(tr,n)}var oe=x("ZodStringFormat",(n,e)=>{ie.init(n,e),Ss.init(n,e)}),$s=x("ZodEmail",(n,e)=>{Ol.init(n,e),oe.init(n,e)});function ty(n){return Mo($s,n)}var Kr=x("ZodGUID",(n,e)=>{zl.init(n,e),oe.init(n,e)});function ny(n){return Gr(Kr,n)}var ct=x("ZodUUID",(n,e)=>{Dl.init(n,e),oe.init(n,e)});function ry(n){return Uo(ct,n)}function iy(n){return Fo(ct,n)}function oy(n){return Zo(ct,n)}function sy(n){return Ho(ct,n)}var ei=x("ZodURL",(n,e)=>{Al.init(n,e),oe.init(n,e)});function ay(n){return Vr(ei,n)}function cy(n){return Vr(ei,{protocol:/^https?$/,hostname:He.domain,...D.normalizeParams(n)})}var ks=x("ZodEmoji",(n,e)=>{Ll.init(n,e),oe.init(n,e)});function ly(n){return Wo(ks,n)}var ws=x("ZodNanoID",(n,e)=>{Cl.init(n,e),oe.init(n,e)});function uy(n){return Bo(ws,n)}var Es=x("ZodCUID",(n,e)=>{jl.init(n,e),oe.init(n,e)});function py(n){return Jo(Es,n)}var Is=x("ZodCUID2",(n,e)=>{Ml.init(n,e),oe.init(n,e)});function dy(n){return Go(Is,n)}var Ts=x("ZodULID",(n,e)=>{Ul.init(n,e),oe.init(n,e)});function my(n){return Vo(Ts,n)}var Ps=x("ZodXID",(n,e)=>{Fl.init(n,e),oe.init(n,e)});function fy(n){return qo(Ps,n)}var Rs=x("ZodKSUID",(n,e)=>{Zl.init(n,e),oe.init(n,e)});function hy(n){return Ko(Rs,n)}var Ns=x("ZodIPv4",(n,e)=>{Gl.init(n,e),oe.init(n,e)});function gy(n){return Yo(Ns,n)}var Td=x("ZodMAC",(n,e)=>{ql.init(n,e),oe.init(n,e)});function yy(n){return Bu(Td,n)}var zs=x("ZodIPv6",(n,e)=>{Vl.init(n,e),oe.init(n,e)});function vy(n){return Xo(zs,n)}var Ds=x("ZodCIDRv4",(n,e)=>{Kl.init(n,e),oe.init(n,e)});function _y(n){return Qo(Ds,n)}var Os=x("ZodCIDRv6",(n,e)=>{Yl.init(n,e),oe.init(n,e)});function by(n){return es(Os,n)}var As=x("ZodBase64",(n,e)=>{Ql.init(n,e),oe.init(n,e)});function xy(n){return ts(As,n)}var Ls=x("ZodBase64URL",(n,e)=>{eu.init(n,e),oe.init(n,e)});function Sy(n){return ns(Ls,n)}var Cs=x("ZodE164",(n,e)=>{tu.init(n,e),oe.init(n,e)});function $y(n){return rs(Cs,n)}var js=x("ZodJWT",(n,e)=>{nu.init(n,e),oe.init(n,e)});function ky(n){return is(js,n)}var nr=x("ZodCustomStringFormat",(n,e)=>{ru.init(n,e),oe.init(n,e)});function wy(n,e,r={}){return Yn(nr,n,e,r)}function Ey(n){return Yn(nr,"hostname",He.hostname,n)}function Iy(n){return Yn(nr,"hex",He.hex,n)}function Ty(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=He[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return Yn(nr,i,t,e)}var rr=x("ZodNumber",(n,e)=>{Ro.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Rp(n,i,t,o),n.gt=(i,t)=>n.check(st(i,t)),n.gte=(i,t)=>n.check(ke(i,t)),n.min=(i,t)=>n.check(ke(i,t)),n.lt=(i,t)=>n.check(ot(i,t)),n.lte=(i,t)=>n.check(Ce(i,t)),n.max=(i,t)=>n.check(Ce(i,t)),n.int=i=>n.check(xs(i)),n.safe=i=>n.check(xs(i)),n.positive=i=>n.check(st(0,i)),n.nonnegative=i=>n.check(ke(0,i)),n.negative=i=>n.check(ot(0,i)),n.nonpositive=i=>n.check(Ce(0,i)),n.multipleOf=(i,t)=>n.check(Ft(i,t)),n.step=(i,t)=>n.check(Ft(i,t)),n.finite=()=>n;let r=n._zod.bag;n.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),n.isFinite=!0,n.format=r.format??null});function Pd(n){return Yu(rr,n)}var pn=x("ZodNumberFormat",(n,e)=>{iu.init(n,e),rr.init(n,e)});function xs(n){return Qu(pn,n)}function Py(n){return ep(pn,n)}function Ry(n){return tp(pn,n)}function Ny(n){return np(pn,n)}function zy(n){return rp(pn,n)}var ir=x("ZodBoolean",(n,e)=>{Zr.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Np(n,r,i,t)});function Rd(n){return ip(ir,n)}var or=x("ZodBigInt",(n,e)=>{No.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>zp(n,i,t,o),n.gte=(i,t)=>n.check(ke(i,t)),n.min=(i,t)=>n.check(ke(i,t)),n.gt=(i,t)=>n.check(st(i,t)),n.gte=(i,t)=>n.check(ke(i,t)),n.min=(i,t)=>n.check(ke(i,t)),n.lt=(i,t)=>n.check(ot(i,t)),n.lte=(i,t)=>n.check(Ce(i,t)),n.max=(i,t)=>n.check(Ce(i,t)),n.positive=i=>n.check(st(BigInt(0),i)),n.negative=i=>n.check(ot(BigInt(0),i)),n.nonpositive=i=>n.check(Ce(BigInt(0),i)),n.nonnegative=i=>n.check(ke(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(Ft(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function Dy(n){return sp(or,n)}var Ms=x("ZodBigIntFormat",(n,e)=>{ou.init(n,e),or.init(n,e)});function Oy(n){return cp(Ms,n)}function Ay(n){return lp(Ms,n)}var Nd=x("ZodSymbol",(n,e)=>{su.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Dp(n,r,i,t)});function Ly(n){return up(Nd,n)}var zd=x("ZodUndefined",(n,e)=>{au.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ap(n,r,i,t)});function Cy(n){return pp(zd,n)}var Dd=x("ZodNull",(n,e)=>{cu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Op(n,r,i,t)});function Od(n){return dp(Dd,n)}var Ad=x("ZodAny",(n,e)=>{lu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>jp(n,r,i,t)});function jy(){return mp(Ad)}var Ld=x("ZodUnknown",(n,e)=>{uu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Mp(n,r,i,t)});function un(){return fp(Ld)}var Cd=x("ZodNever",(n,e)=>{pu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Cp(n,r,i,t)});function Us(n){return hp(Cd,n)}var jd=x("ZodVoid",(n,e)=>{du.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Lp(n,r,i,t)});function My(n){return gp(jd,n)}var ti=x("ZodDate",(n,e)=>{mu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Up(n,i,t,o),n.min=(i,t)=>n.check(ke(i,t)),n.max=(i,t)=>n.check(Ce(i,t));let r=n._zod.bag;n.minDate=r.minimum?new Date(r.minimum):null,n.maxDate=r.maximum?new Date(r.maximum):null});function Uy(n){return yp(ti,n)}var Md=x("ZodArray",(n,e)=>{fu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Xp(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(bt(r,i)),n.nonempty=r=>n.check(bt(1,r)),n.max=(r,i)=>n.check(cn(r,i)),n.length=(r,i)=>n.check(ln(r,i)),n.unwrap=()=>n.element});function ni(n,e){return bp(Md,n,e)}function Fy(n){let e=n._zod.def.shape;return Zs(Object.keys(e))}var ri=x("ZodObject",(n,e)=>{hu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Qp(n,r,i,t),D.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>Zs(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:un()}),n.loose=()=>n.clone({...n._zod.def,catchall:un()}),n.strict=()=>n.clone({...n._zod.def,catchall:Us()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>D.extend(n,r),n.safeExtend=r=>D.safeExtend(n,r),n.merge=r=>D.merge(n,r),n.pick=r=>D.pick(n,r),n.omit=r=>D.omit(n,r),n.partial=(...r)=>D.partial(Ws,n,r[0]),n.required=(...r)=>D.required(Bs,n,r[0])});function Zy(n,e){let r={type:"object",shape:n??{},...D.normalizeParams(e)};return new ri(r)}function Hy(n,e){return new ri({type:"object",shape:n,catchall:Us(),...D.normalizeParams(e)})}function Wy(n,e){return new ri({type:"object",shape:n,catchall:un(),...D.normalizeParams(e)})}var ii=x("ZodUnion",(n,e)=>{Hr.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ps(n,r,i,t),n.options=e.options});function Fs(n,e){return new ii({type:"union",options:n,...D.normalizeParams(e)})}var Ud=x("ZodXor",(n,e)=>{ii.init(n,e),gu.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ps(n,r,i,t),n.options=e.options});function By(n,e){return new Ud({type:"union",options:n,inclusive:!1,...D.normalizeParams(e)})}var Fd=x("ZodDiscriminatedUnion",(n,e)=>{ii.init(n,e),yu.init(n,e)});function Jy(n,e,r){return new Fd({type:"union",options:e,discriminator:n,...D.normalizeParams(r)})}var Zd=x("ZodIntersection",(n,e)=>{vu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ed(n,r,i,t)});function Hd(n,e){return new Zd({type:"intersection",left:n,right:e})}var Wd=x("ZodTuple",(n,e)=>{zo.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>td(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function Bd(n,e,r){let i=e instanceof K,t=i?r:e,o=i?e:null;return new Wd({type:"tuple",items:n,rest:o,...D.normalizeParams(t)})}var oi=x("ZodRecord",(n,e)=>{_u.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>nd(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function Jd(n,e,r){return new oi({type:"record",keyType:n,valueType:e,...D.normalizeParams(r)})}function Gy(n,e,r){let i=$e(n);return i._zod.values=void 0,new oi({type:"record",keyType:i,valueType:e,...D.normalizeParams(r)})}function Vy(n,e,r){return new oi({type:"record",keyType:n,valueType:e,mode:"loose",...D.normalizeParams(r)})}var Gd=x("ZodMap",(n,e)=>{bu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Kp(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check(at(...r)),n.nonempty=r=>n.check(at(1,r)),n.max=(...r)=>n.check(Zt(...r)),n.size=(...r)=>n.check(an(...r))});function qy(n,e,r){return new Gd({type:"map",keyType:n,valueType:e,...D.normalizeParams(r)})}var Vd=x("ZodSet",(n,e)=>{xu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Yp(n,r,i,t),n.min=(...r)=>n.check(at(...r)),n.nonempty=r=>n.check(at(1,r)),n.max=(...r)=>n.check(Zt(...r)),n.size=(...r)=>n.check(an(...r))});function Ky(n,e){return new Vd({type:"set",valueType:n,...D.normalizeParams(e)})}var er=x("ZodEnum",(n,e)=>{Su.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(i,t,o)=>Fp(n,i,t,o),n.enum=e.entries,n.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));n.extract=(i,t)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new er({...e,checks:[],...D.normalizeParams(t),entries:o})},n.exclude=(i,t)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new er({...e,checks:[],...D.normalizeParams(t),entries:o})}});function Zs(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new er({type:"enum",entries:r,...D.normalizeParams(e)})}function Yy(n,e){return new er({type:"enum",entries:n,...D.normalizeParams(e)})}var qd=x("ZodLiteral",(n,e)=>{$u.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Zp(n,r,i,t),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Xy(n,e){return new qd({type:"literal",values:Array.isArray(n)?n:[n],...D.normalizeParams(e)})}var Kd=x("ZodFile",(n,e)=>{ku.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Bp(n,r,i,t),n.min=(r,i)=>n.check(at(r,i)),n.max=(r,i)=>n.check(Zt(r,i)),n.mime=(r,i)=>n.check(Bn(Array.isArray(r)?r:[r],i))});function Qy(n){return xp(Kd,n)}var Yd=x("ZodTransform",(n,e)=>{wu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>qp(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Lt(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(D.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),r.issues.push(D.issue(s))}};let t=e.transform(r.value,r);return t instanceof Promise?t.then(o=>(r.value=o,r)):(r.value=t,r)}});function Hs(n){return new Yd({type:"transform",transform:n})}var Ws=x("ZodOptional",(n,e)=>{Do.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ds(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Yr(n){return new Ws({type:"optional",innerType:n})}var Xd=x("ZodExactOptional",(n,e)=>{Eu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ds(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Qd(n){return new Xd({type:"optional",innerType:n})}var em=x("ZodNullable",(n,e)=>{Iu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>rd(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Xr(n){return new em({type:"nullable",innerType:n})}function ev(n){return Yr(Xr(n))}var tm=x("ZodDefault",(n,e)=>{Tu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>od(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function nm(n,e){return new tm({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var rm=x("ZodPrefault",(n,e)=>{Pu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>sd(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function im(n,e){return new rm({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():D.shallowClone(e)}})}var Bs=x("ZodNonOptional",(n,e)=>{Ru.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>id(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function om(n,e){return new Bs({type:"nonoptional",innerType:n,...D.normalizeParams(e)})}var sm=x("ZodSuccess",(n,e)=>{Nu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Jp(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function tv(n){return new sm({type:"success",innerType:n})}var am=x("ZodCatch",(n,e)=>{zu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ad(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function cm(n,e){return new am({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var lm=x("ZodNaN",(n,e)=>{Du.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Hp(n,r,i,t)});function nv(n){return _p(lm,n)}var Js=x("ZodPipe",(n,e)=>{Ou.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>cd(n,r,i,t),n.in=e.in,n.out=e.out});function Qr(n,e){return new Js({type:"pipe",in:n,out:e})}var Gs=x("ZodCodec",(n,e)=>{Js.init(n,e),Wr.init(n,e)});function rv(n,e,r){return new Gs({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var um=x("ZodReadonly",(n,e)=>{Au.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ld(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function pm(n){return new um({type:"readonly",innerType:n})}var dm=x("ZodTemplateLiteral",(n,e)=>{Lu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Wp(n,r,i,t)});function iv(n,e){return new dm({type:"template_literal",parts:n,...D.normalizeParams(e)})}var mm=x("ZodLazy",(n,e)=>{Mu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>pd(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function fm(n){return new mm({type:"lazy",getter:n})}var hm=x("ZodPromise",(n,e)=>{ju.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ud(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function ov(n){return new hm({type:"promise",innerType:n})}var gm=x("ZodFunction",(n,e)=>{Cu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Vp(n,r,i,t)});function sv(n){return new gm({type:"function",input:Array.isArray(n?.input)?Bd(n?.input):n?.input??ni(un()),output:n?.output??un()})}var si=x("ZodCustom",(n,e)=>{Uu.init(n,e),Y.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Gp(n,r,i,t)});function av(n){let e=new se({check:"custom"});return e._zod.check=n,e}function cv(n,e){return Sp(si,n??(()=>!0),e)}function ym(n,e={}){return $p(si,n,e)}function vm(n){return kp(n)}var lv=wp,uv=Ep;function pv(n,e={}){let r=new si({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...D.normalizeParams(e)});return r._zod.bag.Class=n,r._zod.check=i=>{i.value instanceof n||i.issues.push({code:"invalid_type",expected:n.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var dv=(...n)=>Ip({Codec:Gs,Boolean:ir,String:tr},...n);function mv(n){let e=fm(()=>Fs([bs(n),Pd(),Rd(),Od(),ni(e),Jd(bs(),e)]));return e}function fv(n,e){return Qr(Hs(n),e)}var U$={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 F$(n){me({customError:n})}function Z$(){return me().customError}var _m;_m||(_m={});var j={...qr,...hs,iso:Qn},H$=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 W$(n,e){let r=n.$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":e??"draft-2020-12"}function B$(n,e){if(!n.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=n.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let t=r[1];if(!t||!e.defs[t])throw new Error(`Reference not found: ${n}`);return e.defs[t]}throw new Error(`Reference not found: ${n}`)}function hv(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return j.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(n.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(n.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(n.if!==void 0||n.then!==void 0||n.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(n.dependentSchemas!==void 0||n.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(n.$ref){let t=n.$ref;if(e.refs.has(t))return e.refs.get(t);if(e.processing.has(t))return j.lazy(()=>{if(!e.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return e.refs.get(t)});e.processing.add(t);let o=B$(t,e),s=xe(o,e);return e.refs.set(t,s),e.processing.delete(t),s}if(n.enum!==void 0){let t=n.enum;if(e.version==="openapi-3.0"&&n.nullable===!0&&t.length===1&&t[0]===null)return j.null();if(t.length===0)return j.never();if(t.length===1)return j.literal(t[0]);if(t.every(s=>typeof s=="string"))return j.enum(t);let o=t.map(s=>j.literal(s));return o.length<2?o[0]:j.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return j.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return hv(s,e)});return t.length===0?j.never():t.length===1?t[0]:j.union(t)}if(!r)return j.any();let i;switch(r){case"string":{let t=j.string();if(n.format){let o=n.format;o==="email"?t=t.check(j.email()):o==="uri"||o==="uri-reference"?t=t.check(j.url()):o==="uuid"||o==="guid"?t=t.check(j.uuid()):o==="date-time"?t=t.check(j.iso.datetime()):o==="date"?t=t.check(j.iso.date()):o==="time"?t=t.check(j.iso.time()):o==="duration"?t=t.check(j.iso.duration()):o==="ipv4"?t=t.check(j.ipv4()):o==="ipv6"?t=t.check(j.ipv6()):o==="mac"?t=t.check(j.mac()):o==="cidr"?t=t.check(j.cidrv4()):o==="cidr-v6"?t=t.check(j.cidrv6()):o==="base64"?t=t.check(j.base64()):o==="base64url"?t=t.check(j.base64url()):o==="e164"?t=t.check(j.e164()):o==="jwt"?t=t.check(j.jwt()):o==="emoji"?t=t.check(j.emoji()):o==="nanoid"?t=t.check(j.nanoid()):o==="cuid"?t=t.check(j.cuid()):o==="cuid2"?t=t.check(j.cuid2()):o==="ulid"?t=t.check(j.ulid()):o==="xid"?t=t.check(j.xid()):o==="ksuid"&&(t=t.check(j.ksuid()))}typeof n.minLength=="number"&&(t=t.min(n.minLength)),typeof n.maxLength=="number"&&(t=t.max(n.maxLength)),n.pattern&&(t=t.regex(new RegExp(n.pattern))),i=t;break}case"number":case"integer":{let t=r==="integer"?j.number().int():j.number();typeof n.minimum=="number"&&(t=t.min(n.minimum)),typeof n.maximum=="number"&&(t=t.max(n.maximum)),typeof n.exclusiveMinimum=="number"?t=t.gt(n.exclusiveMinimum):n.exclusiveMinimum===!0&&typeof n.minimum=="number"&&(t=t.gt(n.minimum)),typeof n.exclusiveMaximum=="number"?t=t.lt(n.exclusiveMaximum):n.exclusiveMaximum===!0&&typeof n.maximum=="number"&&(t=t.lt(n.maximum)),typeof n.multipleOf=="number"&&(t=t.multipleOf(n.multipleOf)),i=t;break}case"boolean":{i=j.boolean();break}case"null":{i=j.null();break}case"object":{let t={},o=n.properties||{},s=new Set(n.required||[]);for(let[c,l]of Object.entries(o)){let u=xe(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=xe(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?xe(n.additionalProperties,e):j.any();if(Object.keys(t).length===0){i=j.record(c,l);break}let u=j.object(t).passthrough(),p=j.looseRecord(c,l);i=j.intersection(u,p);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let d of l){let m=xe(c[d],e),f=j.string().regex(new RegExp(d));u.push(j.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(j.object(t).passthrough()),p.push(...u),p.length===0)i=j.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=j.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=j.intersection(d,p[m]);i=d}break}let a=j.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall(xe(n.additionalProperties,e)):i=a.passthrough();break}case"array":{let t=n.prefixItems,o=n.items;if(t&&Array.isArray(t)){let s=t.map(c=>xe(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?xe(o,e):void 0;a?i=j.tuple(s).rest(a):i=j.tuple(s),typeof n.minItems=="number"&&(i=i.check(j.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(j.maxLength(n.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>xe(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?xe(n.additionalItems,e):void 0;a?i=j.tuple(s).rest(a):i=j.tuple(s),typeof n.minItems=="number"&&(i=i.check(j.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(j.maxLength(n.maxItems)))}else if(o!==void 0){let s=xe(o,e),a=j.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=j.array(j.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n.description&&(i=i.describe(n.description)),n.default!==void 0&&(i=i.default(n.default)),i}function xe(n,e){if(typeof n=="boolean")return n?j.any():j.never();let r=hv(n,e),i=n.type||n.enum!==void 0||n.const!==void 0;if(n.anyOf&&Array.isArray(n.anyOf)){let a=n.anyOf.map(l=>xe(l,e)),c=j.union(a);r=i?j.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>xe(l,e)),c=j.xor(a);r=i?j.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:j.any();else{let a=i?r:xe(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=j.intersection(a,xe(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=j.nullable(r)),n.readOnly===!0&&(r=j.readonly(r));let t={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in n&&(t[a]=n[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in n&&(t[a]=n[a]);for(let a of Object.keys(n))H$.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function gv(n,e){if(typeof n=="boolean")return n?j.any():j.never();let r=W$(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??_e};return xe(n,t)}var bm={};Me(bm,{bigint:()=>q$,boolean:()=>V$,date:()=>K$,number:()=>G$,string:()=>J$});function J$(n){return Wu(tr,n)}function G$(n){return Xu(rr,n)}function V$(n){return op(ir,n)}function q$(n){return ap(or,n)}function K$(n){return vp(ti,n)}me(Oo());var iz=g.object({repoPath:g.string(),mode:g.enum(["init","tree","topography","scout","hologram","tools"]),subPath:g.string().optional(),maxDepth:g.number().int().min(he.MIN_DEPTH).max(he.MAX_DEPTH).optional()}),oz=g.object({repoPath:g.string(),mode:g.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:g.string().max(he.MAX_QUERY_LENGTH).optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().min(he.MIN_LIMIT).max(he.MAX_LIMIT).optional(),offset:g.number().int().min(0).optional(),compact:g.boolean().optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),sz=g.object({repoPath:g.string(),mode:g.enum(["symbol","file"]),filePath:g.string().optional(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional(),symbolName:g.string().optional(),context:g.enum(["definition","full"]).optional()}),az=g.object({repoPath:g.string(),mode:g.enum(["impact","deps","flow","dead-code","circular-deps"]),filePath:g.string().optional(),symbolName:g.string().optional(),direction:g.enum(["imports","imported_by"]).optional(),depth:g.number().int().min(he.MIN_DEPTH).max(he.MAX_DEPTH).optional(),limit:g.number().int().min(he.MIN_LIMIT).max(he.MAX_LIMIT).optional(),includeTests:g.boolean().optional()}),cz=g.object({repoPath:g.string(),action:g.enum(["index","repair","trace"]),deep:g.boolean().optional(),sinceCommit:g.string().optional()}),lz=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),uz=g.object({action:g.enum(["list","link","fuse"]),repoPaths:g.array(g.string()).optional(),name:g.string().optional(),status:g.string().optional(),parentRepoPath:g.string().optional(),parentMissionId:g.number().optional(),childRepoPath:g.string().optional(),childMissionId:g.number().optional(),relationship:g.string().optional()});var yv=[...Eh,...Ih];J();J();var Y$=b.child({module:"strategy-normalizer"}),St=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return Y$.warn({strategyInput:e,err:t},"Failed to parse strategy JSON"),{steps:[]}}else r=e;return{steps:this.normalizeSteps(r)}}static normalizeSteps(e){return Array.isArray(e)?e.map((r,i)=>typeof r=="string"?{id:`step-${i}`,description:r,status:"pending"}:typeof r=="object"&&r!==null?{id:r.id||`step-${i}`,description:r.description||r.content||r.name||`Step ${i+1}`,status:r.status||"pending",dependencies:r.dependencies||r.deps,verification:r.verification,...r}:{id:`step-${i}`,description:String(r),status:"pending"}):e.steps&&Array.isArray(e.steps)?this.normalizeSteps(e.steps):typeof e=="object"?Object.entries(e).map(([r,i],t)=>typeof i=="string"?{id:r,description:i,status:"pending"}:typeof i=="object"&&i!==null?{id:r,description:i.description||i.content||i.name||r,status:i.status||"pending",dependencies:i.dependencies||i.deps,verification:i.verification,...i}:{id:r||`step-${t}`,description:String(i),status:"pending"}):[]}static stringify(e){return JSON.stringify(e,null,2)}static validate(e){let r=[];if(!e)return{valid:!0,errors:[]};try{let i=this.normalize(e),t=new Set;for(let o of i.steps)if(t.has(o.id)&&r.push(`Duplicate step ID: ${o.id}`),t.add(o.id),o.dependencies)for(let s of o.dependencies)t.has(s)||r.push(`Step "${o.id}" depends on non-existent step "${s}"`);return{valid:r.length===0,errors:r}}catch(i){return r.push(`Strategy validation failed: ${i instanceof Error?i.message:String(i)}`),{valid:!1,errors:r}}}};J();import xm from"fs";import vv from"path";import X$ from"os";var Q$=[{id:"step-0",description:"Analyze impact: identify dependents and call sites",status:"pending"},{id:"step-1",description:"Implement refactor and update call sites",status:"pending"},{id:"step-2",description:"Run tests and verify behavior; update docs if needed",status:"pending"}],ek=[{id:"step-0",description:"Capture requirements and acceptance criteria",status:"pending"},{id:"step-1",description:"Implement feature with tests",status:"pending"},{id:"step-2",description:"Integrate and verify end-to-end",status:"pending"}],tk=[{id:"step-0",description:"Reproduce the bug and document steps",status:"pending"},{id:"step-1",description:"Diagnose root cause and plan fix",status:"pending"},{id:"step-2",description:"Apply fix and add/update regression test",status:"pending"},{id:"step-3",description:"Verify fix and run full test suite",status:"pending"}],_v=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:Q$},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:ek},{id:"bug-fix",name:"Bug fix",description:"Reproduction \u2192 diagnosis \u2192 fix \u2192 regression test",defaultGoal:"Fix {{target}}: reproduce, diagnose, fix, and add regression test.",steps:tk}],qs=new Map(_v.map(n=>[n.id,n])),Vs=!1;function bv(){if(Vs)return;let n=vv.join(X$.homedir(),".shadow","templates");if(!xm.existsSync(n)){b.debug({templatesDir:n},"Custom templates directory does not exist"),Vs=!0;return}try{let e=xm.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=vv.join(n,r),t=xm.readFileSync(i,"utf8"),o=JSON.parse(t);if(!o.id||!o.name||!o.defaultGoal||!o.steps){b.warn({file:r,template:o},"Invalid custom template structure - skipping");continue}if(!Array.isArray(o.steps)||o.steps.length===0){b.warn({file:r},"Template has no steps - skipping");continue}if(_v.some(s=>s.id===o.id)){b.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}qs.set(o.id,o),b.info({file:r,templateId:o.id},"Loaded custom template")}catch(i){b.warn({file:r,error:i},"Failed to load custom template")}Vs=!0}catch(e){b.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),Vs=!0}}function nk(){return bv(),Array.from(qs.values())}function xv(n){return bv(),qs.get(n)}function rk(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function Sm(n,e,r={}){let i=xv(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from(qs.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=rk(i.defaultGoal,{...r,target:t}),a=St.normalize({steps:i.steps}),c=St.stringify(a);return{name:o,goal:s,strategy:c}}X();X();import{execSync as sr}from"child_process";var ai=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{sr(`git notes --ref ${this.ref} add -f -m '${r.replace(/'/g,"'\\''")}' ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(i){throw new Error(`Failed to add git note to ${e}: ${i.message}`)}}getNote(e){try{return sr(`git notes --ref ${this.ref} show ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()}catch{return null}}listNotes(){let e=new Map;try{let r=sr(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
|
|
709
|
-
`);for(let t of i){let[o,s]=t.split(" ");if(s){let a=this.getNote(s);a&&e.set(s,a)}}}catch{}return e}removeNote(e){try{
|
|
811
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of n.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(n.external){let l=n.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(n.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&n.reused==="ref"){o(s);continue}}}function cn(n,e){let r=n.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let a=n.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){i(u);let d=n.seen.get(u),m=d.schema;if(m.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),s._zod.parent===u)for(let h in c)h==="$ref"||h==="allOf"||h in l||delete c[h];if(m.$ref&&d.def)for(let h in c)h==="$ref"||h==="allOf"||h in d.def&&JSON.stringify(c[h])===JSON.stringify(d.def[h])&&delete c[h]}let p=s._zod.parent;if(p&&p!==u){i(p);let d=n.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(let m in c)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(c[m])===JSON.stringify(d.def[m])&&delete c[m]}n.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...n.seen.entries()].reverse())i(s[0]);let t={};if(n.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){let s=n.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");t.$id=n.external.uri(s)}Object.assign(t,r.def??r.schema);let o=n.external?.defs??{};for(let s of n.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?t.$defs=o:t.definitions=o);try{let s=JSON.parse(JSON.stringify(t));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:br(e,"input",n.processors),output:br(e,"output",n.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function De(n,e){let r=e??{seen:new Set};if(r.seen.has(n))return!1;r.seen.add(n);let i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return De(i.element,r);if(i.type==="set")return De(i.valueType,r);if(i.type==="lazy")return De(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 De(i.innerType,r);if(i.type==="intersection")return De(i.left,r)||De(i.right,r);if(i.type==="record"||i.type==="map")return De(i.keyType,r)||De(i.valueType,r);if(i.type==="pipe")return De(i.in,r)||De(i.out,r);if(i.type==="object"){for(let t in i.shape)if(De(i.shape[t],r))return!0;return!1}if(i.type==="union"){for(let t of i.options)if(De(t,r))return!0;return!1}if(i.type==="tuple"){for(let t of i.items)if(De(t,r))return!0;return!!(i.rest&&De(i.rest,r))}return!1}var sd=(n,e={})=>r=>{let i=sn({...r,processors:e});return ae(n,i),an(i,n),cn(i,n)},br=(n,e,r={})=>i=>{let{libraryOptions:t,target:o}=i??{},s=sn({...t??{},target:o,io:e,processors:r});return ae(n,s),an(s,n),cn(s,n)};var Gk={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ad=(n,e,r,i)=>{let t=r;t.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=n._zod.bag;if(typeof o=="number"&&(t.minLength=o),typeof s=="number"&&(t.maxLength=s),a&&(t.format=Gk[a]??a,t.format===""&&delete t.format,a==="time"&&delete t.format),l&&(t.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?t.pattern=u[0].source:u.length>1&&(t.allOf=[...u.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},cd=(n,e,r,i)=>{let t=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=n._zod.bag;typeof a=="string"&&a.includes("int")?t.type="integer":t.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.minimum=u,t.exclusiveMinimum=!0):t.exclusiveMinimum=u),typeof o=="number"&&(t.minimum=o,typeof u=="number"&&e.target!=="draft-04"&&(u>=o?delete t.minimum:delete t.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(t.maximum=l,t.exclusiveMaximum=!0):t.exclusiveMaximum=l),typeof s=="number"&&(t.maximum=s,typeof l=="number"&&e.target!=="draft-04"&&(l<=s?delete t.maximum:delete t.exclusiveMaximum)),typeof c=="number"&&(t.multipleOf=c)},ld=(n,e,r,i)=>{r.type="boolean"},ud=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},pd=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},dd=(n,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},md=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},fd=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},hd=(n,e,r,i)=>{r.not={}},gd=(n,e,r,i)=>{},yd=(n,e,r,i)=>{},bd=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},vd=(n,e,r,i)=>{let t=n._zod.def,o=ti(t.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},_d=(n,e,r,i)=>{let t=n._zod.def,o=[];for(let s of t.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},xd=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Sd=(n,e,r,i)=>{let t=r,o=n._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=o.source},$d=(n,e,r,i)=>{let t=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=n._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(t,o)):(Object.assign(t,o),t.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(t,o)},wd=(n,e,r,i)=>{r.type="boolean"},kd=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ed=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Id=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Td=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Rd=(n,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Pd=(n,e,r,i)=>{let t=r,o=n._zod.def,{minimum:s,maximum:a}=n._zod.bag;typeof s=="number"&&(t.minItems=s),typeof a=="number"&&(t.maxItems=a),t.type="array",t.items=ae(o.element,e,{...i,path:[...i.path,"items"]})},Nd=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object",t.properties={};let s=o.shape;for(let l in s)t.properties[l]=ae(s[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(t.required=Array.from(c)),o.catchall?._zod.def.type==="never"?t.additionalProperties=!1:o.catchall?o.catchall&&(t.additionalProperties=ae(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(t.additionalProperties=!1)},js=(n,e,r,i)=>{let t=n._zod.def,o=t.inclusive===!1,s=t.options.map((a,c)=>ae(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},zd=(n,e,r,i)=>{let t=n._zod.def,o=ae(t.left,e,{...i,path:[...i.path,"allOf",0]}),s=ae(t.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},Cd=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,m)=>ae(d,e,{...i,path:[...i.path,s,m]})),l=o.rest?ae(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(t.prefixItems=c,l&&(t.items=l)):e.target==="openapi-3.0"?(t.items={anyOf:c},l&&t.items.anyOf.push(l),t.minItems=c.length,l||(t.maxItems=c.length)):(t.items=c,l&&(t.additionalItems=l));let{minimum:u,maximum:p}=n._zod.bag;typeof u=="number"&&(t.minItems=u),typeof p=="number"&&(t.maxItems=p)},Ad=(n,e,r,i)=>{let t=r,o=n._zod.def;t.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=ae(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)t.patternProperties[p.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(t.propertyNames=ae(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),t.additionalProperties=ae(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(t.required=u)}},Dd=(n,e,r,i)=>{let t=n._zod.def,o=ae(t.innerType,e,i),s=e.seen.get(n);e.target==="openapi-3.0"?(s.ref=t.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Ld=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Od=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.default=JSON.parse(JSON.stringify(t.defaultValue))},Md=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(t.defaultValue)))},jd=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType;let s;try{s=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Fd=(n,e,r,i)=>{let t=n._zod.def,o=e.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;ae(o,e,i);let s=e.seen.get(n);s.ref=o},Ud=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType,r.readOnly=!0},Zd=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Fs=(n,e,r,i)=>{let t=n._zod.def;ae(t.innerType,e,i);let o=e.seen.get(n);o.ref=t.innerType},Hd=(n,e,r,i)=>{let t=n._zod.innerType;ae(t,e,i);let o=e.seen.get(n);o.ref=t},Ms={string:ad,number:cd,boolean:ld,bigint:ud,symbol:pd,null:dd,undefined:md,void:fd,never:hd,any:gd,unknown:yd,date:bd,enum:vd,literal:_d,nan:xd,template_literal:Sd,file:$d,success:wd,custom:kd,function:Ed,transform:Id,map:Td,set:Rd,array:Pd,object:Nd,union:js,intersection:zd,tuple:Cd,record:Ad,nullable:Dd,nonoptional:Ld,default:Od,prefault:Md,catch:jd,pipe:Fd,readonly:Ud,promise:Zd,optional:Fs,lazy:Hd};function Us(n,e){if("_idmap"in n){let i=n,t=sn({...e,processors:Ms}),o={};for(let c of i._idmap.entries()){let[l,u]=c;ae(u,t)}let s={},a={registry:i,uri:e?.uri,defs:o};t.external=a;for(let c of i._idmap.entries()){let[l,u]=c;an(t,u),s[l]=cn(t,u)}if(Object.keys(o).length>0){let c=t.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=sn({...e,processors:Ms});return ae(n,r),an(r,n),cn(r,n)}var Zs=class{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 r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=sn({processors:Ms,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ae(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),an(this.ctx,e);let i=cn(this.ctx,e),{"~standard":t,...o}=i;return o}};var ub={};var vi={};Ze(vi,{ZodAny:()=>mm,ZodArray:()=>ym,ZodBase64:()=>la,ZodBase64URL:()=>ua,ZodBigInt:()=>kr,ZodBigIntFormat:()=>ma,ZodBoolean:()=>wr,ZodCIDRv4:()=>aa,ZodCIDRv6:()=>ca,ZodCUID:()=>ea,ZodCUID2:()=>ta,ZodCatch:()=>jm,ZodCodec:()=>xa,ZodCustom:()=>Pi,ZodCustomStringFormat:()=>Sr,ZodDate:()=>ki,ZodDefault:()=>Cm,ZodDiscriminatedUnion:()=>vm,ZodE164:()=>pa,ZodEmail:()=>Ys,ZodEmoji:()=>Xs,ZodEnum:()=>_r,ZodExactOptional:()=>Pm,ZodFile:()=>Tm,ZodFunction:()=>Vm,ZodGUID:()=>_i,ZodIPv4:()=>oa,ZodIPv6:()=>sa,ZodIntersection:()=>_m,ZodJWT:()=>da,ZodKSUID:()=>ia,ZodLazy:()=>Bm,ZodLiteral:()=>Im,ZodMAC:()=>sm,ZodMap:()=>km,ZodNaN:()=>Um,ZodNanoID:()=>Qs,ZodNever:()=>hm,ZodNonOptional:()=>va,ZodNull:()=>pm,ZodNullable:()=>zm,ZodNumber:()=>$r,ZodNumberFormat:()=>Tn,ZodObject:()=>Ii,ZodOptional:()=>ba,ZodPipe:()=>_a,ZodPrefault:()=>Dm,ZodPromise:()=>Jm,ZodReadonly:()=>Zm,ZodRecord:()=>Ri,ZodSet:()=>Em,ZodString:()=>xr,ZodStringFormat:()=>ue,ZodSuccess:()=>Mm,ZodSymbol:()=>lm,ZodTemplateLiteral:()=>Wm,ZodTransform:()=>Rm,ZodTuple:()=>Sm,ZodType:()=>ie,ZodULID:()=>na,ZodURL:()=>wi,ZodUUID:()=>St,ZodUndefined:()=>um,ZodUnion:()=>Ti,ZodUnknown:()=>fm,ZodVoid:()=>gm,ZodXID:()=>ra,ZodXor:()=>bm,_ZodString:()=>Ks,_default:()=>Am,_function:()=>yv,any:()=>qb,array:()=>Ei,base64:()=>zb,base64url:()=>Cb,bigint:()=>Wb,boolean:()=>cm,catch:()=>Fm,check:()=>bv,cidrv4:()=>Pb,cidrv6:()=>Nb,codec:()=>fv,cuid:()=>Sb,cuid2:()=>$b,custom:()=>vv,date:()=>Yb,describe:()=>_v,discriminatedUnion:()=>rv,e164:()=>Ab,email:()=>db,emoji:()=>_b,enum:()=>ga,exactOptional:()=>Nm,file:()=>uv,float32:()=>Fb,float64:()=>Ub,function:()=>yv,guid:()=>mb,hash:()=>jb,hex:()=>Mb,hostname:()=>Ob,httpUrl:()=>vb,instanceof:()=>Sv,int:()=>qs,int32:()=>Zb,int64:()=>Bb,intersection:()=>xm,ipv4:()=>Ib,ipv6:()=>Rb,json:()=>wv,jwt:()=>Db,keyof:()=>Xb,ksuid:()=>Eb,lazy:()=>Gm,literal:()=>lv,looseObject:()=>tv,looseRecord:()=>ov,mac:()=>Tb,map:()=>sv,meta:()=>xv,nan:()=>mv,nanoid:()=>xb,nativeEnum:()=>cv,never:()=>fa,nonoptional:()=>Om,null:()=>dm,nullable:()=>Si,nullish:()=>pv,number:()=>am,object:()=>Qb,optional:()=>xi,partialRecord:()=>iv,pipe:()=>$i,prefault:()=>Lm,preprocess:()=>kv,promise:()=>gv,readonly:()=>Hm,record:()=>wm,refine:()=>qm,set:()=>av,strictObject:()=>ev,string:()=>Vs,stringFormat:()=>Lb,stringbool:()=>$v,success:()=>dv,superRefine:()=>Km,symbol:()=>Jb,templateLiteral:()=>hv,transform:()=>ya,tuple:()=>$m,uint32:()=>Hb,uint64:()=>Gb,ulid:()=>wb,undefined:()=>Vb,union:()=>ha,unknown:()=>In,url:()=>bb,uuid:()=>fb,uuidv4:()=>hb,uuidv6:()=>gb,uuidv7:()=>yb,void:()=>Kb,xid:()=>kb,xor:()=>nv});var Hs={};Ze(Hs,{endsWith:()=>ur,gt:()=>_t,gte:()=>Ae,includes:()=>cr,length:()=>En,lowercase:()=>sr,lt:()=>vt,lte:()=>Je,maxLength:()=>kn,maxSize:()=>on,mime:()=>pr,minLength:()=>At,minSize:()=>xt,multipleOf:()=>rn,negative:()=>As,nonnegative:()=>Ls,nonpositive:()=>Ds,normalize:()=>dr,overwrite:()=>lt,positive:()=>Cs,property:()=>Os,regex:()=>or,size:()=>wn,slugify:()=>gr,startsWith:()=>lr,toLowerCase:()=>fr,toUpperCase:()=>hr,trim:()=>mr,uppercase:()=>ar});var vr={};Ze(vr,{ZodISODate:()=>Bs,ZodISODateTime:()=>Ws,ZodISODuration:()=>Js,ZodISOTime:()=>Gs,date:()=>Bd,datetime:()=>Wd,duration:()=>Jd,time:()=>Gd});var Ws=w("ZodISODateTime",(n,e)=>{xu.init(n,e),ue.init(n,e)});function Wd(n){return kp(Ws,n)}var Bs=w("ZodISODate",(n,e)=>{Su.init(n,e),ue.init(n,e)});function Bd(n){return Ep(Bs,n)}var Gs=w("ZodISOTime",(n,e)=>{$u.init(n,e),ue.init(n,e)});function Gd(n){return Ip(Gs,n)}var Js=w("ZodISODuration",(n,e)=>{wu.init(n,e),ue.init(n,e)});function Jd(n){return Tp(Js,n)}var pb=(n,e)=>{si.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:r=>ci(n,r)},flatten:{value:r=>ai(n,r)},addIssue:{value:r=>{n.issues.push(r),n.message=JSON.stringify(n.issues,Kn,2)}},addIssues:{value:r=>{n.issues.push(...r),n.message=JSON.stringify(n.issues,Kn,2)}},isEmpty:{get(){return n.issues.length===0}}})},Vk=w("ZodError",pb),Ue=w("ZodError",pb,{Parent:Error});var Vd=Qn(Ue),qd=er(Ue),Kd=tr(Ue),Yd=nr(Ue),Xd=Uo(Ue),Qd=Zo(Ue),em=Ho(Ue),tm=Wo(Ue),nm=Bo(Ue),rm=Go(Ue),im=Jo(Ue),om=Vo(Ue);var ie=w("ZodType",(n,e)=>(ne.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:br(n,"input"),output:br(n,"output")}}),n.toJSONSchema=sd(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...r)=>n.clone(U.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),n.with=n.check,n.clone=(r,i)=>Ce(n,r,i),n.brand=()=>n,n.register=((r,i)=>(r.add(n,i),n)),n.parse=(r,i)=>Vd(n,r,i,{callee:n.parse}),n.safeParse=(r,i)=>Kd(n,r,i),n.parseAsync=async(r,i)=>qd(n,r,i,{callee:n.parseAsync}),n.safeParseAsync=async(r,i)=>Yd(n,r,i),n.spa=n.safeParseAsync,n.encode=(r,i)=>Xd(n,r,i),n.decode=(r,i)=>Qd(n,r,i),n.encodeAsync=async(r,i)=>em(n,r,i),n.decodeAsync=async(r,i)=>tm(n,r,i),n.safeEncode=(r,i)=>nm(n,r,i),n.safeDecode=(r,i)=>rm(n,r,i),n.safeEncodeAsync=async(r,i)=>im(n,r,i),n.safeDecodeAsync=async(r,i)=>om(n,r,i),n.refine=(r,i)=>n.check(qm(r,i)),n.superRefine=r=>n.check(Km(r)),n.overwrite=r=>n.check(lt(r)),n.optional=()=>xi(n),n.exactOptional=()=>Nm(n),n.nullable=()=>Si(n),n.nullish=()=>xi(Si(n)),n.nonoptional=r=>Om(n,r),n.array=()=>Ei(n),n.or=r=>ha([n,r]),n.and=r=>xm(n,r),n.transform=r=>$i(n,ya(r)),n.default=r=>Am(n,r),n.prefault=r=>Lm(n,r),n.catch=r=>Fm(n,r),n.pipe=r=>$i(n,r),n.readonly=()=>Hm(n),n.describe=r=>{let i=n.clone();return Ee.add(i,{description:r}),i},Object.defineProperty(n,"description",{get(){return Ee.get(n)?.description},configurable:!0}),n.meta=(...r)=>{if(r.length===0)return Ee.get(n);let i=n.clone();return Ee.add(i,r[0]),i},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=r=>r(n),n)),Ks=w("_ZodString",(n,e)=>{$n.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ad(n,i,t,o);let r=n._zod.bag;n.format=r.format??null,n.minLength=r.minimum??null,n.maxLength=r.maximum??null,n.regex=(...i)=>n.check(or(...i)),n.includes=(...i)=>n.check(cr(...i)),n.startsWith=(...i)=>n.check(lr(...i)),n.endsWith=(...i)=>n.check(ur(...i)),n.min=(...i)=>n.check(At(...i)),n.max=(...i)=>n.check(kn(...i)),n.length=(...i)=>n.check(En(...i)),n.nonempty=(...i)=>n.check(At(1,...i)),n.lowercase=i=>n.check(sr(i)),n.uppercase=i=>n.check(ar(i)),n.trim=()=>n.check(mr()),n.normalize=(...i)=>n.check(dr(...i)),n.toLowerCase=()=>n.check(fr()),n.toUpperCase=()=>n.check(hr()),n.slugify=()=>n.check(gr())}),xr=w("ZodString",(n,e)=>{$n.init(n,e),Ks.init(n,e),n.email=r=>n.check(ms(Ys,r)),n.url=r=>n.check(bi(wi,r)),n.jwt=r=>n.check(zs(da,r)),n.emoji=r=>n.check(bs(Xs,r)),n.guid=r=>n.check(yi(_i,r)),n.uuid=r=>n.check(fs(St,r)),n.uuidv4=r=>n.check(hs(St,r)),n.uuidv6=r=>n.check(gs(St,r)),n.uuidv7=r=>n.check(ys(St,r)),n.nanoid=r=>n.check(vs(Qs,r)),n.guid=r=>n.check(yi(_i,r)),n.cuid=r=>n.check(_s(ea,r)),n.cuid2=r=>n.check(xs(ta,r)),n.ulid=r=>n.check(Ss(na,r)),n.base64=r=>n.check(Rs(la,r)),n.base64url=r=>n.check(Ps(ua,r)),n.xid=r=>n.check($s(ra,r)),n.ksuid=r=>n.check(ws(ia,r)),n.ipv4=r=>n.check(ks(oa,r)),n.ipv6=r=>n.check(Es(sa,r)),n.cidrv4=r=>n.check(Is(aa,r)),n.cidrv6=r=>n.check(Ts(ca,r)),n.e164=r=>n.check(Ns(pa,r)),n.datetime=r=>n.check(Wd(r)),n.date=r=>n.check(Bd(r)),n.time=r=>n.check(Gd(r)),n.duration=r=>n.check(Jd(r))});function Vs(n){return xp(xr,n)}var ue=w("ZodStringFormat",(n,e)=>{le.init(n,e),Ks.init(n,e)}),Ys=w("ZodEmail",(n,e)=>{du.init(n,e),ue.init(n,e)});function db(n){return ms(Ys,n)}var _i=w("ZodGUID",(n,e)=>{uu.init(n,e),ue.init(n,e)});function mb(n){return yi(_i,n)}var St=w("ZodUUID",(n,e)=>{pu.init(n,e),ue.init(n,e)});function fb(n){return fs(St,n)}function hb(n){return hs(St,n)}function gb(n){return gs(St,n)}function yb(n){return ys(St,n)}var wi=w("ZodURL",(n,e)=>{mu.init(n,e),ue.init(n,e)});function bb(n){return bi(wi,n)}function vb(n){return bi(wi,{protocol:/^https?$/,hostname:Xe.domain,...U.normalizeParams(n)})}var Xs=w("ZodEmoji",(n,e)=>{fu.init(n,e),ue.init(n,e)});function _b(n){return bs(Xs,n)}var Qs=w("ZodNanoID",(n,e)=>{hu.init(n,e),ue.init(n,e)});function xb(n){return vs(Qs,n)}var ea=w("ZodCUID",(n,e)=>{gu.init(n,e),ue.init(n,e)});function Sb(n){return _s(ea,n)}var ta=w("ZodCUID2",(n,e)=>{yu.init(n,e),ue.init(n,e)});function $b(n){return xs(ta,n)}var na=w("ZodULID",(n,e)=>{bu.init(n,e),ue.init(n,e)});function wb(n){return Ss(na,n)}var ra=w("ZodXID",(n,e)=>{vu.init(n,e),ue.init(n,e)});function kb(n){return $s(ra,n)}var ia=w("ZodKSUID",(n,e)=>{_u.init(n,e),ue.init(n,e)});function Eb(n){return ws(ia,n)}var oa=w("ZodIPv4",(n,e)=>{ku.init(n,e),ue.init(n,e)});function Ib(n){return ks(oa,n)}var sm=w("ZodMAC",(n,e)=>{Iu.init(n,e),ue.init(n,e)});function Tb(n){return $p(sm,n)}var sa=w("ZodIPv6",(n,e)=>{Eu.init(n,e),ue.init(n,e)});function Rb(n){return Es(sa,n)}var aa=w("ZodCIDRv4",(n,e)=>{Tu.init(n,e),ue.init(n,e)});function Pb(n){return Is(aa,n)}var ca=w("ZodCIDRv6",(n,e)=>{Ru.init(n,e),ue.init(n,e)});function Nb(n){return Ts(ca,n)}var la=w("ZodBase64",(n,e)=>{Nu.init(n,e),ue.init(n,e)});function zb(n){return Rs(la,n)}var ua=w("ZodBase64URL",(n,e)=>{zu.init(n,e),ue.init(n,e)});function Cb(n){return Ps(ua,n)}var pa=w("ZodE164",(n,e)=>{Cu.init(n,e),ue.init(n,e)});function Ab(n){return Ns(pa,n)}var da=w("ZodJWT",(n,e)=>{Au.init(n,e),ue.init(n,e)});function Db(n){return zs(da,n)}var Sr=w("ZodCustomStringFormat",(n,e)=>{Du.init(n,e),ue.init(n,e)});function Lb(n,e,r={}){return yr(Sr,n,e,r)}function Ob(n){return yr(Sr,"hostname",Xe.hostname,n)}function Mb(n){return yr(Sr,"hex",Xe.hex,n)}function jb(n,e){let r=e?.enc??"hex",i=`${n}_${r}`,t=Xe[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return yr(Sr,i,t,e)}var $r=w("ZodNumber",(n,e)=>{is.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>cd(n,i,t,o),n.gt=(i,t)=>n.check(_t(i,t)),n.gte=(i,t)=>n.check(Ae(i,t)),n.min=(i,t)=>n.check(Ae(i,t)),n.lt=(i,t)=>n.check(vt(i,t)),n.lte=(i,t)=>n.check(Je(i,t)),n.max=(i,t)=>n.check(Je(i,t)),n.int=i=>n.check(qs(i)),n.safe=i=>n.check(qs(i)),n.positive=i=>n.check(_t(0,i)),n.nonnegative=i=>n.check(Ae(0,i)),n.negative=i=>n.check(vt(0,i)),n.nonpositive=i=>n.check(Je(0,i)),n.multipleOf=(i,t)=>n.check(rn(i,t)),n.step=(i,t)=>n.check(rn(i,t)),n.finite=()=>n;let r=n._zod.bag;n.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),n.isFinite=!0,n.format=r.format??null});function am(n){return Rp($r,n)}var Tn=w("ZodNumberFormat",(n,e)=>{Lu.init(n,e),$r.init(n,e)});function qs(n){return Np(Tn,n)}function Fb(n){return zp(Tn,n)}function Ub(n){return Cp(Tn,n)}function Zb(n){return Ap(Tn,n)}function Hb(n){return Dp(Tn,n)}var wr=w("ZodBoolean",(n,e)=>{di.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>ld(n,r,i,t)});function cm(n){return Lp(wr,n)}var kr=w("ZodBigInt",(n,e)=>{os.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>ud(n,i,t,o),n.gte=(i,t)=>n.check(Ae(i,t)),n.min=(i,t)=>n.check(Ae(i,t)),n.gt=(i,t)=>n.check(_t(i,t)),n.gte=(i,t)=>n.check(Ae(i,t)),n.min=(i,t)=>n.check(Ae(i,t)),n.lt=(i,t)=>n.check(vt(i,t)),n.lte=(i,t)=>n.check(Je(i,t)),n.max=(i,t)=>n.check(Je(i,t)),n.positive=i=>n.check(_t(BigInt(0),i)),n.negative=i=>n.check(vt(BigInt(0),i)),n.nonpositive=i=>n.check(Je(BigInt(0),i)),n.nonnegative=i=>n.check(Ae(BigInt(0),i)),n.multipleOf=(i,t)=>n.check(rn(i,t));let r=n._zod.bag;n.minValue=r.minimum??null,n.maxValue=r.maximum??null,n.format=r.format??null});function Wb(n){return Mp(kr,n)}var ma=w("ZodBigIntFormat",(n,e)=>{Ou.init(n,e),kr.init(n,e)});function Bb(n){return Fp(ma,n)}function Gb(n){return Up(ma,n)}var lm=w("ZodSymbol",(n,e)=>{Mu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>pd(n,r,i,t)});function Jb(n){return Zp(lm,n)}var um=w("ZodUndefined",(n,e)=>{ju.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>md(n,r,i,t)});function Vb(n){return Hp(um,n)}var pm=w("ZodNull",(n,e)=>{Fu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>dd(n,r,i,t)});function dm(n){return Wp(pm,n)}var mm=w("ZodAny",(n,e)=>{Uu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>gd(n,r,i,t)});function qb(){return Bp(mm)}var fm=w("ZodUnknown",(n,e)=>{Zu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>yd(n,r,i,t)});function In(){return Gp(fm)}var hm=w("ZodNever",(n,e)=>{Hu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>hd(n,r,i,t)});function fa(n){return Jp(hm,n)}var gm=w("ZodVoid",(n,e)=>{Wu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>fd(n,r,i,t)});function Kb(n){return Vp(gm,n)}var ki=w("ZodDate",(n,e)=>{Bu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>bd(n,i,t,o),n.min=(i,t)=>n.check(Ae(i,t)),n.max=(i,t)=>n.check(Je(i,t));let r=n._zod.bag;n.minDate=r.minimum?new Date(r.minimum):null,n.maxDate=r.maximum?new Date(r.maximum):null});function Yb(n){return qp(ki,n)}var ym=w("ZodArray",(n,e)=>{Gu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Pd(n,r,i,t),n.element=e.element,n.min=(r,i)=>n.check(At(r,i)),n.nonempty=r=>n.check(At(1,r)),n.max=(r,i)=>n.check(kn(r,i)),n.length=(r,i)=>n.check(En(r,i)),n.unwrap=()=>n.element});function Ei(n,e){return Xp(ym,n,e)}function Xb(n){let e=n._zod.def.shape;return ga(Object.keys(e))}var Ii=w("ZodObject",(n,e)=>{Ju.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Nd(n,r,i,t),U.defineLazy(n,"shape",()=>e.shape),n.keyof=()=>ga(Object.keys(n._zod.def.shape)),n.catchall=r=>n.clone({...n._zod.def,catchall:r}),n.passthrough=()=>n.clone({...n._zod.def,catchall:In()}),n.loose=()=>n.clone({...n._zod.def,catchall:In()}),n.strict=()=>n.clone({...n._zod.def,catchall:fa()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=r=>U.extend(n,r),n.safeExtend=r=>U.safeExtend(n,r),n.merge=r=>U.merge(n,r),n.pick=r=>U.pick(n,r),n.omit=r=>U.omit(n,r),n.partial=(...r)=>U.partial(ba,n,r[0]),n.required=(...r)=>U.required(va,n,r[0])});function Qb(n,e){let r={type:"object",shape:n??{},...U.normalizeParams(e)};return new Ii(r)}function ev(n,e){return new Ii({type:"object",shape:n,catchall:fa(),...U.normalizeParams(e)})}function tv(n,e){return new Ii({type:"object",shape:n,catchall:In(),...U.normalizeParams(e)})}var Ti=w("ZodUnion",(n,e)=>{mi.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>js(n,r,i,t),n.options=e.options});function ha(n,e){return new Ti({type:"union",options:n,...U.normalizeParams(e)})}var bm=w("ZodXor",(n,e)=>{Ti.init(n,e),Vu.init(n,e),n._zod.processJSONSchema=(r,i,t)=>js(n,r,i,t),n.options=e.options});function nv(n,e){return new bm({type:"union",options:n,inclusive:!1,...U.normalizeParams(e)})}var vm=w("ZodDiscriminatedUnion",(n,e)=>{Ti.init(n,e),qu.init(n,e)});function rv(n,e,r){return new vm({type:"union",options:e,discriminator:n,...U.normalizeParams(r)})}var _m=w("ZodIntersection",(n,e)=>{Ku.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>zd(n,r,i,t)});function xm(n,e){return new _m({type:"intersection",left:n,right:e})}var Sm=w("ZodTuple",(n,e)=>{ss.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Cd(n,r,i,t),n.rest=r=>n.clone({...n._zod.def,rest:r})});function $m(n,e,r){let i=e instanceof ne,t=i?r:e,o=i?e:null;return new Sm({type:"tuple",items:n,rest:o,...U.normalizeParams(t)})}var Ri=w("ZodRecord",(n,e)=>{Yu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ad(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType});function wm(n,e,r){return new Ri({type:"record",keyType:n,valueType:e,...U.normalizeParams(r)})}function iv(n,e,r){let i=Ce(n);return i._zod.values=void 0,new Ri({type:"record",keyType:i,valueType:e,...U.normalizeParams(r)})}function ov(n,e,r){return new Ri({type:"record",keyType:n,valueType:e,mode:"loose",...U.normalizeParams(r)})}var km=w("ZodMap",(n,e)=>{Xu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Td(n,r,i,t),n.keyType=e.keyType,n.valueType=e.valueType,n.min=(...r)=>n.check(xt(...r)),n.nonempty=r=>n.check(xt(1,r)),n.max=(...r)=>n.check(on(...r)),n.size=(...r)=>n.check(wn(...r))});function sv(n,e,r){return new km({type:"map",keyType:n,valueType:e,...U.normalizeParams(r)})}var Em=w("ZodSet",(n,e)=>{Qu.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Rd(n,r,i,t),n.min=(...r)=>n.check(xt(...r)),n.nonempty=r=>n.check(xt(1,r)),n.max=(...r)=>n.check(on(...r)),n.size=(...r)=>n.check(wn(...r))});function av(n,e){return new Em({type:"set",valueType:n,...U.normalizeParams(e)})}var _r=w("ZodEnum",(n,e)=>{ep.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(i,t,o)=>vd(n,i,t,o),n.enum=e.entries,n.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));n.extract=(i,t)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new _r({...e,checks:[],...U.normalizeParams(t),entries:o})},n.exclude=(i,t)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new _r({...e,checks:[],...U.normalizeParams(t),entries:o})}});function ga(n,e){let r=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new _r({type:"enum",entries:r,...U.normalizeParams(e)})}function cv(n,e){return new _r({type:"enum",entries:n,...U.normalizeParams(e)})}var Im=w("ZodLiteral",(n,e)=>{tp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>_d(n,r,i,t),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function lv(n,e){return new Im({type:"literal",values:Array.isArray(n)?n:[n],...U.normalizeParams(e)})}var Tm=w("ZodFile",(n,e)=>{np.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>$d(n,r,i,t),n.min=(r,i)=>n.check(xt(r,i)),n.max=(r,i)=>n.check(on(r,i)),n.mime=(r,i)=>n.check(pr(Array.isArray(r)?r:[r],i))});function uv(n){return Qp(Tm,n)}var Rm=w("ZodTransform",(n,e)=>{rp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Id(n,r,i,t),n._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Xt(n.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(U.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),r.issues.push(U.issue(s))}};let t=e.transform(r.value,r);return t instanceof Promise?t.then(o=>(r.value=o,r)):(r.value=t,r)}});function ya(n){return new Rm({type:"transform",transform:n})}var ba=w("ZodOptional",(n,e)=>{as.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Fs(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function xi(n){return new ba({type:"optional",innerType:n})}var Pm=w("ZodExactOptional",(n,e)=>{ip.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Fs(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Nm(n){return new Pm({type:"optional",innerType:n})}var zm=w("ZodNullable",(n,e)=>{op.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Dd(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Si(n){return new zm({type:"nullable",innerType:n})}function pv(n){return xi(Si(n))}var Cm=w("ZodDefault",(n,e)=>{sp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Od(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function Am(n,e){return new Cm({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var Dm=w("ZodPrefault",(n,e)=>{ap.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Md(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Lm(n,e){return new Dm({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var va=w("ZodNonOptional",(n,e)=>{cp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ld(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Om(n,e){return new va({type:"nonoptional",innerType:n,...U.normalizeParams(e)})}var Mm=w("ZodSuccess",(n,e)=>{lp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>wd(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function dv(n){return new Mm({type:"success",innerType:n})}var jm=w("ZodCatch",(n,e)=>{up.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>jd(n,r,i,t),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Fm(n,e){return new jm({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}var Um=w("ZodNaN",(n,e)=>{pp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>xd(n,r,i,t)});function mv(n){return Yp(Um,n)}var _a=w("ZodPipe",(n,e)=>{dp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Fd(n,r,i,t),n.in=e.in,n.out=e.out});function $i(n,e){return new _a({type:"pipe",in:n,out:e})}var xa=w("ZodCodec",(n,e)=>{_a.init(n,e),fi.init(n,e)});function fv(n,e,r){return new xa({type:"pipe",in:n,out:e,transform:r.decode,reverseTransform:r.encode})}var Zm=w("ZodReadonly",(n,e)=>{mp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ud(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function Hm(n){return new Zm({type:"readonly",innerType:n})}var Wm=w("ZodTemplateLiteral",(n,e)=>{fp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Sd(n,r,i,t)});function hv(n,e){return new Wm({type:"template_literal",parts:n,...U.normalizeParams(e)})}var Bm=w("ZodLazy",(n,e)=>{yp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Hd(n,r,i,t),n.unwrap=()=>n._zod.def.getter()});function Gm(n){return new Bm({type:"lazy",getter:n})}var Jm=w("ZodPromise",(n,e)=>{gp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Zd(n,r,i,t),n.unwrap=()=>n._zod.def.innerType});function gv(n){return new Jm({type:"promise",innerType:n})}var Vm=w("ZodFunction",(n,e)=>{hp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>Ed(n,r,i,t)});function yv(n){return new Vm({type:"function",input:Array.isArray(n?.input)?$m(n?.input):n?.input??Ei(In()),output:n?.output??In()})}var Pi=w("ZodCustom",(n,e)=>{bp.init(n,e),ie.init(n,e),n._zod.processJSONSchema=(r,i,t)=>kd(n,r,i,t)});function bv(n){let e=new pe({check:"custom"});return e._zod.check=n,e}function vv(n,e){return ed(Pi,n??(()=>!0),e)}function qm(n,e={}){return td(Pi,n,e)}function Km(n){return nd(n)}var _v=rd,xv=id;function Sv(n,e={}){let r=new Pi({type:"custom",check:"custom",fn:i=>i instanceof n,abort:!0,...U.normalizeParams(e)});return r._zod.bag.Class=n,r._zod.check=i=>{i.value instanceof n||i.issues.push({code:"invalid_type",expected:n.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var $v=(...n)=>od({Codec:xa,Boolean:wr,String:xr},...n);function wv(n){let e=Gm(()=>ha([Vs(n),am(),cm(),dm(),Ei(e),wm(Vs(),e)]));return e}function kv(n,e){return $i(ya(n),e)}var Kk={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 Yk(n){ye({customError:n})}function Xk(){return ye().customError}var Ym;Ym||(Ym={});var q={...vi,...Hs,iso:vr},Qk=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 eE(n,e){let r=n.$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":e??"draft-2020-12"}function tE(n,e){if(!n.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=n.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let t=r[1];if(!t||!e.defs[t])throw new Error(`Reference not found: ${n}`);return e.defs[t]}throw new Error(`Reference not found: ${n}`)}function Ev(n,e){if(n.not!==void 0){if(typeof n.not=="object"&&Object.keys(n.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(n.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(n.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(n.if!==void 0||n.then!==void 0||n.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(n.dependentSchemas!==void 0||n.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(n.$ref){let t=n.$ref;if(e.refs.has(t))return e.refs.get(t);if(e.processing.has(t))return q.lazy(()=>{if(!e.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return e.refs.get(t)});e.processing.add(t);let o=tE(t,e),s=Te(o,e);return e.refs.set(t,s),e.processing.delete(t),s}if(n.enum!==void 0){let t=n.enum;if(e.version==="openapi-3.0"&&n.nullable===!0&&t.length===1&&t[0]===null)return q.null();if(t.length===0)return q.never();if(t.length===1)return q.literal(t[0]);if(t.every(s=>typeof s=="string"))return q.enum(t);let o=t.map(s=>q.literal(s));return o.length<2?o[0]:q.union([o[0],o[1],...o.slice(2)])}if(n.const!==void 0)return q.literal(n.const);let r=n.type;if(Array.isArray(r)){let t=r.map(o=>{let s={...n,type:o};return Ev(s,e)});return t.length===0?q.never():t.length===1?t[0]:q.union(t)}if(!r)return q.any();let i;switch(r){case"string":{let t=q.string();if(n.format){let o=n.format;o==="email"?t=t.check(q.email()):o==="uri"||o==="uri-reference"?t=t.check(q.url()):o==="uuid"||o==="guid"?t=t.check(q.uuid()):o==="date-time"?t=t.check(q.iso.datetime()):o==="date"?t=t.check(q.iso.date()):o==="time"?t=t.check(q.iso.time()):o==="duration"?t=t.check(q.iso.duration()):o==="ipv4"?t=t.check(q.ipv4()):o==="ipv6"?t=t.check(q.ipv6()):o==="mac"?t=t.check(q.mac()):o==="cidr"?t=t.check(q.cidrv4()):o==="cidr-v6"?t=t.check(q.cidrv6()):o==="base64"?t=t.check(q.base64()):o==="base64url"?t=t.check(q.base64url()):o==="e164"?t=t.check(q.e164()):o==="jwt"?t=t.check(q.jwt()):o==="emoji"?t=t.check(q.emoji()):o==="nanoid"?t=t.check(q.nanoid()):o==="cuid"?t=t.check(q.cuid()):o==="cuid2"?t=t.check(q.cuid2()):o==="ulid"?t=t.check(q.ulid()):o==="xid"?t=t.check(q.xid()):o==="ksuid"&&(t=t.check(q.ksuid()))}typeof n.minLength=="number"&&(t=t.min(n.minLength)),typeof n.maxLength=="number"&&(t=t.max(n.maxLength)),n.pattern&&(t=t.regex(new RegExp(n.pattern))),i=t;break}case"number":case"integer":{let t=r==="integer"?q.number().int():q.number();typeof n.minimum=="number"&&(t=t.min(n.minimum)),typeof n.maximum=="number"&&(t=t.max(n.maximum)),typeof n.exclusiveMinimum=="number"?t=t.gt(n.exclusiveMinimum):n.exclusiveMinimum===!0&&typeof n.minimum=="number"&&(t=t.gt(n.minimum)),typeof n.exclusiveMaximum=="number"?t=t.lt(n.exclusiveMaximum):n.exclusiveMaximum===!0&&typeof n.maximum=="number"&&(t=t.lt(n.maximum)),typeof n.multipleOf=="number"&&(t=t.multipleOf(n.multipleOf)),i=t;break}case"boolean":{i=q.boolean();break}case"null":{i=q.null();break}case"object":{let t={},o=n.properties||{},s=new Set(n.required||[]);for(let[c,l]of Object.entries(o)){let u=Te(l,e);t[c]=s.has(c)?u:u.optional()}if(n.propertyNames){let c=Te(n.propertyNames,e),l=n.additionalProperties&&typeof n.additionalProperties=="object"?Te(n.additionalProperties,e):q.any();if(Object.keys(t).length===0){i=q.record(c,l);break}let u=q.object(t).passthrough(),p=q.looseRecord(c,l);i=q.intersection(u,p);break}if(n.patternProperties){let c=n.patternProperties,l=Object.keys(c),u=[];for(let d of l){let m=Te(c[d],e),f=q.string().regex(new RegExp(d));u.push(q.looseRecord(f,m))}let p=[];if(Object.keys(t).length>0&&p.push(q.object(t).passthrough()),p.push(...u),p.length===0)i=q.object({}).passthrough();else if(p.length===1)i=p[0];else{let d=q.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)d=q.intersection(d,p[m]);i=d}break}let a=q.object(t);n.additionalProperties===!1?i=a.strict():typeof n.additionalProperties=="object"?i=a.catchall(Te(n.additionalProperties,e)):i=a.passthrough();break}case"array":{let t=n.prefixItems,o=n.items;if(t&&Array.isArray(t)){let s=t.map(c=>Te(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Te(o,e):void 0;a?i=q.tuple(s).rest(a):i=q.tuple(s),typeof n.minItems=="number"&&(i=i.check(q.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(q.maxLength(n.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>Te(c,e)),a=n.additionalItems&&typeof n.additionalItems=="object"?Te(n.additionalItems,e):void 0;a?i=q.tuple(s).rest(a):i=q.tuple(s),typeof n.minItems=="number"&&(i=i.check(q.minLength(n.minItems))),typeof n.maxItems=="number"&&(i=i.check(q.maxLength(n.maxItems)))}else if(o!==void 0){let s=Te(o,e),a=q.array(s);typeof n.minItems=="number"&&(a=a.min(n.minItems)),typeof n.maxItems=="number"&&(a=a.max(n.maxItems)),i=a}else i=q.array(q.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n.description&&(i=i.describe(n.description)),n.default!==void 0&&(i=i.default(n.default)),i}function Te(n,e){if(typeof n=="boolean")return n?q.any():q.never();let r=Ev(n,e),i=n.type||n.enum!==void 0||n.const!==void 0;if(n.anyOf&&Array.isArray(n.anyOf)){let a=n.anyOf.map(l=>Te(l,e)),c=q.union(a);r=i?q.intersection(r,c):c}if(n.oneOf&&Array.isArray(n.oneOf)){let a=n.oneOf.map(l=>Te(l,e)),c=q.xor(a);r=i?q.intersection(r,c):c}if(n.allOf&&Array.isArray(n.allOf))if(n.allOf.length===0)r=i?r:q.any();else{let a=i?r:Te(n.allOf[0],e),c=i?0:1;for(let l=c;l<n.allOf.length;l++)a=q.intersection(a,Te(n.allOf[l],e));r=a}n.nullable===!0&&e.version==="openapi-3.0"&&(r=q.nullable(r)),n.readOnly===!0&&(r=q.readonly(r));let t={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in n&&(t[a]=n[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in n&&(t[a]=n[a]);for(let a of Object.keys(n))Qk.has(a)||(t[a]=n[a]);return Object.keys(t).length>0&&e.registry.add(r,t),r}function Iv(n,e){if(typeof n=="boolean")return n?q.any():q.never();let r=eE(n,e?.defaultTarget),i=n.$defs||n.definitions||{},t={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??Ee};return Te(n,t)}var Xm={};Ze(Xm,{bigint:()=>oE,boolean:()=>iE,date:()=>sE,number:()=>rE,string:()=>nE});function nE(n){return Sp(xr,n)}function rE(n){return Pp($r,n)}function iE(n){return Op(wr,n)}function oE(n){return jp(kr,n)}function sE(n){return Kp(ki,n)}ye(cs());var oL=g.object({repoPath:g.string(),mode:g.enum(["init","tree","topography","scout","hologram","tools"]),subPath:g.string().optional(),maxDepth:g.number().int().min(de.MIN_DEPTH).max(de.MAX_DEPTH).optional()}),sL=g.object({repoPath:g.string(),mode:g.enum(["symbol","concept","symbol-fuzzy","config","path"]).default("symbol"),query:g.string().max(de.MAX_QUERY_LENGTH).optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().min(de.MIN_LIMIT).max(de.MAX_LIMIT).optional(),offset:g.number().int().min(0).optional(),compact:g.boolean().optional(),tokenBudget:g.number().int().min(1).optional()}).refine(n=>!(n.mode==="concept"&&(!n.query||n.query.trim().length===0)),{message:"Concept search requires a non-empty query",path:["query"]}),aL=g.object({repoPath:g.string(),mode:g.enum(["symbol","file"]),filePath:g.string().optional(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional(),symbolName:g.string().optional(),context:g.enum(["definition","full"]).optional()}),cL=g.object({repoPath:g.string(),mode:g.enum(["impact","explain-diff","type-graph","deps","flow","dead-code","circular-deps"]),filePath:g.string().optional(),symbolName:g.string().optional(),direction:g.enum(["imports","imported_by"]).optional(),depth:g.number().int().min(de.MIN_DEPTH).max(de.MAX_DEPTH).optional(),limit:g.number().int().min(de.MIN_LIMIT).max(de.MAX_LIMIT).optional(),includeTests:g.boolean().optional()}),lL=g.object({repoPath:g.string(),action:g.enum(["index","repair","trace"]),deep:g.boolean().optional(),sinceCommit:g.string().optional()}),uL=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),pL=g.object({action:g.enum(["list","link","fuse"]),repoPaths:g.array(g.string()).optional(),name:g.string().optional(),status:g.string().optional(),parentRepoPath:g.string().optional(),parentMissionId:g.number().optional(),childRepoPath:g.string().optional(),childMissionId:g.number().optional(),relationship:g.string().optional()});var Tv=[...Og,...Mg];Q();Q();var aE=$.child({module:"strategy-normalizer"}),Qe=class{static normalize(e){if(!e)return{steps:[]};let r;if(typeof e=="string")try{r=JSON.parse(e)}catch(t){return aE.warn({strategyInput:e,err:t},"Failed to parse strategy JSON"),{steps:[]}}else r=e;return{steps:this.normalizeSteps(r)}}static normalizeSteps(e){return Array.isArray(e)?e.map((r,i)=>typeof r=="string"?{id:`step-${i}`,description:r,status:"pending"}:typeof r=="object"&&r!==null?{id:r.id||`step-${i}`,description:r.description||r.content||r.name||`Step ${i+1}`,status:r.status||"pending",dependencies:r.dependencies||r.deps,verification:r.verification,...r}:{id:`step-${i}`,description:String(r),status:"pending"}):e.steps&&Array.isArray(e.steps)?this.normalizeSteps(e.steps):typeof e=="object"?Object.entries(e).map(([r,i],t)=>typeof i=="string"?{id:r,description:i,status:"pending"}:typeof i=="object"&&i!==null?{id:r,description:i.description||i.content||i.name||r,status:i.status||"pending",dependencies:i.dependencies||i.deps,verification:i.verification,...i}:{id:r||`step-${t}`,description:String(i),status:"pending"}):[]}static stringify(e){return JSON.stringify(e,null,2)}static validate(e){let r=[];if(!e)return{valid:!0,errors:[]};try{let i=this.normalize(e),t=new Set;for(let o of i.steps)if(t.has(o.id)&&r.push(`Duplicate step ID: ${o.id}`),t.add(o.id),o.dependencies)for(let s of o.dependencies)t.has(s)||r.push(`Step "${o.id}" depends on non-existent step "${s}"`);return{valid:r.length===0,errors:r}}catch(i){return r.push(`Strategy validation failed: ${i instanceof Error?i.message:String(i)}`),{valid:!1,errors:r}}}};Q();import Qm from"fs";import Rv from"path";import cE from"os";var lE=[{id:"step-0",description:"Analyze impact: identify dependents and call sites",status:"pending"},{id:"step-1",description:"Implement refactor and update call sites",status:"pending"},{id:"step-2",description:"Run tests and verify behavior; update docs if needed",status:"pending"}],uE=[{id:"step-0",description:"Capture requirements and acceptance criteria",status:"pending"},{id:"step-1",description:"Implement feature with tests",status:"pending"},{id:"step-2",description:"Integrate and verify end-to-end",status:"pending"}],pE=[{id:"step-0",description:"Reproduce the bug and document steps",status:"pending"},{id:"step-1",description:"Diagnose root cause and plan fix",status:"pending"},{id:"step-2",description:"Apply fix and add/update regression test",status:"pending"},{id:"step-3",description:"Verify fix and run full test suite",status:"pending"}],Pv=[{id:"refactoring",name:"Refactoring",description:"Impact analysis \u2192 implementation \u2192 verification",defaultGoal:"Refactor {{target}} safely with full impact analysis and verification.",steps:lE},{id:"feature",name:"Feature",description:"Requirements \u2192 implementation \u2192 testing",defaultGoal:"Implement {{target}} with clear requirements and end-to-end verification.",steps:uE},{id:"bug-fix",name:"Bug fix",description:"Reproduction \u2192 diagnosis \u2192 fix \u2192 regression test",defaultGoal:"Fix {{target}}: reproduce, diagnose, fix, and add regression test.",steps:pE}],$a=new Map(Pv.map(n=>[n.id,n])),Sa=!1;function Nv(){if(Sa)return;let n=Rv.join(cE.homedir(),".shadow","templates");if(!Qm.existsSync(n)){$.debug({templatesDir:n},"Custom templates directory does not exist"),Sa=!0;return}try{let e=Qm.readdirSync(n).filter(r=>r.endsWith(".json"));for(let r of e)try{let i=Rv.join(n,r),t=Qm.readFileSync(i,"utf8"),o=JSON.parse(t);if(!o.id||!o.name||!o.defaultGoal||!o.steps){$.warn({file:r,template:o},"Invalid custom template structure - skipping");continue}if(!Array.isArray(o.steps)||o.steps.length===0){$.warn({file:r},"Template has no steps - skipping");continue}if(Pv.some(s=>s.id===o.id)){$.warn({file:r,templateId:o.id},"Custom template ID conflicts with built-in - skipping");continue}$a.set(o.id,o),$.info({file:r,templateId:o.id},"Loaded custom template")}catch(i){$.warn({file:r,error:i},"Failed to load custom template")}Sa=!0}catch(e){$.warn({error:e,templatesDir:n},"Failed to read custom templates directory"),Sa=!0}}function dE(){return Nv(),Array.from($a.values())}function zv(n){return Nv(),$a.get(n)}function mE(n,e){let r=n;for(let[i,t]of Object.entries(e))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),t);return r}function ef(n,e,r={}){let i=zv(n);if(!i)throw new Error(`Unknown template: ${n}. Use one of: ${Array.from($a.keys()).join(", ")}`);let t=r.target||"scope",o=e||(n==="refactoring"?`Refactor ${t}`:n==="feature"?`Feature: ${t}`:`Fix: ${t}`),s=mE(i.defaultGoal,{...r,target:t}),a=Qe.normalize({steps:i.steps}),c=Qe.stringify(a);return{name:o,goal:s,strategy:c}}ee();ee();import{execSync as Er}from"child_process";var Ni=class{constructor(e,r="refs/notes/shadow"){this.repoPath=e;this.ref=r}addNote(e,r){try{Er(`git notes --ref ${this.ref} add -f -m '${r.replace(/'/g,"'\\''")}' ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(i){throw new Error(`Failed to add git note to ${e}: ${i.message}`)}}getNote(e){try{return Er(`git notes --ref ${this.ref} show ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()}catch{return null}}listNotes(){let e=new Map;try{let r=Er(`git notes --ref ${this.ref} list`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim();if(!r)return e;let i=r.split(`
|
|
812
|
+
`);for(let t of i){let[o,s]=t.split(" ");if(s){let a=this.getNote(s);a&&e.set(s,a)}}}catch{}return e}removeNote(e){try{Er(`git notes --ref ${this.ref} remove ${e}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}push(e="origin"){try{Er(`git push ${e} ${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch(r){throw new Error(`Failed to push git notes to ${e}: ${r.message}`)}}fetch(e="origin"){try{Er(`git fetch ${e} ${this.ref}:${this.ref}`,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"})}catch{}}};Q();Gn();var Ir=$.child({module:"persistence-service"}),et=class{gitNotes;repoPath;constructor(e){this.repoPath=e,this.gitNotes=new Ni(e)}async syncMissionToGitNotes(e){let{missions:r,intentLogs:i}=z.getInstance(this.repoPath),t=r.findById(e);if(!t)throw new Error(`Mission ${e} not found`);if(!t.commit_sha){Ir.info({missionId:e},"Skipping Git Notes sync because mission has no commit_sha yet");return}Ir.info({missionId:e,commitSha:t.commit_sha},"Syncing mission to Git Notes");let o=r.getArtifacts(e),s=i.findByMission(e,1e3),a=s.find(u=>u.type==="adr"),c=s.filter(u=>u.type==="decision").map(u=>({content:u.content,symbol_name:u.symbol_name,created_at:u.created_at})),l={version:"1.0",mission:{name:t.name,goal:t.goal,status:t.status,strategy_graph:t.strategy_graph,git_branch:t.git_branch,commit_sha:t.commit_sha,parent_id:t.parent_id,verification_context:t.verification_context,outcome_contract:t.outcome_contract,created_at:t.created_at,updated_at:t.updated_at},artifacts:o,adr:a?a.content:null,decisions:c};this.gitNotes.addNote(t.commit_sha,JSON.stringify(l,null,2))}async syncAllToGitNotes(){let{missions:e}=z.getInstance(this.repoPath),r=e.findActive(),i=e.findRecentCompleted(10),t=[...r,...i];for(let o of t)try{await this.syncMissionToGitNotes(o.id)}catch(s){Ir.error({missionId:o.id,...we(s)},"Failed to sync mission")}}async recoverFromGitNotes(){let e=this.gitNotes.listNotes(),{missions:r,intentLogs:i}=z.getInstance(this.repoPath),t=0,o=0;for(let[s,a]of e.entries())try{let c=JSON.parse(a);if(c.version!=="1.0")continue;if(r.findByCommitShas([s]).some(d=>d.name===c.mission.name)){Ir.debug({commitSha:s,missionName:c.mission.name},"Mission already exists, skipping recovery");continue}let p=r.create({name:c.mission.name,goal:c.mission.goal,status:c.mission.status,strategy_graph:c.mission.strategy_graph,git_branch:c.mission.git_branch,commit_sha:s,parent_id:c.mission.parent_id,verification_context:c.mission.verification_context,outcome_contract:c.mission.outcome_contract});if(t++,c.adr&&(i.create({mission_id:Number(p),symbol_id:null,file_path:null,type:"adr",content:c.adr,confidence:1,symbol_name:null,signature:null,commit_sha:s}),o++),c.decisions&&c.decisions.length>0)for(let d of c.decisions)i.create({mission_id:Number(p),symbol_id:null,file_path:null,type:"decision",content:d.content,confidence:1,symbol_name:d.symbol_name,signature:null,commit_sha:s}),o++;Ir.info({commitSha:s,missionName:c.mission.name,logsRecovered:o},"Re-hydrated mission from Git Notes")}catch(c){Ir.error({commitSha:s,...we(c)},"Failed to parse Git Note for recovery")}return{missionsRecovered:t,logsRecovered:o}}};Gn();var zi=$.child({module:"mcp:tools:ops:plan"}),fE=["name","goal","strategy","parentId","outcomeContract"],hE="Mission update requires at least one updatable field: name, goal, strategy, parentId, outcomeContract.",gE="Mission requires name and goal (or templateId with optional templateVars).";async function Cv(n){let{repoPath:e,name:r,goal:i,strategy:t,missionId:o,parentId:s,outcomeContract:a,templateId:c,templateVars:l}=n,{missions:u}=z.getInstance(e),p=ge(e),d=Me(e);zi.info({repoPath:e,name:r,missionId:o,templateId:c},"Planning mission");try{let m=r,f=i,h=t;if(!o&&c){let b=ef(c,r,l||{});m=m??b.name,f=f??b.goal,h=h??b.strategy}let v,y;if(o){let b=u.findById(o);if(!b)throw new Error(`Mission ${o} not found.`);let _;if(t!==void 0)if(t){let k=Qe.normalize(t);_=Qe.stringify(k);let I=Qe.validate(_);I.valid||zi.warn({errors:I.errors,strategy:t},"Strategy validation warnings detected")}else _=null;let x={commit_sha:d};if(r!==void 0&&(x.name=r),i!==void 0&&(x.goal=i),_!==void 0&&(x.strategy_graph=_),s!==void 0&&(x.parent_id=s),a!==void 0&&(x.outcome_contract=a),Object.keys(x).length===1)throw new Error(hE);u.update(o,{...x}),v=o,y=`Mission "${r??b.name}" updated.`}else{if(!m||!f)throw new Error(gE);let b=null;if(h){let _=Qe.normalize(h);b=Qe.stringify(_);let x=Qe.validate(b);x.valid||zi.warn({errors:x.errors,strategy:h},"Strategy validation warnings detected")}v=u.create({name:m,goal:f,strategy_graph:b,status:"planned",git_branch:p,commit_sha:d,parent_id:s||null,verification_context:null,outcome_contract:a||null}),y=`Mission "${m}" planned.`}try{await new et(e).syncMissionToGitNotes(Number(v))}catch(b){zi.info({missionId:v,...we(b)},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:v,status:"planned",message:y,strategy_saved:!!h,contract_saved:!!a,updateable_fields:fE,from_template:c??void 0,commit:d},null,2)}]}}catch(m){let f=bt(m);throw zi.error({repoPath:e,...we(m)},"Failed to plan mission"),new Error(`Failed to plan mission: ${f}`)}}Q();ee();ee();Q();Q();var yE=$.child({module:"reasoning-engine"}),Lt=class{analyze(e){yE.debug({logCount:e.length},"Performing reasoning pass over intent logs");let r={context:[],decisions:[],consequences:[],recommendations:[],unclassified:[],sourceMissions:[]};for(let t of e){let o=t.content.toLowerCase(),s=this.matchesContext(o,t.type),a=this.matchesDecision(o,t.type),c=this.matchesConsequence(o,t.type),l=this.matchesRecommendation(o,t.type);s?r.context.push(t.content):a?r.decisions.push(t.content):l?r.recommendations.push(t.content):c?r.consequences.push(t.content):t.type==="decision"?r.decisions.push(t.content):t.type==="discovery"||t.type==="fix"?r.consequences.push(t.content):r.unclassified.push(t.content)}let i=new Set;for(let t of e)t.mission_id!=null&&i.add(t.mission_id);return r.sourceMissions=[...i],r}matchesContext(e,r){return["because","since","given","due to","context: ","problem: ","situation:"].some(t=>e.includes(t))||r==="blocker"}matchesDecision(e,r){return["decided","chose","implemented","integrated","using","selected","strategy:"].some(t=>e.includes(t))||r==="decision"}matchesConsequence(e,r){return["results in","enables","allows","impact: ","consequence: ","next steps: ","meaning"].some(t=>e.includes(t))||r==="fix"}matchesRecommendation(e,r){return["should","recommend","suggest","next work","future","consider","strategy advice"].some(t=>e.includes(t))}};var wa=$.child({module:"briefing-engine"}),$t=class{intentLogs;missions;reasoningEngine;persistencePivot;constructor(e){let{intentLogs:r,missions:i}=z.getInstance(e);this.intentLogs=r,this.missions=i,this.reasoningEngine=new Lt,this.persistencePivot=new et(e)}async distillMission(e,r=!0){wa.info({missionId:e},"Synthesizing mission intelligence into Tactical Briefing...");let i=this.gatherConsolidatedLogs(e);if(i.length===0)return{missionId:e,adr:"No intent logs found for this mission.",metrics:{totalLogs:0,symbolCount:0}};let t=this.reasoningEngine.analyze(i),o=new Set(i.map(a=>a.symbol_name).filter(Boolean)),s=`# Architectural Decision Record: Mission #${e}
|
|
710
813
|
|
|
711
814
|
`;if(s+=`## Summary of Intent
|
|
712
815
|
`,s+=`Collected ${i.length} intent events across ${o.size} symbols.
|
|
@@ -728,7 +831,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
728
831
|
`}),s+=`
|
|
729
832
|
`),s+=`
|
|
730
833
|
---
|
|
731
|
-
*Generated by Liquid Shadow Reasoning Engine v1*`,r){this.intentLogs.create({mission_id:e,type:"adr",content:s,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:null});try{await this.persistencePivot.syncMissionToGitNotes(e),
|
|
834
|
+
*Generated by Liquid Shadow Reasoning Engine v1*`,r){this.intentLogs.create({mission_id:e,type:"adr",content:s,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:null});try{await this.persistencePivot.syncMissionToGitNotes(e),wa.info({missionId:e},"Tactical Briefing synthesized, archived, and synced to Git Notes.")}catch(a){wa.error({missionId:e,error:a},"Failed to sync ADR to Git Notes")}}else wa.info({missionId:e},"Tactical Briefing synthesized (dry-run).");return{missionId:e,adr:s,metrics:{totalLogs:i.length,symbolCount:o.size}}}gatherConsolidatedLogs(e,r=0){let i=this.intentLogs.findByMissionPreferCrystal(e,500);if(r>2)return i;let t=this.missions.findByParentId(e);for(let o of t)i.push(...this.gatherConsolidatedLogs(o.id,r+1));return i.filter(o=>o.type!=="adr"&&o.type!=="system")}};Q();import{Visitor as bE}from"@swc/core/Visitor.js";import*as Av from"@swc/core";var vE=$.child({module:"verification-engine"}),tf=class extends bE{foundUsage=!1;foundImport=!1;rule;currentFunctionName=null;constructor(e){super(),this.rule=e}visitImportDeclaration(e){return this.rule.type==="import"&&e.source.value===this.rule.target&&(this.foundImport=!0),super.visitImportDeclaration(e)}visitFunctionDeclaration(e){let r=this.currentFunctionName;this.currentFunctionName=e.identifier.value;let i=super.visitFunctionDeclaration(e);return this.currentFunctionName=r,i}visitCallExpression(e){return this.rule.type==="usage"&&e.callee.type==="Identifier"&&e.callee.value===this.rule.target&&(!this.rule.context||this.currentFunctionName===this.rule.context)&&(this.foundUsage=!0),super.visitCallExpression(e)}},ka=class{async verify(e,r){try{let i=await Av.parse(e,{syntax:"typescript",tsx:!0,comments:!1}),t=new tf(r);t.visitProgram(i);let o=!1,s=[];if(r.type==="import")o=t.foundImport,o||s.push(`Required import "${r.target}" not found.`);else if(r.type==="usage"){if(o=t.foundUsage,!o){let a=r.context?` in function "${r.context}"`:"";s.push(`Required usage of "${r.target}"${a} not found.`)}}else r.type==="pattern"&&(o=new RegExp(r.target).test(e),o||s.push(`Required pattern "${r.target}" not found.`));return{passed:o,errors:s}}catch(i){return vE.error({error:i},"Verification failed due to parse error"),{passed:!1,errors:[`Parse error: ${i.message}`]}}}};Gn();import Dv from"path";import Ea from"fs";var tt=$.child({module:"mcp:tools:ops:track"});function nf(n,e){return Dv.isAbsolute(e)?e:Dv.join(n,e)}async function Lv(n,e,r){let{missions:i,intentLogs:t}=z.getInstance(n),o=i.findById(e);if(!o?.parent_id)return;let s=i.findByParentId(o.parent_id);if(!s.every(l=>l.status==="completed"))return;let c=i.findById(o.parent_id);if(!(!c||c.status==="completed")){tt.info({parentId:c.id,childCount:s.length},"All children completed \u2014 cascading parent completion"),i.updateStatus(c.id,"completed",r||void 0),i.clearWorkingSet(c.id),t.create({mission_id:c.id,type:"system",content:`Parent auto-completed: all ${s.length} child missions finished`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:r});try{await new $t(n).distillMission(c.id),tt.info({parentId:c.id},"Parent Auto-Synthesis completed")}catch(l){tt.info({parentId:c.id,...we(l)},"Parent Auto-Synthesis deferred")}try{await new et(n).syncMissionToGitNotes(c.id)}catch(l){tt.info({parentId:c.id,...we(l)},"Parent Git Notes sync deferred")}await Lv(n,c.id,r)}}async function Ov(n){let{repoPath:e,missionId:r,stepId:i,status:t,contextPivot:o,updates:s,artifacts:a}=n,{missions:c,intentLogs:l}=z.getInstance(e),u=Me(e);tt.info({repoPath:e,missionId:r,singleStep:i,batchCount:s?.length,artifactCount:a?.length},"Updating mission status");try{if(a&&Array.isArray(a))for(let m of a)c.addArtifact(r,m.type,m.identifier,m.metadata);let p=[];if(s&&Array.isArray(s)&&p.push(...s),i&&t&&p.push({stepId:i,status:t,contextPivot:o}),t&&!i){if(c.updateStatus(r,t,u||void 0),t==="completed"&&c.clearWorkingSet(r),l.create({mission_id:r,type:"system",content:`Mission status changed to "${t}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),t==="completed"){try{await new $t(e).distillMission(r),tt.info({missionId:r},"Auto-Synthesis completed successfully")}catch(m){tt.info({missionId:r,...we(m)},"Auto-Synthesis deferred or failed")}await Lv(e,r,u)}if(!p.length)return{content:[{type:"text",text:JSON.stringify({missionId:r,status:t,message:"Mission status updated successfully.",artifacts_added:a?.length||0,commit:u},null,2)}]}}if(p.length===0&&(!a||a.length===0))throw new Error("No updates provided. Must specify either 'updates', 'stepId'/'status', 'status' (top-level), or 'artifacts'.");let d=[];for(let m of p){let{stepId:f,status:h,contextPivot:v}=m,y=c.findById(r);if(!y)throw new Error(`Mission ID ${r} not found`);let b=JSON.parse(y.strategy_graph||"{}"),_=null;if(Array.isArray(b)?_=b.find(x=>x.id===f):b.nodes&&Array.isArray(b.nodes)?_=b.nodes.find(x=>x.id===f):b.steps?Array.isArray(b.steps)?_=b.steps.find(x=>x.id===f):_=b.steps[f]:b[f]&&(_=b[f]),!_)throw new Error(`Step ID "${f}" not found`);if(h==="completed"&&_.verification){let x=new ka,k=Array.isArray(_.verification)?_.verification:[_.verification];for(let I of k){let N=I;if(typeof I=="string"&&(N={type:"pattern",target:I}),!N||!N.target){tt.warn({rule:I},"Skipping invalid verification rule (missing target)");continue}let L=N.filePath;if(L&&(L=nf(e,L)),L){if(!Ea.existsSync(L))throw new Error(`Verification failed: File not found at ${L}`);let C=await x.verify(Ea.readFileSync(L,"utf8"),N);if(!C.passed)throw new Error(`Verification failed: ${C.errors.join("")}`)}else{let C=c.getWorkingSet(r),S=!1;C.length===0&&tt.warn("No working set files to verify against for rule");for(let R of C){let A=nf(e,R.file_path);if(!Ea.existsSync(A))continue;if((await x.verify(Ea.readFileSync(A,"utf8"),N)).passed){S=!0;break}}if(!S)throw new Error(`Verification failed: Rule "${N.target}" not satisfied in any working set file.`)}}}if(_.status=h,c.update(r,{strategy_graph:JSON.stringify(b),commit_sha:u}),l.create({mission_id:r,type:"system",content:`Step "${f}" updated to "${h}"`,confidence:1,symbol_id:null,file_path:null,symbol_name:null,signature:null,commit_sha:u}),v){let x=v.trim();if(x.startsWith("{")||x.startsWith("["))try{let k=JSON.parse(x);if(k.files&&Array.isArray(k.files)){c.clearWorkingSet(r);for(let I of k.files)c.addToWorkingSet(r,nf(e,I))}}catch(k){tt.warn({error:k},"Failed to apply context pivot")}}d.push({stepId:f,status:h})}try{await new et(e).syncMissionToGitNotes(r)}catch(m){tt.info({missionId:r,...we(m)},"Git Notes sync deferred")}return{content:[{type:"text",text:JSON.stringify({missionId:r,updates:d,artifacts_added:a?.length||0,message:"Status updated",commit:u},null,2)}]}}catch(p){let d=bt(p);throw tt.error({repoPath:e,...we(p)},"Failed to update status"),new Error(`Failed to update status: ${d}`)}}Q();var Mv=$.child({module:"mcp:tools:ops:briefing"});async function Ia(n){let{repoPath:e,scope:r="mission"}=n;Mv.info({repoPath:e,missionId:n.missionId,scope:r},"Generating briefing");try{let t=await new _n(e).getBriefing(n);if(!t&&r==="mission")return{content:[{type:"text",text:"No active missions found. Ready for new assignment."}]};let o;if(r==="project"){let s=t.counts;o=t.next_work_candidates.length===0&&s.active===0?{tool:"shadow_ops_plan",reason:"No open work; create a mission"}:{tool:"shadow_ops_track",reason:"Select a mission from hierarchy or next_work_candidates to execute"}}return{content:[{type:"text",text:JSON.stringify(t,null,2)}],suggestedNext:o}}catch(i){throw Mv.error({error:i,repoPath:e},"Failed to generate briefing"),new Error(`Failed to generate briefing: ${i instanceof Error?i.message:String(i)}`)}}ee();Q();var jv=$.child({module:"mcp:tools:ops:synthesize"});async function Fv(n){let{repoPath:e,missionId:r}=n;jv.info({repoPath:e,missionId:r},"Synthesizing mission");let{missions:i}=z.getInstance(e);try{if(!i.findById(r))throw new Error(`Mission ${r} not found`);let s=await new $t(e).distillMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,adr:s.adr,metrics:s.metrics},null,2)}]}}catch(t){throw jv.error({error:t,repoPath:e},"Failed to synthesize ADR"),new Error(`Failed to synthesize ADR: ${t instanceof Error?t.message:String(t)}`)}}Q();ee();Q();var _E=$.child({module:"narrative-service"}),Rn=class{missions;briefingEngine;repoPath;constructor(e){this.repoPath=e;let{missions:r}=z.getInstance(e);this.missions=r,this.briefingEngine=new $t(e)}async generateChronicle(e={}){_E.info(e,"Generating Repo Chronicle...");let i=this.missions.findAll().filter(l=>l.parent_id===null&&l.status!=="planned");e.branch&&(i=i.filter(l=>!l.git_branch||l.git_branch===e.branch)),e.since&&(i=i.filter(l=>l.updated_at>=e.since)),e.until&&(i=i.filter(l=>l.updated_at<=e.until)),i.sort((l,u)=>u.updated_at-l.updated_at);let t=e.offset||0,o=e.limit||10;i=i.slice(t,t+o);let s=[],a=[],c=[];for(let l of i){let u=this.missions.findByParentId(l.id),p=u.length>0,d=await this.briefingEngine.distillMission(l.id,!1);if(p){let m=[];for(let h of u)m.push(await this.mapMissionToEpisode(h));m.unshift(await this.mapMissionToEpisode(l));let f={kind:"initiative",root_mission_id:l.id,title:l.name,strategy_graph:l.strategy_graph?JSON.parse(l.strategy_graph):{},episodes:e.compact?[]:m,synthesized_narrative:e.compact?this.truncateText(d.adr):d.adr||""};s.push(f),c.push(f)}else{let m=await this.mapMissionToEpisode(l,d.adr,e.compact);a.push(m),c.push(m)}}return{repo_path:this.repoPath,generated_at:Date.now(),initiatives:s,unattached_episodes:a,timeline:c}}async mapMissionToEpisode(e,r,i=!1){let t=r;return t||(t=(await this.briefingEngine.distillMission(e.id,!1)).adr),{kind:"episode",mission_id:e.id,title:e.name,goal:e.goal,outcome:e.outcome_contract,intents:[],adr_summary:i?this.truncateText(t):t}}truncateText(e,r=300){return e?e.length<=r?e:e.slice(0,r)+"... (truncated)":""}renderChronicleMarkdown(e){let r=`# Repository Chronicle
|
|
732
835
|
|
|
733
836
|
`;if(r+=`*Generated at ${new Date(e.generated_at).toISOString()}*
|
|
734
837
|
|
|
@@ -739,7 +842,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
739
842
|
`,r+=`${i.adr_summary}
|
|
740
843
|
|
|
741
844
|
`),r+=`---
|
|
742
|
-
`;return r}};var
|
|
845
|
+
`;return r}};var Uv=$.child({module:"mcp:tools:ops:chronicle"});async function Zv(n){let{repoPath:e,format:r="markdown",...i}=n,t=new Rn(e);Uv.info({repoPath:e,format:r,filters:i},"Generating Chronicle");try{let o=await t.generateChronicle(i),s={tool:"shadow_ops_briefing",reason:"Current backlog and next work"};return r==="json"?{content:[{type:"text",text:JSON.stringify(o,null,2)}],suggestedNext:s}:{content:[{type:"text",text:t.renderChronicleMarkdown(o)}],suggestedNext:s}}catch(o){throw Uv.error({error:o,repoPath:e},"Failed to generate chronicle"),new Error(`Failed to generate chronicle: ${o instanceof Error?o.message:String(o)}`)}}We();ft();ee();import xE from"path";var SE=50,$E=50,wE=20;function kE(n,e){let r=Vr(n,5e3),i=r.indexOf(e),t=i>=0?r.slice(0,i):r;if(t.length===0)return[];let o=new Set(t),{missions:s}=z.getInstance(n);return s.findAll().filter(a=>!!a.commit_sha&&o.has(a.commit_sha)).sort((a,c)=>c.updated_at-a.updated_at).slice(0,wE).map(a=>({id:a.id,name:a.name,status:a.status,git_branch:a.git_branch,commit_sha:a.commit_sha}))}function EE(n,e){if(e.length===0)return[];let r=e.map(a=>xE.resolve(n,a)),i=Array.from(new Set([...e,...r])),{exports:t}=z.getInstance(n),o=t.findByFiles(i);return Array.from(new Set(o.map(a=>a.name))).slice(0,$E)}async function Hv(n){let{repoPath:e,compact:r=!0,branch:i,includeSessionDelta:t=!1,sinceCommit:o}=n,a=new ce(e).getSnapshot();r&&a.gravity?.hotspots&&(a={...a,gravity:{...a.gravity,hotspots:a.gravity.hotspots.slice(0,10),_truncated:a.gravity.hotspots.length>10,_totalHotspots:a.gravity.hotspots.length}});let c=new Rn(e),l=ge(e)||void 0,u=Me(e),p=i||l,m={...await c.generateChronicle({limit:5,compact:r,branch:p}),initiatives:[],unattached_episodes:[]},h=(await Ia({repoPath:e,scope:"project",altitude:r?"orbit":"atmosphere",compact:r,activeMissionsLimit:r?10:void 0,recentActivityLimit:r?5:10})).content?.[0],v=h&&h.type==="text"?h.text:"{}",y={};try{y=JSON.parse(v)}catch{}let b={counts:y.counts,next_work_candidates:y.next_work_candidates??[],active_count:Array.isArray(y.active_missions)?y.active_missions.length:0},_={hologram:a,chronicle:m,briefing:b};if(t){let x=o||jr(e),k=o?"request":"index_metadata",I=x?Array.from(jc(e,x)).sort():[],N=x?EE(e,I):[],L=x?kE(e,x):[];_.session_delta={baseline_commit:x||null,current_commit:u,changed_files:{count:I.length,sample:I.slice(0,SE)},changed_symbols:{count:N.length,sample:N},changed_missions:{count:L.length,sample:L}},_.meta={drift_diagnostics:{branch_scope:p||null,baseline_source:k,baseline_commit:x||null,current_commit:u,session_delta_enabled:!0,session_delta_available:!!x}}}return{content:[{type:"text",text:JSON.stringify(_,null,2)}],suggestedNext:{tool:b.next_work_candidates.length>0?"shadow_ops_track":"shadow_ops_plan",reason:b.next_work_candidates.length>0?"Pick one from next_work_candidates and run /continue":"No open work; create a mission"}}}Q();ft();import rf from"path";var Wv=$.child({module:"mcp:tools:ops:health"});async function Bv(n){let e=n.repoPath,r=rf.isAbsolute(e)?rf.normalize(e):rf.resolve(process.cwd(),e);Wv.info({repoPath:r},"Health check");let i=!1,t=!1;try{ke(r),i=!0,t=rt(r)}catch(l){Wv.debug({repoPath:r,error:l},"Health: DB check failed")}let o=Tc(),s;if(i)try{let l=Wn(r);if(l.status!=="idle"){let[u,p]=l.progress.split("/").map(Number),d=p>0?Math.round(u/p*100):0,m=l.status==="done"?"symbols: fully embedded":l.status==="running"?`symbols: warming ${l.progress} (${d}%)`:`symbols: ${l.status} ${l.progress}`;s={...l,label:m}}}catch{}let a={status:i?t?"ready":"index_pending":"db_unavailable",database:i,indexed:t,...s?{ember:s}:{},metrics:{index:o.index,query:o.query,uptimeMs:o.uptimeMs}},c=t?{tool:"shadow_recon_hologram",reason:"Architecture overview"}:{tool:"shadow_recon_onboard",reason:"Index the repo first"};return{content:[{type:"text",text:JSON.stringify(a,null,2)}],suggestedNext:c}}ee();Q();import Gv from"node:path";var Tr=$.child({module:"mcp:tools:ops:log"}),IE=["in-progress","verifying"];function TE(n){for(let e of IE){let r=n.find(i=>i.status===e);if(r)return r.id}return n[0]?.id??null}function RE(n,e){return e?Gv.isAbsolute(e)?e:Gv.join(n,e):null}async function Jv(n){let{repoPath:e,missionId:r,type:i,content:t,filePath:o,symbolName:s,standalone:a}=n;Tr.info({repoPath:e,type:i,symbolName:s,standalone:a},"Logging intent");let{missions:c,exports:l,intentLogs:u}=z.getInstance(e),p=RE(e,o);try{let d=r??null,m=ge(e)||void 0;if(a)d=null,Tr.debug("Standalone intent requested; mission auto-resolution skipped");else if(d){if(!c.findById(d))throw new Error(`Mission ${d} not found. Use shadow_ops_briefing to see available missions.`)}else{let _=c.findActive(m);_.length>0?(d=TE(_),Tr.debug({missionId:d,currentBranch:m},"Auto-resolved to active mission on current branch")):(d=null,Tr.debug({currentBranch:m},"No active mission found on current branch; logging as system/unlinked intent"))}let f=null,h=null,v=s||null,y=p;if(s){let x=(p?l.findByNameAndFile(s,p):l.findByName(s))[0];x?(f=x.id,h=x.signature,v=x.name,y=x.file_path||y):Tr.warn({symbolName:s,filePath:p??o},"Symbol not found for intent linking")}let b=u.create({mission_id:d,symbol_id:f,file_path:y,type:i,content:t,confidence:1,symbol_name:v,signature:h,commit_sha:null});return d&&y&&c.addToWorkingSet(d,y,f?"symbol":"intent"),{content:[{type:"text",text:JSON.stringify({logId:b,missionId:d,symbolId:f,status:"logged",message:f?`Intent linked to symbol "${s}"`:"Intent logged (unlinked)"},null,2)}]}}catch(d){throw Tr.error({error:d,repoPath:e},"Failed to log intent"),new Error(`Failed to log intent: ${d instanceof Error?d.message:String(d)}`)}}Q();var Kv=$.child({module:"mcp:tools:ops:graph"});async function Yv(n){let{repoPath:e,missionId:r,depth:i,limit:t,format:o="mermaid"}=n;Kv.info({repoPath:e,missionId:r,format:o},"Generating mission graph");try{let{GraphExporterService:s}=await Promise.resolve().then(()=>(of(),qv));return{content:[{type:"text",text:await new s(e).generateGraph({includeCompleted:!0,format:o,focusMissionId:r,depth:i,limit:t})}]}}catch(s){throw Kv.error({error:s,repoPath:e},"Failed to generate mission graph"),new Error(`Failed to generate mission graph: ${s.message}`)}}ee();Q();var Xv=$.child({module:"mcp:tools:ops:crystallize"});async function Qv(n){let{repoPath:e,missionId:r,symbolId:i}=n;Xv.info({repoPath:e,missionId:r,symbolId:i},"Crystallizing logs");let{intentLogs:t,missions:o,exports:s}=z.getInstance(e);if(typeof r=="number"){let a=o.findById(r);if(!a)throw new Error(`Mission ${r} not found`);let c=t.findRawByMission(r);if(c.length===0){let h=t.findCrystalByMission(r);return{content:[{type:"text",text:JSON.stringify({missionId:r,status:h?"already_crystallized":"no_logs",message:h?"Mission already has a crystal with no new raw logs to absorb.":"No raw intent logs found for this mission.",crystalId:h?.id??null},null,2)}]}}let u=new Lt().analyze(c),p=new Set(c.map(h=>h.symbol_name).filter(Boolean)),d=new Set(c.map(h=>h.type)),m=`[Crystal] Mission #${r}: ${a.name}
|
|
743
846
|
`;m+=`Compressed ${c.length} logs across ${p.size} symbols.
|
|
744
847
|
`,m+=`Types: ${[...d].join(", ")}
|
|
745
848
|
|
|
@@ -747,22 +850,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
747
850
|
`),u.context.length>0&&(m+=`Context: ${u.context.join(" | ")}
|
|
748
851
|
`),u.consequences.length>0&&(m+=`Consequences: ${u.consequences.join(" | ")}
|
|
749
852
|
`),u.recommendations.length>0&&(m+=`Recommendations: ${u.recommendations.join(" | ")}
|
|
750
|
-
`);let f=t.crystallize(r,m.trim());return
|
|
853
|
+
`);let f=t.crystallize(r,m.trim());return Xv.info({missionId:r,crystalId:f,absorbed:c.length},"Crystallization complete"),{content:[{type:"text",text:JSON.stringify({missionId:r,crystalId:f,absorbed:c.length,symbolsCompressed:p.size,status:"crystallized"},null,2)}]}}if(typeof i=="number"){let a=s.findHydratedById(i);if(!s.findById(i))throw new Error(`Symbol ${i} not found in index`);let l=t.findRawBySymbol(i);if(l.length===0)return{content:[{type:"text",text:JSON.stringify({symbolId:i,status:"no_logs",message:"No raw standalone intent logs found for this symbol."},null,2)}]};let p=new Lt().analyze(l),d=new Set(l.map(h=>h.type)),m=`[Crystal] Symbol #${i}: ${a?.name||"Unknown"}
|
|
751
854
|
`;m+=`Compressed ${l.length} standalone insights.
|
|
752
855
|
`,m+=`Types: ${[...d].join(", ")}
|
|
753
856
|
|
|
754
857
|
`,p.decisions.length>0&&(m+=`Decisions: ${p.decisions.join(" | ")}
|
|
755
858
|
`),p.context.length>0&&(m+=`Context: ${p.context.join(" | ")}
|
|
756
|
-
`);let f=t.crystallizeBySymbol(i,m.trim());return{content:[{type:"text",text:JSON.stringify({symbolId:i,crystalId:f,absorbed:l.length,status:"crystallized"},null,2)}]}}throw new Error("Must provide either missionId or symbolId to crystallize.")}
|
|
859
|
+
`);let f=t.crystallizeBySymbol(i,m.trim());return{content:[{type:"text",text:JSON.stringify({symbolId:i,crystalId:f,absorbed:l.length,status:"crystallized"},null,2)}]}}throw new Error("Must provide either missionId or symbolId to crystallize.")}ee();var Ra=class{constructor(e){this.repoPath=e}async crystallizeByTheme(e,r){let{generateEmbedding:i}=await Promise.resolve().then(()=>(Oe(),gt)),t=await i(e);if(!t)throw new Error("Embedding generation failed \u2014 cannot perform thematic crystallization");let{intentLogs:o}=z.getInstance(this.repoPath),s=await o.findSemanticTheme(t,r?.missionIds,r?.limit??200);if(s.length<2)throw new Error("Fewer than 2 logs matched theme \u2014 threshold too high or theme too narrow");let c=new Lt().analyze(s),l=new Set(s.map(m=>m.type)),u=c.sourceMissions.length,p=`[Crystal:Theme] ${e}
|
|
860
|
+
`;return p+=`Matched ${s.length} logs across ${u} mission${u!==1?"s":""}.
|
|
861
|
+
`,p+=`Types: ${[...l].join(", ")}
|
|
862
|
+
|
|
863
|
+
`,c.decisions.length>0&&(p+=`Decisions: ${c.decisions.join(" | ")}
|
|
864
|
+
`),c.context.length>0&&(p+=`Context: ${c.context.join(" | ")}
|
|
865
|
+
`),c.consequences.length>0&&(p+=`Consequences: ${c.consequences.join(" | ")}
|
|
866
|
+
`),c.recommendations.length>0&&(p+=`Recommendations: ${c.recommendations.join(" | ")}
|
|
867
|
+
`),p=p.trim(),{crystalId:o.crystallizeTheme(e,s.map(m=>m.id),p),absorbed:s.length,sourceMissions:c.sourceMissions,summary:p}}};async function e_(n){let{repoPath:e,theme:r,missionIds:i,limit:t}=n;if(!r||typeof r!="string"||r.trim().length===0)return{isError:!0,content:[{type:"text",text:"theme must be a non-empty string"}]};try{let o=new Ra(e),{crystalId:s,absorbed:a,sourceMissions:c,summary:l}=await o.crystallizeByTheme(r.trim(),{missionIds:i,limit:t});return{content:[{type:"text",text:JSON.stringify({crystalId:s,absorbed:a,sourceMissions:c,summary:l,theme:r.trim()},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}ee();var PE=["recon_report","risk_assessment","impact_map","debt_scan","custom"];async function t_(n){let{repoPath:e,missionId:r,kind:i,findings:t,risks:o=[],missionsCreated:s=[],gaps:a=[],confidence:c,agentTag:l}=n;if(!Array.isArray(t)||t.length===0)throw new Error("findings must be a non-empty array");let u=PE.includes(i)?i:"custom",p=c!=null&&c>=0&&c<=1?c:.5,d={kind:u,findings:t.map(h=>({statement:h.statement,confidence:h.confidence,refs:h.refs})),risks:o.map(h=>({severity:h.severity,description:h.description,refs:h.refs})),missionsCreated:s,gaps:a,confidence:p,...l?{agentTag:l}:{}},{missions:m}=z.getInstance(e),f=m.addHandoff(r??null,d);return{content:[{type:"text",text:JSON.stringify({artifactId:f,missionId:r??null,kind:u,findingsCount:t.length,risksCount:o.length,missionsCreated:s,confidence:p},null,2)}]}}ee();async function n_(n){let{repoPath:e,missionId:r,kind:i,query:t,limit:o}=n,{missions:s}=z.getInstance(e),a;if(t)try{let{generateEmbedding:l}=await Promise.resolve().then(()=>(Oe(),gt)),u=await l(t);u?a=await s.findSemanticHandoffs(u,o??5):a=s.getHandoffs(r,i,o??20)}catch{a=s.getHandoffs(r,i,o??20)}else a=s.getHandoffs(r,i,o??20);let c=a.map(l=>{let u=null;try{u=JSON.parse(l.metadata??"")}catch{}return{artifactId:l.id,missionId:l.mission_id===0?null:l.mission_id,kind:l.identifier,createdAt:l.created_at,payload:u,similarity:l.similarity??null}});return{content:[{type:"text",text:JSON.stringify({handoffs:c,total:c.length},null,2)}]}}Q();ee();import Pa from"path";var NE=$.child({module:"mcp:tools:ops:working-set-check"});async function r_(n){let{repoPath:e,filePaths:r}=n,{missions:i}=z.getInstance(e),t=i.findActive(),o=[];for(let s of t){let a=i.getWorkingSet(s.id);for(let c of a)if(r.includes(c.file_path))o.push({file_path:c.file_path,mission_id:s.id,mission_name:s.name});else{let l=Pa.isAbsolute(c.file_path)?c.file_path:Pa.join(e,c.file_path);for(let u of r){let p=Pa.isAbsolute(u)?u:Pa.join(e,u);if(l===p){o.push({file_path:c.file_path,mission_id:s.id,mission_name:s.name});break}}}}return NE.info({repoPath:e,conflictsCount:o.length},"Working set check completed"),{content:[{type:"text",text:JSON.stringify({conflicts:o},null,2)}]}}import Ve from"path";import af from"fs";Q();import xe from"path";import sf from"fs";var Na=$.child({module:"path-resolver"}),Rr=class{repoPath;constructor(e){this.repoPath=xe.isAbsolute(e)?xe.normalize(e):xe.resolve(process.cwd(),e)}resolve(e){if(!e)return this.repoPath;if(e.includes("\0"))throw Na.error({inputPath:e},"Path contains null bytes - possible attack"),new Error("Invalid path: contains null bytes");let r;if(xe.isAbsolute(e)?r=xe.normalize(e):r=xe.join(this.repoPath,e),r=xe.normalize(r),!this.isWithinRoot(r))throw Na.warn({inputPath:e,resolved:r},"Path traversal attempt blocked"),new Error(`Access denied: path '${e}' is outside the repository root`);return r}resolveAndValidate(e){try{let r=this.resolve(e);return sf.existsSync(r)?r:(Na.debug({inputPath:e,resolved:r},"Path does not exist"),null)}catch(r){return Na.error({inputPath:e,error:r},"Error validating path"),null}}isWithinRoot(e){try{let r=xe.resolve(e),i=xe.resolve(this.repoPath),t=xe.relative(i,r);if(t.startsWith("..")||xe.isAbsolute(t))return!1;if(sf.existsSync(r)){let s=sf.realpathSync(r),a=xe.relative(i,s);if(a.startsWith("..")||xe.isAbsolute(a))return!1}return!0}catch{return!1}}getRelative(e){let r=xe.normalize(e);return xe.relative(this.repoPath,r)}resolveBatch(e){return e.map(r=>this.resolve(r))}static normalize(e){return xe.normalize(e)}static isPathWithinRoot(e,r){let i=xe.resolve(e),t=xe.resolve(r),o=xe.relative(i,t);return o===""||!o.startsWith("..")&&!xe.isAbsolute(o)}};function i_(n){return new Rr(n)}var zE=/[\x00-\x1f\x7f]/g,CE=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Pn(n){if(typeof n!="string")throw new Error("Invalid path: expected string");if(n.includes("\0"))throw new Error("Invalid path: null bytes are not allowed");if(n.replace(zE,"").length!==n.length)throw new Error("Invalid path: control characters are not allowed");return n.trim()}function Nn(n,e=4096){if(typeof n!="string")return"";let r=n.replace(CE,"").trim();return r.length>e?r.slice(0,e):r}ft();var Ci=`
|
|
757
868
|
|
|
758
|
-
To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function
|
|
869
|
+
To check repository and connection health: shadow_env_diagnose({ repoPath }).`;function ln(n,e,r){return{content:[{type:"text",text:`[${n}] ${e}`}],isError:!0,errorCode:n,errorDetails:r}}function DE(n){let e=Ve.isAbsolute(n)?Ve.normalize(n):Ve.resolve(process.cwd(),n),r=Ve.parse(e).root;for(;e!==r;){if(af.existsSync(Ve.join(e,".liquid-shadow.db"))||af.existsSync(Ve.join(e,".git"))||af.existsSync(Ve.join(e,"package.json")))return e;let i=Ve.dirname(e);if(i===e)break;e=i}return null}function Re(n){let e=n?.repoPath?String(n.repoPath):void 0,r=n?.filePath?String(n.filePath):void 0;e&&(e=Pn(e)),r&&(r=Pn(r));let i;if(e)Ve.isAbsolute(e)||(e=Ve.resolve(process.cwd(),e)),i=e;else if(r){let s=Ve.resolve(process.cwd(),r);i=DE(Ve.dirname(s))||process.cwd()}else i=process.cwd();i=Ve.normalize(i);let t=i_(i),o;return r&&(o=t.resolve(r)),{...n,repoPath:i,filePath:o,resolver:t}}function o_(n,e){if(!rt(n)){let r=`Repository not indexed yet. Run initial indexing first:
|
|
759
870
|
|
|
760
871
|
1. shadow_recon_onboard({ repoPath: "${n}" }) // one-time
|
|
761
872
|
2. shadow_sync_trace({ repoPath: "${n}" }) // then sync
|
|
762
873
|
|
|
763
|
-
After that, ${e} and other tools will work.`+
|
|
874
|
+
After that, ${e} and other tools will work.`+Ci;return ln("FILE_NOT_FOUND",r,{repoPath:n,toolName:e,requiresIndexing:!0})}return null}Q();ee();async function s_(n){let e=Nn(n.query??""),r={...n,query:e},i=dn();try{let{repoPath:t}=Re(r),{query:o,limit:s=de.DEFAULT_LIMIT,offset:a=0,compact:c=!1,tokenBudget:l}=r;await te(t);let{filters:u,hasFilters:p}=Vt(r),m=await new Be(t).searchByConcept(o,s,a,u,p,c,l);try{let f=Wn(t);if(f.status==="running"){let[h,v]=f.progress.split("/").map(Number),y=v>0?Math.round(h/v*100):0,b=`\u26A0\uFE0F Symbol embeddings still warming (${f.progress}, ${y}%) \u2014 symbol-level results may be incomplete. File-level results are fully available.
|
|
764
875
|
|
|
765
|
-
\u26A0\uFE0F
|
|
876
|
+
`;m.content?.[0]?.type==="text"&&(m.content[0].text=b+m.content[0].text)}}catch{}return LE(t,o,"concept"),i(),m}catch(t){return $.error({error:t,args:n},"Concept Search failed"),i(),await mt(),{content:[{type:"text",text:`Concept Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function LE(n,e,r){try{let i=z.getInstance(n),t=ge(n);i.searchHistory.record(e,r,t)}catch(i){let t=ge(n);$.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),mt()}}Q();ee();async function a_(n){let e=Nn(n.query??""),r={...n,query:e},i=dn();try{let{repoPath:t}=Re(r),{query:o,limit:s=de.DEFAULT_LIMIT,offset:a=0,matchMode:c="any"}=r;await te(t);let{filters:l,hasFilters:u}=Vt(r),d=await new Be(t).searchBySymbol(o,s,a,l,u,c);return OE(t,o,"symbol"),i(),d}catch(t){return $.error({error:t,args:n},"Symbol Search failed"),i(),await mt(),{content:[{type:"text",text:`Symbol Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function OE(n,e,r){try{let i=z.getInstance(n),t=ge(n);i.searchHistory.record(e,r,t)}catch(i){let t=ge(n);$.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),mt()}}ee();Q();import Pr from"path";function c_(n,e){let r=n.findContentByToken(e,100);return{count:r.length,files:r}}async function l_(n){let{repoPath:e,query:r,key:i="",kind:t,limit:o=50,showUsage:s=!1}=n,a=i||r;if(!a&&!t)return{content:[{type:"text",text:'Error: Either "key" or "kind" parameter is required.'}]};await te(e);let c=z.getInstance(e),{configs:l,files:u}=c;if(a){$.info({repoPath:e,key:a},"Searching for config key in DB...");let f=l.findByKey(a,o);if(f.length===0)return{content:[{type:"text",text:`No configuration found for key: ${a}`}]};if(s){let y=f.map(k=>{let I=c_(u,k.key),N=I.count===0?"\u26A0\uFE0F ORPHANED":`\u2713 ${I.count} usage(s)`;return{file:Pr.relative(e,k.file_path),key:k.key,value:k.value,kind:k.kind,usageCount:I.count,usageFiles:I.files.slice(0,5).map(L=>Pr.relative(e,L)),status:N}});y.sort((k,I)=>k.usageCount===0&&I.usageCount>0?-1:I.usageCount===0&&k.usageCount>0?1:k.usageCount-I.usageCount);let b=y.filter(k=>k.usageCount===0).length;return{content:[{type:"text",text:(b>0?`# Configuration Search: "${a}" (with Usage Analysis)
|
|
877
|
+
|
|
878
|
+
\u26A0\uFE0F **${b} orphaned var(s)** (defined but never used in code)
|
|
766
879
|
|
|
767
880
|
Found ${f.length} match(es):
|
|
768
881
|
|
|
@@ -770,52 +883,88 @@ Found ${f.length} match(es):
|
|
|
770
883
|
|
|
771
884
|
Found ${f.length} match(es), all in use:
|
|
772
885
|
|
|
773
|
-
`)+
|
|
774
|
-
**${
|
|
775
|
-
> Used in: ${
|
|
886
|
+
`)+y.map(k=>{let I=`## ${k.file} (${k.kind}) ${k.status}
|
|
887
|
+
**${k.key}**: \`${k.value}\``;return k.usageCount>0&&k.usageFiles.length>0&&(I+=`
|
|
888
|
+
> Used in: ${k.usageFiles.map(N=>`\`${N}\``).join(", ")}${k.usageCount>5?` (+${k.usageCount-5} more)`:""}`),I}).join(`
|
|
776
889
|
|
|
777
|
-
`)}]}}let h=f.map(
|
|
890
|
+
`)}]}}let h=f.map(y=>({file:Pr.relative(e,y.file_path),key:y.key,value:y.value,kind:y.kind}));return{content:[{type:"text",text:`# Configuration Search: "${a}"
|
|
778
891
|
|
|
779
892
|
Found ${f.length} match(es):
|
|
780
893
|
|
|
781
|
-
`+h.map(
|
|
782
|
-
**${
|
|
894
|
+
`+h.map(y=>`## ${y.file} (${y.kind})
|
|
895
|
+
**${y.key}**: \`${y.value}\``).join(`
|
|
896
|
+
|
|
897
|
+
`)+"\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars."}]}}let p=l.findByKind(t||null,o);if(s){let f=p.map(b=>{let _=c_(u,b.key);return{file:Pr.relative(e,b.file_path),key:b.key,value:b.value,kind:b.kind,usageCount:_.count,usageFiles:_.files.slice(0,3).map(x=>Pr.relative(e,x)),status:_.count===0?"ORPHANED":"in-use"}});f.sort((b,_)=>b.usageCount===0&&_.usageCount>0?-1:_.usageCount===0&&b.usageCount>0?1:b.usageCount-_.usageCount);let h=f.filter(b=>b.usageCount===0).length,v=f.length,y=`# Config Discovery (${t||"all"}) with Usage Analysis
|
|
783
898
|
|
|
784
|
-
|
|
899
|
+
`;return y+=`**Summary**: ${v} config(s) found, ${h} orphaned
|
|
785
900
|
|
|
786
|
-
|
|
901
|
+
`,h>0&&(y+=`## \u26A0\uFE0F Orphaned (${h})
|
|
902
|
+
`,y+=f.filter(b=>b.usageCount===0).map(b=>`- \`${b.key}\` in ${b.file}`).join(`
|
|
903
|
+
`),y+=`
|
|
787
904
|
|
|
788
|
-
|
|
789
|
-
`,
|
|
790
|
-
`),
|
|
905
|
+
`),y+=`## \u2713 In Use (${v-h})
|
|
906
|
+
`,y+=f.filter(b=>b.usageCount>0).map(b=>{let _=b.usageFiles.length>0?`, used in ${b.usageFiles.map(x=>`\`${x}\``).join(", ")}${b.usageCount>3?` (+${b.usageCount-3} more)`:""}`:"";return`- \`${b.key}\`=\`${b.value}\` in \`${b.file}\` (${b.usageCount} usages${_})`}).join(`
|
|
907
|
+
`),p.length===o&&(y+=`
|
|
791
908
|
|
|
792
|
-
|
|
793
|
-
`,v+=f.filter(y=>y.usageCount>0).map(y=>`- \`${y.key}\` (${y.usageCount} usages)`).join(`
|
|
794
|
-
`),p.length===o&&(v+=`
|
|
909
|
+
> Results limited to ${o} entries. Use the 'limit' parameter to see more.`),{content:[{type:"text",text:y}]}}let d=p.map(f=>({...f,file:Pr.relative(e,f.file_path)})),m=JSON.stringify(d,null,2);return p.length===o&&(m=`Results limited to ${o} entries. Use the 'limit' parameter to see more.
|
|
795
910
|
|
|
796
|
-
>
|
|
911
|
+
`+m),m+="\n\n> \u{1F4A1} **Tip**: Use `showUsage: true` to see usage counts and identify orphaned vars.",{content:[{type:"text",text:m}]}}Q();ee();async function u_(n){let e=Nn(n.query??""),r={...n,query:e},i=dn();try{let{repoPath:t}=Re(r),{query:o,limit:s=de.DEFAULT_LIMIT,offset:a=0,ranked:c=!1}=r;await te(t);let{filters:l,hasFilters:u}=Vt(r),d=await new Be(t).searchByPath(o,s,a,l,u,c);return ME(t,o,"path"),i(),d}catch(t){return $.error({error:t,args:n},"Path Search failed"),i(),await mt(),{content:[{type:"text",text:`Path Search failed: ${t instanceof Error?t.message:String(t)}`}],isError:!0}}}function ME(n,e,r){try{let i=z.getInstance(n),t=ge(n);i.searchHistory.record(e,r,t)}catch(i){let t=ge(n);$.error({module:"search",repoPath:n,query:e,mode:r,error:i instanceof Error?i.message:String(i),branch:t},"Failed to record search history"),mt()}}Q();async function p_(n){let{repoPath:e,filePath:r,symbolName:i,depth:t=3,limit:o=50,offset:s=0}=n;await te(e);try{let c=await new Nt(e).analyze(i,{filePath:r,depth:t,limit:o,offset:s});return c.length===0?{content:[{type:"text",text:`Symbol "${i}" not found.`}],isError:!0}:{content:[{type:"text",text:JSON.stringify(c,null,2)}]}}catch(a){return $.error({error:a,args:n},"Impact Analysis failed"),{content:[{type:"text",text:`Impact Analysis failed: ${a instanceof Error?a.message:String(a)}`}],isError:!0}}}ee();import cf from"path";import jE from"fs";var za=class{constructor(e){this.repoPath=e}async analyzeMesh(e,r){let{files:i}=z.getInstance(this.repoPath),t=i.findSynapses({name:e,type:r?.type,limit:500}),o=[],s=[];for(let c of t){let l={file:cf.relative(this.repoPath,c.file_path),line:c.line_number??null,snippet:c.code_snippet??null,repoPath:this.repoPath};c.direction==="produce"?o.push(l):s.push(l)}let a=[];if(r?.includeCrossRepo)try{let{listFusedIndexes:c}=await Promise.resolve().then(()=>(Xr(),Cg)),l=await import("os"),u=c();for(let p of u)try{let d=l.homedir(),m=cf.join(d,".mcp-liquid-shadow","fused"),f=p.replace(/[^a-zA-Z0-9-_]/g,"_"),h=cf.join(m,`${f}.db`);if(!jE.existsSync(h))continue;let v=(await import("better-sqlite3")).default,y=new v(h,{readonly:!0}),b=y.prepare(`SELECT source_repo, target_repo, source_file_path, target_file_path, relationship, metadata
|
|
912
|
+
FROM virtual_edges
|
|
913
|
+
WHERE (source_repo = ? OR target_repo = ?)
|
|
914
|
+
LIMIT 200`).all(this.repoPath,this.repoPath);y.close();for(let _ of b)a.push({sourceRepo:_.source_repo,targetRepo:_.target_repo,sourceFile:_.source_file_path,targetFile:_.target_file_path,relationship:_.relationship,confidence:_.metadata?JSON.parse(_.metadata)?.confidence??1:1})}catch{}}catch{}return{topic:e,type:r?.type,producers:o,consumers:s,crossRepoEdges:a,totalEdges:o.length+s.length+a.length}}};async function d_(n){let{repoPath:e,topic:r,type:i,includeCrossRepo:t=!1,format:o="json"}=n;if(!r||typeof r!="string"||r.trim().length===0)return{isError:!0,content:[{type:"text",text:"topic must be a non-empty string"}]};await te(e);let a=await new za(e).analyzeMesh(r.trim(),{type:i,includeCrossRepo:t});if(a.totalEdges===0)return{content:[{type:"text",text:`No producers or consumers found for topic "${r}" in the indexed files.
|
|
797
915
|
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
916
|
+
Suggestions:
|
|
917
|
+
- Check the topic name \u2014 partial matches are supported.
|
|
918
|
+
- Use type filter: socket_event, api_route, or pubsub_topic.
|
|
919
|
+
- If the index is empty, run shadow_recon_onboard first.`}]};if(o==="text"){let c=`# Event Mesh: "${a.topic}"
|
|
920
|
+
`;a.type&&(c+=`Type: ${a.type}
|
|
921
|
+
`),c+=`
|
|
922
|
+
## Producers (${a.producers.length})
|
|
923
|
+
`;for(let l of a.producers)c+=`- ${l.file}${l.line?`:${l.line}`:""}
|
|
924
|
+
`,l.snippet&&(c+=` \`${l.snippet.slice(0,120)}\`
|
|
925
|
+
`);c+=`
|
|
926
|
+
## Consumers (${a.consumers.length})
|
|
927
|
+
`;for(let l of a.consumers)c+=`- ${l.file}${l.line?`:${l.line}`:""}
|
|
928
|
+
`,l.snippet&&(c+=` \`${l.snippet.slice(0,120)}\`
|
|
929
|
+
`);if(a.crossRepoEdges.length>0){c+=`
|
|
930
|
+
## Cross-Repo Edges (${a.crossRepoEdges.length})
|
|
931
|
+
`;for(let l of a.crossRepoEdges)c+=`- ${l.sourceRepo} \u2192 ${l.targetRepo} (${l.relationship})
|
|
932
|
+
`}return{content:[{type:"text",text:c.trim()}]}}return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}ee();import{execSync as FE}from"child_process";import UE from"fs";import m_ from"path";function f_(n){let e=n.trim();if(!/^[A-Za-z0-9._:/-]+$/.test(e))throw new Error(`Invalid git ref: ${n}`);return e}function Ca(n){let e=n.trim();return e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function ZE(n){if(n.length<=1)return n;let e=[...n].sort((i,t)=>i.start-t.start),r=[];for(let i of e){let t=r[r.length-1];if(!t||i.start>t.end+1){r.push({...i});continue}t.end=Math.max(t.end,i.end)}return r}function HE(n){if(!n.trim())return[];let e=n.split(`
|
|
933
|
+
`).map(i=>i.trim()).filter(Boolean),r=[];for(let i of e){let t=i.split(" ").filter(Boolean);if(t.length<2)continue;let s=t[0].charAt(0).toUpperCase(),a=s==="M"?"modified":s==="A"?"added":s==="D"?"deleted":s==="R"?"renamed":s==="C"?"copied":"unknown";if((a==="renamed"||a==="copied")&&t.length>=3){r.push({status:a,oldPath:Ca(t[1]),path:Ca(t[2])});continue}r.push({status:a,path:Ca(t[1])})}return r}function WE(n){let e=new Map;if(!n.trim())return e;let r=null,i=n.split(`
|
|
934
|
+
`);for(let t of i){if(t.startsWith("+++ ")){let c=t.slice(4).trim();c==="/dev/null"?r=null:(r=Ca(c),e.has(r)||e.set(r,[]));continue}if(!r)continue;let o=t.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/);if(!o)continue;let s=Number(o[1]),a=Number(o[2]||"1");!Number.isFinite(s)||!Number.isFinite(a)||a<=0||e.get(r).push({start:s,end:s+a-1})}for(let[t,o]of e.entries())e.set(t,ZE(o));return e}function BE(n,e,r){return n<=r.end&&r.start<=e}var Aa=class{constructor(e){this.repoPath=e}execGit(e){let r=`git ${e.join(" ")}`;return FE(r,{cwd:this.repoPath,stdio:["ignore","pipe","ignore"],encoding:"utf8"}).trim()}buildDiffArgs(e,r){let i=["diff","--find-renames"];r?i.push("--unified=0","--no-color"):i.push("--name-status"),e.staged&&i.push("--cached");let t=e.baseCommit?f_(e.baseCommit):null,o=e.headCommit?f_(e.headCommit):null;return t&&o?i.push(t,o):t?i.push(t):e.staged||i.push("HEAD"),i}collectFileChanges(e={}){let r=this.execGit(this.buildDiffArgs(e,!1)),i=this.execGit(this.buildDiffArgs(e,!0)),t=HE(r),o=WE(i),s=new Map;for(let a of t){let c=o.get(a.path)||[];s.set(a.path,{relativePath:a.path,absolutePath:m_.resolve(this.repoPath,a.path),status:a.status,...a.oldPath?{oldRelativePath:a.oldPath}:{},ranges:c})}if(e.includeUntracked){let a=this.execGit(["ls-files","--others","--exclude-standard"]);if(a)for(let c of a.split(`
|
|
935
|
+
`).map(l=>l.trim()).filter(Boolean))s.has(c)||s.set(c,{relativePath:c,absolutePath:m_.resolve(this.repoPath,c),status:"added",ranges:[]})}return Array.from(s.values()).sort((a,c)=>a.relativePath.localeCompare(c.relativePath))}mapChangesToSymbols(e,r=30){let i=z.getInstance(this.repoPath),t=Math.max(1,Math.min(r,200)),o=[],s=new Set;for(let a of e){if(a.status==="deleted"||!UE.existsSync(a.absolutePath))continue;let c=i.exports.findByFile(a.absolutePath);if(c.length!==0)for(let l of c){let u=l.start_line||1,p=l.end_line||u,d=a.ranges.length===0?[]:a.ranges.filter(f=>BE(u,p,f));if(a.ranges.length>0&&d.length===0)continue;let m=`${a.relativePath}:${l.name}:${u}`;s.has(m)||(s.add(m),o.push({id:l.id||null,name:l.name,kind:l.kind,file:a.relativePath,absolutePath:a.absolutePath,startLine:u,endLine:p,status:a.status,changedRanges:d}))}}return o.sort((a,c)=>a.file!==c.file?a.file.localeCompare(c.file):a.startLine-c.startLine).slice(0,t)}};ee();async function h_(n){let{repoPath:e}=Re(n),{baseCommit:r,headCommit:i,staged:t=!0,includeUntracked:o=!0,maxSymbols:s=20,impactDepth:a=2,impactLimit:c=12}=n;await te(e);let l=new Aa(e),u=l.collectFileChanges({baseCommit:r,headCommit:i,staged:t,includeUntracked:o}),p=l.mapChangesToSymbols(u,s);if(u.length===0)return{content:[{type:"text",text:JSON.stringify({summary:"No diff detected.",changes:[]},null,2)}]};let d=new Nt(e),m=new Yt(e),f=z.getInstance(e),h=[],v=new Set,y=new Set;for(let _ of p){let x=await d.analyze(_.name,{filePath:_.absolutePath,depth:a,limit:c}),k=x.length>0?x[0]:null;for(let L of k?.impact||[])L?.file&&v.add(String(L.file));let I=f.exports.findTypeGraphEdges(_.name,{filePath:_.absolutePath,direction:"both",limit:20}),N=m.getMappedTestsForSymbol(_.absolutePath,_.name,10);for(let L of N)y.add(L.file);h.push({symbol:{name:_.name,kind:_.kind,file:_.file,startLine:_.startLine,endLine:_.endLine,status:_.status,changedRanges:_.changedRanges},impact:k?{riskScore:k.riskScore,blastRadius:k.pagination.total,topImpacted:k.impact.slice(0,8)}:null,typeGraph:{edgeCount:I.length,edges:I.slice(0,10).map(L=>({direction:L.direction,relationship:L.relationship,source:L.source_symbol_name,target:L.target_symbol_name}))},verification:{mappedTestCount:N.length,mappedTests:N.map(L=>({file:L.file,via:L.via,confidence:L.confidence}))}})}let b={changedFiles:u.length,changedSymbols:p.length,impactedFiles:v.size,suggestedTests:y.size};return{content:[{type:"text",text:JSON.stringify({summary:b,diffScope:{staged:t,includeUntracked:o,...r?{baseCommit:r}:{},...i?{headCommit:i}:{}},changes:u.map(_=>({file:_.relativePath,status:_.status,..._.oldRelativePath?{from:_.oldRelativePath}:{},changedRanges:_.ranges})),symbols:h,verification:{suggestedTestFiles:Array.from(y).sort()}},null,2)}]}}ee();async function g_(n){let{repoPath:e,filePath:r}=Re(n),{symbolName:i,direction:t="both",relationship:o,limit:s=50}=n;await te(e);let c=z.getInstance(e).exports.findTypeGraphEdges(i,{filePath:r,direction:t,relationship:o,limit:s}),l=c.reduce((u,p)=>(u.byRelationship[p.relationship]||(u.byRelationship[p.relationship]=0),u.byRelationship[p.relationship]+=1,u.byDirection[p.direction]||(u.byDirection[p.direction]=0),u.byDirection[p.direction]+=1,u),{byRelationship:{},byDirection:{}});return{content:[{type:"text",text:JSON.stringify({symbol:i,...r?{filePath:r}:{},direction:t,...o?{relationship:o}:{},totalEdges:c.length,summary:l,edges:c.map(u=>({direction:u.direction,relationship:u.relationship,source:u.source_symbol_name,target:u.target_symbol_name,file:u.file_path,line:u.line_number}))},null,2)}]}}ee();Q();import Cn from"fs";import Pe from"path";var GE=new Set(["api","v1","v2","v3","http","https","localhost","admin","internal","public","private","app","src","get","post","put","delete","patch","user","users","id","search","list","create","update","data"]),JE=new Set(["GET","POST","PUT","DELETE","PATCH"]),VE=[/\bRoute::(?:get|post|put|delete|patch)\b/i,/\brouter\.(?:get|post|put|delete|patch)\s*\(/i,/\bapp\.(?:get|post|put|delete|patch)\s*\(/i,/\bfastify\.(?:get|post|put|delete|patch)\s*\(/i,/\baddRoute\s*\(/i,/\bHTTPMethods\.(?:GET|POST|PUT|DELETE|PATCH)\b/i,/\bpath\s*\(/i,/\bre_path\s*\(/i,/@(?:GET|POST|PUT|DELETE|PATCH|Route)\b/i,/@(?:Get|Post|Put|Delete|Patch|RequestMapping)\b/];function qE(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ai(n){let e=n.split("?")[0].split("#")[0];return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function lf(n){let e=Ai(n).replace(/:[^/]+/g,"__SEG__").replace(/\{[^}]+\}/g,"__SEG__").replace(/\$[^/]+/g,"__SEG__").replace(/\*/g,"__SEG__"),r=qE(e).replace(/__SEG__/g,"[^/]+");return new RegExp(`^${r}$`)}function y_(n){let e=[/(HTTPMethods\.)?(GET|POST|PUT|DELETE|PATCH)\b/i,/Route::(get|post|put|delete|patch)\b/i,/@(GET|POST|PUT|DELETE|PATCH)\b/i],r;for(let i of e){let t=n.match(i);if(t?.[2]){r=t[2].toUpperCase();break}if(t?.[1]){r=t[1].toUpperCase();break}}return r&&JE.has(r)?r:null}function KE(n){return n.replace(/<[^>]+>/g," ")}function YE(n){return VE.some(e=>e.test(n))}function XE(n){let e=[],r=/['"`]([^'"`]*\/[^'"`]*)['"`]/g,i=null;for(;(i=r.exec(n))!==null;){let t=i[1].trim();t&&e.push(t)}return e}function QE(n){let e=n.replace(/^\^/,"").replace(/\$$/,"");if(e.includes("://"))try{e=new URL(e).pathname}catch{}if(!e.startsWith("/")){let r=e.indexOf("/");if(r===-1)return null;e=e.slice(r)}return Ai(e)}function eI(n,e){let r=XE(n);for(let i of r){let t=QE(i);if(!t)continue;let o=lf(t),s=e.replace(/\*/g,"test-val");if(o.test(s)||!/[:{*$]/.test(t)&&s.startsWith(`${t}/`))return!0}return!1}function tI(n,e){if(e)try{let t=JSON.parse(e);if(typeof t.path=="string"&&t.path.startsWith("/"))return Ai(t.path)}catch{}let r=/['"]([^'"]+)['"]/g,i=null;for(;(i=r.exec(n))!==null;){let t=i[1].trim();if(t){if(t=t.replace(/^\^/,"").replace(/\$$/,""),!t.startsWith("/")){if(!t.includes("/")&&!t.includes(":"))continue;t=`/${t}`}return Ai(t)}}return null}function nI(n,e){let r=n.toLowerCase();return e.reduce((i,t)=>i+(r.includes(t.toLowerCase())?20:0),0)}function uf(n,e,r){let i=e,t=e.match(/\$\{([^}]+)\}/g);if(t)for(let m of t){let f=m.substring(2,m.length-1),h=n.configs.findEnvValue(f);h&&(i=i.replace(m,h))}let o=i.split("?")[0].split("#")[0];try{o.includes("://")&&(o=new URL(o).pathname)}catch{}o=Ai(o);let s=r?.toUpperCase(),a=[],c=!1,l=o.replace(/\*/g,"%").replace(/:[^/]+/g,"%").replace(/\{[^}]+\}/g,"%"),u=n.files.findSynapses({type:"api_route",name:l.includes("%")?l:o,direction:"consume",limit:10});for(let m of u)lf(m.name).test(o.replace(/\*/g,"test-val"))&&(a.push({file_path:m.file_path,start_line:m.line_number||0,signature:`[Synapse] ${m.name}`,score:1e3}),c=!0);let p=o.split(/[^a-zA-Z0-9-_]/).filter(m=>m.length>=3&&!GE.has(m.toLowerCase())&&!/^\d+$/.test(m));if(p.length>0){let h=[...p].sort((y,b)=>b.length-y.length).slice(0,2).flatMap(y=>n.exports.findRoutesByToken(y,20)),v=new Set;for(let y of h){let b=`${y.file_path}:${y.start_line}:${y.name}`;if(v.has(b))continue;v.add(b);let _=y.signature||y.name||"",x=y_(_);if(s&&x&&s!==x)continue;let k=tI(_,y.capabilities);if(s&&!x&&!k)continue;let I=40;if(k){if(!lf(k).test(o.replace(/\*/g,"test-val")))continue;I+=280,c=!0}s&&x&&s===x&&(I+=120,c=!0),I+=nI(`${_} ${k||""}`,p),a.push({file_path:y.file_path,start_line:y.start_line,signature:`[Boundary] ${_}`,capabilities:y.capabilities||void 0,score:I})}}if(a.length<3&&!c){let m=p.map(f=>f.replace(/[^a-zA-Z0-9_]/g,"")).filter(f=>f.length>0).join(" AND ");if(m.length>0){let f=n.content.search(m);for(let h of f){let v=KE(h.snippet);if(!YE(v)||!eI(v,o))continue;let y=y_(v);if(s&&y&&y!==s)continue;let b=0,_=h.file_path.toLowerCase(),x=v.toLowerCase();(_.includes("route")||_.includes("controller"))&&(b+=10),(_.includes("src/api")||_.includes("services/api"))&&(b+=5),(x.includes("addroute")||x.includes("@get"))&&(b+=15),(x.includes("axios.")||x.includes("fetch("))&&(b-=10),(_.includes(".spec.")||_.includes(".test."))&&(b-=20),s&&x.includes(s.toLowerCase())&&(b+=20),b>0&&a.push({file_path:h.file_path,start_line:0,signature:`[FTS Match] ${v.replace(/\n/g," ")}`,score:b})}}}let d=new Map;return a.sort((m,f)=>f.score-m.score).forEach(m=>{d.has(m.file_path)||d.set(m.file_path,m)}),Array.from(d.values()).slice(0,c?2:3)}var pf=7,zn=80,rI=2,iI=4,oI=6,sI=3,aI=24,cI=new Set(["publish","publishmessage","publishtaskbynameandpayload"]),lI=new Set(["Error","TypeError","RangeError","ReferenceError","SyntaxError","Promise","Map","Set","WeakMap","WeakSet","Date","Array","Object","String","Number","Boolean","RegExp","URL","URLSearchParams"]),uI=new Set(["error","errors","request","response","result","results","value","values","item","data","payload","message","messages","text","description","name","id","type","status","code"]),v_=new Set(["req","res","request","response","error","err","event","item","row","data","value","obj","window","document","console","json","math"]),pI=new Set(["length","size","value","values","name","id","type","status"]),__=new Set(["push","pop","shift","unshift","slice","splice","map","filter","reduce","reduceRight","forEach","find","findIndex","includes","indexOf","lastIndexOf","every","some","flat","flatMap","fill","copyWithin","entries","keys","values","join","concat","sort","reverse","at","with","toSorted","toReversed","toSpliced","toString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","charAt","charCodeAt","codePointAt","split","substring","substr","trim","trimStart","trimEnd","padStart","padEnd","repeat","replace","replaceAll","match","matchAll","search","toLowerCase","toUpperCase","localeCompare","normalize","startsWith","endsWith","then","catch","finally","get","set","has","delete","clear","size","length","call","apply","bind"]);function dI(n,e){return Pe.resolve(n)===Pe.resolve(e)}function mI(n){if(lI.has(n))return!0;let e=n.trim().toLowerCase();if(!e||e.length<2||/\[|\]|\s/.test(n)||uI.has(e))return!0;let r=n.split(/(?:\.|->|::)+/).filter(Boolean),i=(r.length>0?r[r.length-1]:e).replace(/^\$+/,"");if(pI.has(i.toLowerCase())||__.has(i))return!0;if(r.length>1){let t=r[0].replace(/^\$+/,"").toLowerCase();if(v_.has(t))return!0}return!1}function mf(n,e){if(e.has(n))return e.get(n)??null;try{let r=Cn.readFileSync(n,"utf8");return e.set(n,r),r}catch{return null}}function fI(n){return n<20?pf:n<45?pf-1:Math.max(4,pf-2)}function hI(n,e){let r=n<=2?1:n<=4?.7:.4,i=e<25?1:e<55?.8:.55,t=Math.floor(aI*r*i);return Math.max(sI,t)}function gI(n,e){let r=n.split(`
|
|
936
|
+
`),i=new Map,t=new Map,o=[],s=new Set;for(let a=0;a<r.length;a++){let c=r[a],l=e+a+1,u=c.match(/\b(?:const|let|var)\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*=/),p=c.match(/\b([A-Za-z_$][A-Za-z0-9_$]*)\s*=\s*[^=]/),d=u?.[1]||p?.[1];if(d){i.set(d,l);continue}for(let[m,f]of i.entries()){if(l<=f||!new RegExp(`\\b${x_(m)}\\b`).test(c))continue;let h=t.get(m)||0;if(h>=2)continue;let v=`${m}:${f}->${l}`;s.has(v)||(o.push({symbol:m,fromLine:f,toLine:l}),s.add(v),t.set(m,h+1))}}return o}function b_(n){let e=n.trim();if(!e)return"";let r=e.indexOf("/"),i=r>=0?e.slice(r):e;return i.length>1&&i.endsWith("/")?i.slice(0,-1):i}function x_(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ff(n){let e=n.split(/(?:\.|::|->)+/).filter(Boolean);return e.length>0?e[e.length-1]:n.trim()}function yI(n,e){let r=0,i=!1;for(let t=e;t<n.length;t++){let o=n[t];for(let a of o)if(a==="{")r++,i=!0;else if(a==="}"&&(r--,i&&r<=0))return{start:e+1,end:t+1};let s=o.trim();if(!i&&/[;}]$/.test(s))return{start:e+1,end:t+1}}return{start:e+1,end:Math.min(n.length,e+40)}}function df(n,e,r){let i=ff(e);if(!i)return null;try{let t=r?mf(n,r):Cn.readFileSync(n,"utf8");if(!t)return null;let o=t.split(`
|
|
937
|
+
`),s=x_(i),a=[new RegExp(`^\\s*(?:export\\s+)?(?:async\\s+)?function\\s+${s}\\b`),new RegExp(`^\\s*(?:(?:public|private|protected|static|readonly|async|abstract|get|set)\\s+)*${s}\\s*(?:<[^>]*>)?\\s*\\(`),new RegExp(`^\\s*(?:(?:public|private|protected|static|readonly|async|abstract)\\s+)*${s}\\s*[:=]\\s*(?:async\\s*)?(?:\\([^)]*\\)\\s*=>|function\\b)`),new RegExp(`^\\s*(?:export\\s+)?class\\s+${s}\\b`)];for(let c=0;c<o.length;c++){let l=o[c];if(l.includes(i)&&a.some(u=>u.test(l)))return yI(o,c)}}catch{return null}return null}function S_(n,e,r,i){try{let t=i?mf(n,i):Cn.readFileSync(n,"utf8");if(!t)return!0;let o=t.split(`
|
|
938
|
+
`);if(e.start<1||e.end<e.start||e.start>o.length||e.end>o.length||!o.slice(e.start-1,e.end).join(`
|
|
939
|
+
`).trim())return!0;if(e.start===e.end){let a=o[e.start-1]?.trim()||"",c=a.replace(/\s+/g,"");if(!c||/^[{}()[\];,]+$/.test(c))return!0;let l=ff(r);if(l&&!a.includes(l))return!0}return!1}catch{return!0}}function Da(n,e,r,i){if(e){if(!r)return e;if(S_(n,e,r,i)){let t=df(n,r,i);if(t)return t}return e}}function bI(n,e,r){let i=n.exports.findByNameAndFile(r,e);if(i.length>0)return i[0];let t=n.exports.findByFile(e);if(t.length===0)return null;if(r.includes("/")){let a=b_(r),c=t.find(l=>!l?.name||typeof l.name!="string"?!1:b_(l.name)===a);if(c)return c}let o=r.split(/(?:\.|::|->)+/).filter(Boolean);if(o.length>1){let a=o[o.length-1],c=n.exports.findByNameAndFile(a,e);if(c.length===1)return c[0]}return t.find(a=>typeof a?.name=="string"&&(a.name===r||a.name.includes(r)))||null}async function $_(n){let{repoPath:e,filePath:r,symbolName:i}=Re(n);if(!r)return{isError:!0,content:[{type:"text",text:"Error: 'filePath' is required."}]};let t=r;await te(e);let o=z.getInstance(e);if(!Cn.existsSync(t))return{isError:!0,content:[{type:"text",text:`File not found: ${t}`}]};let s=new Map,a,c=Pe.basename(t),l;if(i){let m=ff(i),f=bI(o,t,i);if(f){let h=f;a={start:h.start_line,end:h.end_line},c=h.name,l=h.start_line}else{let h=df(t,i,s);if(h)a=h,l=h.start,c=m||i;else{let v=o.exports.findByFile(t).map(y=>y.name).filter(y=>!!y).slice(0,10);return{isError:!0,content:[{type:"text",text:`Symbol not found in file: "${i}"
|
|
940
|
+
File: ${Pe.relative(e,t)}
|
|
941
|
+
`+(v.length>0?`Top symbols in file: ${v.join(", ")}`:"No indexed symbols found for this file.")}]}}}if(a&&S_(t,a,i,s)){let h=df(t,i,s);h&&($.warn({filePath:t,symbolName:i,start:a.start,end:a.end},"Indexed symbol range appears degenerate; using source-inferred range for flow"),a=h,l=h.start,c===Pe.basename(t)&&(c=m||i))}}let u={type:a?"function":"file",name:c,path:Pe.relative(e,t),line:l,children:[]},p=new Set;p.add(t+(i?`:${i}`:""));let d={count:0,truncated:!1,pruned:!1};return await Nr(t,u,e,o,p,1,d,s,a),(d.truncated||d.pruned)&&u.children.push({type:"function",name:"\u26A0\uFE0F Trace Pruned",details:`Adaptive trace limits applied (depth/node budget). Current cap: ${zn} nodes.`,children:[]}),{content:[{type:"text",text:JSON.stringify(u,null,2)}]}}async function Nr(n,e,r,i,t,o,s,a,c){let l=fI(s.count);if(o>l){s.pruned=!0;return}if(s.count>=zn){s.truncated=!0;return}try{let u=mf(n,a);if(!u)throw new Error(`Unable to read source: ${n}`);let p=u,d=Pe.extname(n).toLowerCase(),f=(p.match(/import\s+[\s\S]*?from\s+['"].*?['"];?/gm)||[]).join(`
|
|
942
|
+
`);c&&(p=p.split(`
|
|
943
|
+
`).slice(c.start-1,c.end).join(`
|
|
944
|
+
`));let h;if(d===".ts"||d===".tsx"||d===".js"||d===".jsx"){h=new Jn;let C={syntax:"typescript",tsx:n.endsWith(".tsx"),target:"es2020"};try{let S=c?`${f}
|
|
945
|
+
${p}`:p,R=await Lr(S,C);h.visitModule(R)}catch{if(c)try{let R=`${f}
|
|
803
946
|
class TraceContext {
|
|
804
|
-
${
|
|
805
|
-
}`,k=await Yv.parse(y,_);d.visitModule(k)}catch{let k=new Ot,S=l;k.visit(c,S),d.calls=k.calls,d.apiCalls=k.apiCalls,d.imports=k.imports}else{let y=new Ot;y.visit(c,l),d.calls=y.calls,d.apiCalls=y.apiCalls,d.imports=y.imports}}}else d=new Ot,d.visit(c,l);b.info({file:et.basename(n),calls:d.calls.size,apiCalls:d.apiCalls.length,depth:o},"Analyzed file");let m=d.apiCalls.slice(0,10);for(let _ of m){if(s.count>=di)break;if(s.count++,_.method==="PUBSUB"){let S={type:"event_trigger",name:`PubSub Event: ${_.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(S);let $=i.exports.findByNameGlobal(_.url).concat(i.exports.findByMethodName(_.url));if(_.url.length>10){let T=_.url.replace(/To[A-Z][a-zA-Z]+$/,"");if(T!==_.url){let P=i.exports.findByNameGlobal(T).concat(i.exports.findByMethodName(T));$.push(...P)}}let E=new Set;for(let T of $){if(E.has(T.file_path)||T.file_path===n)continue;if(E.add(T.file_path),s.count>=di)break;s.count++;let P={type:"subscriber",name:`${T.name} (${et.basename(T.file_path)})`,path:et.relative(r,T.file_path),line:T.start_line,details:"Potential Subscriber / Handler",children:[]};S.children.push(P),pi.existsSync(T.file_path)&&!t.has(T.file_path)&&(t.add(T.file_path),await lr(T.file_path,P,r,i,t,o+1,s))}continue}let v={type:"api_call",name:`${_.method} ${_.url}`,details:"Detected via string literal analysis",children:[]};e.children.push(v);let k=Tm(i,_.url).slice(0,vk);for(let S of k){if(s.count>=di)break;s.count++;let $={type:"route",name:S.signature||"Route Handler",path:S.file_path,line:S.start_line,children:[]};if(v.children.push($),pi.existsSync(S.file_path)&&!t.has(S.file_path)&&(t.add(S.file_path),await lr(S.file_path,$,r,i,t,o+1,s)),S.capabilities)try{let E=JSON.parse(S.capabilities);if(E.handler){let[T,P]=E.handler.split("@");if(T){let I=T.split("\\").pop();if(I){let O=i.exports.findClassByName(I);if(O){let Z=i.exports.findByNameAndFile(P||"",O.file_path),B,C=O.start_line;Z.length>0&&(B={start:Z[0].start_line,end:Z[0].end_line},C=Z[0].start_line);let R={type:"component",name:`${I}${P?" :: "+P:""}`,path:et.relative(r,O.file_path),line:C,details:"Controller Logic (Macro IR)",children:[]};$.children.push(R),t.has(O.file_path+(P?`:${P}`:""))||(t.add(O.file_path+(P?`:${P}`:"")),await lr(O.file_path,R,r,i,t,o+1,s,B))}}}}}catch{}}}let f=d.calls,h=Array.from(f).sort();for(let _ of h)if(d.imports.has(_)){let v=d.imports.get(_);if(!v.startsWith(".")){if(["react","react-dom"].includes(v))continue;e.children.push({type:"function",name:_,details:`External: ${v}`,children:[]});continue}let y=Pt(v,n,r);if(y&&pi.existsSync(y))if(t.has(y))e.children.push({type:"function",name:_,details:"Circular / Already Visited",path:et.relative(r,y),children:[]});else{t.add(y);let k={type:"file",name:_,details:`Imported from ${et.basename(y)}`,path:et.relative(r,y),children:[]};e.children.push(k),await lr(y,k,r,i,t,o+1,s)}}else if(!["log","info","error","warn","print"].includes(_)){let v=i.exports.findByNameGlobal(_);if(v.length===0){let y=_.split(/(?:\.|->|::)+/);if(y.length>1){let k=y[y.length-1];_k.has(k)||(v=i.exports.findByMethodName(k))}}if(v.length>0){let y=v.find(S=>S.file_path===n),k=y||(v.length===1?v[0]:null);if(k){let S=`${k.file_path}:${k.name}`;if(!t.has(S)){t.add(S);let $={type:"component",name:_,details:`Resolved via global index${y?" (local)":""}`,path:et.relative(r,k.file_path),line:k.start_line,children:[]};e.children.push($),await lr(k.file_path,$,r,i,t,o+1,s,{start:k.start_line,end:k.end_line})}}}}}catch(c){b.error({filePath:n,error:c.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:c.message,children:[]})}}}X();import Qv from"path";async function t_(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await Q(e);let{imports:s}=L.getInstance(e);if(i==="imports"){let c=s.findByFile(r).map(d=>{let m={module:d.module_specifier,symbols:d.imported_symbols,resolvedPath:d.resolved_path,relativePath:d.resolved_path?Qv.relative(e,d.resolved_path):null,isExternal:!d.resolved_path};if(!d.resolved_path){let f=Pi(d.module_specifier,r,e);if(!f.resolved)return{...m,resolutionError:f.error,suggestion:f.suggestion}}return m}),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:e_(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}else{let c=s.findDependents(r).map(d=>({file:d.file_path,relativePath:Qv.relative(e,d.file_path),importStatement:d.module_specifier,importedSymbols:d.imported_symbols})),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:e_(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}}function e_(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}X();import n_ from"path";import bk from"fs";async function r_(n){let{repoPath:e,mode:r,limit:i=50,includeMigrations:t=!1,includeFixtures:o=!1,excludePatterns:s=[],confidenceThreshold:a="all"}=n;await Q(e);let{exports:c,imports:l}=L.getInstance(e);if(r==="dead-code"){let d=c.findDeadExports({limit:i,includeTests:!0,includeMigrations:t,includeFixtures:o,excludePatterns:s,confidenceThreshold:a}).map(y=>({name:y.name,kind:y.kind,file:n_.relative(e,y.file_path),line:y.start_line,confidence:y.confidence,reason:y.reason})),m={high:{},medium:{},low:{}};for(let y of d)m[y.confidence][y.file]||(m[y.confidence][y.file]=[]),m[y.confidence][y.file].push({name:y.name,kind:y.kind,line:y.line,reason:y.reason});let f=[],h=Object.values(m.high).flat().length,_=Object.values(m.medium).flat().length,v=Object.values(m.low).flat().length;return f.push(`# Dead Export Analysis
|
|
806
|
-
`),
|
|
807
|
-
`),
|
|
808
|
-
`),
|
|
947
|
+
${p}
|
|
948
|
+
}`,A=await Lr(R,C);h.visitModule(A)}catch{let A=new qt,H=d;A.visit(p,H),h.calls=A.calls,h.apiCalls=A.apiCalls,h.imports=A.imports}else{let R=new qt;R.visit(p,d),h.calls=R.calls,h.apiCalls=R.apiCalls,h.imports=R.imports}}}else h=new qt,h.visit(p,d);$.info({file:Pe.basename(n),calls:h.calls.size,apiCalls:h.apiCalls.length,depth:o},"Analyzed file");let v=Math.max(0,zn-s.count),y=Math.max(2,Math.min(10,Math.floor(v/(o<=2?3:5)))),b=h.apiCalls.slice(0,y);h.apiCalls.length>y&&(s.pruned=!0);for(let C of b){if(s.count>=zn)break;if(s.count++,C.method==="PUBSUB"){let H={type:"event_trigger",name:`PubSub Event: ${C.url}`,details:"Detected via PubSub client usage",children:[]};e.children.push(H);let W=C.url.toLowerCase();if(cI.has(W)){H.children.push({type:"subscriber",name:"PubSub fan-out omitted",details:"Generic publish call without concrete event/action; skipping global subscriber expansion to avoid false links.",children:[]});continue}let O=i.exports.findByNameGlobal(C.url).concat(i.exports.findByMethodName(C.url));if(C.url.length>10){let D=C.url.replace(/To[A-Z][a-zA-Z]+$/,"");if(D!==C.url){let M=i.exports.findByNameGlobal(D).concat(i.exports.findByMethodName(D));O.push(...M)}}let K=new Set;for(let D of O.slice(0,iI)){if(K.has(D.file_path)||D.file_path===n)continue;if(K.add(D.file_path),s.count>=zn)break;s.count++;let M={type:"subscriber",name:`${D.name} (${Pe.basename(D.file_path)})`,path:Pe.relative(r,D.file_path),line:D.start_line,details:"Potential Subscriber / Handler",children:[]};H.children.push(M),Cn.existsSync(D.file_path)&&!t.has(D.file_path)&&(t.add(D.file_path),await Nr(D.file_path,M,r,i,t,o+1,s,a))}continue}let S={type:"api_call",name:`${C.method} ${C.url}`,details:"Detected via string literal analysis",children:[]};e.children.push(S);let A=uf(i,C.url,C.method).slice(0,rI);for(let H of A){if(dI(H.file_path,n))continue;if(s.count>=zn)break;s.count++;let W={type:"route",name:H.signature||"Route Handler",path:H.file_path,line:H.start_line,children:[]};if(S.children.push(W),Cn.existsSync(H.file_path)&&!t.has(H.file_path)&&(t.add(H.file_path),await Nr(H.file_path,W,r,i,t,o+1,s,a)),H.capabilities)try{let O=JSON.parse(H.capabilities);if(O.handler){let[K,D]=O.handler.split("@");if(K){let V=K.split("\\").pop();if(V){let J=i.exports.findClassByName(V);if(J){let P=i.exports.findByNameAndFile(D||"",J.file_path),E,G=J.start_line;P.length>0&&(E=Da(J.file_path,{start:P[0].start_line,end:P[0].end_line},D||"",a),E||(E={start:P[0].start_line,end:P[0].end_line}),G=E.start);let Y={type:"component",name:`${V}${D?" :: "+D:""}`,path:Pe.relative(r,J.file_path),line:G,details:"Controller Logic (Macro IR)",children:[]};W.children.push(Y),t.has(J.file_path+(D?`:${D}`:""))||(t.add(J.file_path+(D?`:${D}`:"")),await Nr(J.file_path,Y,r,i,t,o+1,s,a,E))}}}}}catch{}}}let _=c?c.start-1:0,x=gI(p,_).slice(0,oI);for(let C of x){if(s.count>=zn)break;s.count++,e.children.push({type:"data_flow",name:`${C.symbol} handoff`,line:C.toLine,details:`assigned @L${C.fromLine} \u2192 used @L${C.toLine}`,children:[]})}let k=h.calls,I=Array.from(k).sort(),N=hI(o,s.count),L=I.slice(0,N);I.length>N&&(s.pruned=!0);for(let C of L)if(h.imports.has(C)){let S=h.imports.get(C);if(!S.startsWith(".")){if(["react","react-dom"].includes(S))continue;e.children.push({type:"function",name:C,details:`External: ${S}`,children:[]});continue}let R=Ht(S,n,r);if(R&&Cn.existsSync(R)){let A=i.exports.findByNameAndFile(C,R),H=A.length>0?A[0]:null,W=H?`${R}:${H.name}`:R;if(t.has(W))e.children.push({type:"function",name:C,details:"Circular / Already Visited",path:Pe.relative(r,R),line:H?.start_line,children:[]});else{t.add(W);let O={type:H?"component":"file",name:C,details:H?`Imported symbol from ${Pe.basename(R)}`:`Imported from ${Pe.basename(R)}`,path:Pe.relative(r,R),line:H?.start_line,children:[]};e.children.push(O);let K=H?Da(R,{start:H.start_line,end:H.end_line},C,a):void 0;await Nr(R,O,r,i,t,o+1,s,a,K)}}}else if(!["log","info","error","warn","print"].includes(C)&&!mI(C)){let S=i.exports.findByNameGlobal(C);if(S.length===0){let R=C.split(/(?:\.|->|::)+/);if(R.length>1){let A=R[0]?.replace(/^\$+/,"").toLowerCase(),H=R[R.length-1];!__.has(H)&&!(A&&v_.has(A))&&(S=i.exports.findByMethodName(H))}}if(S.length>0){let R=S.find(H=>H.file_path===n),A=R||(S.length===1?S[0]:null);if(A){let H=`${A.file_path}:${A.name}`;if(!t.has(H)){t.add(H);let W={type:"component",name:C,details:`Resolved via global index${R?" (local)":""}`,path:Pe.relative(r,A.file_path),line:Da(A.file_path,{start:A.start_line,end:A.end_line},C,a)?.start,children:[]};e.children.push(W);let O=Da(A.file_path,{start:A.start_line,end:A.end_line},C,a)||{start:A.start_line,end:A.end_line};await Nr(A.file_path,W,r,i,t,o+1,s,a,O)}}}}}catch(u){$.error({filePath:n,error:u.message},"Trace analysis failed"),e.children.push({type:"function",name:"Error",details:u.message,children:[]})}}ee();import La from"path";function vI(n){return/^@[^/]+\/[^/]+/.test(n)}function _I(n){return!!(n.startsWith("#")||n.startsWith("@/")||n.startsWith("~/")||n.startsWith("@")&&!vI(n))}function xI(n,e){if(!e)return null;let r=La.relative(n,e);return!r||r.startsWith("..")||La.isAbsolute(r)?null:r}function SI(n,e,r){return n.startsWith("node:")?"builtin":n.startsWith(".")?"relative":_I(n)?"alias":e.startsWith(r+La.sep)?"workspace-package":"external-package"}function $I(n){return n==="builtin"||n==="external-package"||n==="missing"}async function k_(n){let{repoPath:e,filePath:r,direction:i,limit:t,offset:o=0}=n;await te(e);let{imports:s}=z.getInstance(e);if(i==="imports"){let c=s.findByFile(r).filter(d=>d.module_specifier!=="__type_reference__").map(d=>{let m=d.resolved_path?null:no(d.module_specifier,r,e),f=d.resolved_path||m?.resolvedPath||null,h=d.resolved_path?SI(d.module_specifier,d.resolved_path,e):m?.kind||"missing",v={module:d.module_specifier,symbols:d.imported_symbols,resolvedPath:f,relativePath:xI(e,f),isExternal:$I(h),dependencyClass:h,isBuiltin:h==="builtin"};if(m&&!m.resolved){let y={...v,resolutionError:m.error};return m.actionable&&m.suggestion?{...y,suggestion:m.suggestion}:y}return v}),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:w_(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}else{let c=s.findDependents(r).map(d=>({file:d.file_path,relativePath:La.relative(e,d.file_path),importStatement:d.module_specifier,importedSymbols:d.imported_symbols})),l=[...c].sort((d,m)=>(d.relativePath||"").localeCompare(m.relativePath||"")),p={results:w_(l,t,o),total:c.length,offset:o,limit:t||c.length,hasMore:t?o+t<c.length:!1};return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}}function w_(n,e,r=0){return e?n.slice(r,r+e):n.slice(r)}ee();import Di from"path";import wI from"fs";var E_={low:0,medium:1,high:2};function hf(n,e){return E_[n]>E_[e]?e:n}function kI(n){return n==="high"?"medium":"low"}function EI(n,e,r,i){let t=r,o=i,s=n.toLowerCase().replace(/\\/g,"/");return(s.includes("/__generated__/")||s.includes("/generated/")||s.includes("/.generated/")||s.includes("/dist/")||s.includes("/build/")||s.includes("/vendor/")||s.includes("/coverage/")||s.includes(".generated.")||s.includes(".gen."))&&(t=hf(t,"low"),o+="; generated artifact"),(/(^|\/)(src\/)?app\/.*\/(route|page|layout|loading|error|not-found|default|template)\.(t|j)sx?$/.test(s)||/(^|\/)(src\/)?middleware\.(t|j)sx?$/.test(s)||s.includes("/routes/")||s.includes("/controllers/"))&&(t=hf(t,"medium"),o+="; framework convention entrypoint"),(s.includes("/registry/")||s.includes("/registries/")||s.includes("/plugins/")||s.includes("/providers/")||s.includes("/bootstrap/")||/register|resolver|plugin|provider|adapter/i.test(e))&&(t=hf(t,"medium"),o+="; dynamic discovery surface"),{confidence:t,reason:o}}function II(n){let e=new Map;for(let r of n)r.resolved_path&&(e.has(r.file_path)||e.set(r.file_path,new Set),e.has(r.resolved_path)||e.set(r.resolved_path,new Set),e.get(r.file_path).add(r.resolved_path));return e}function TI(n){let e=0,r=[],i=new Set,t=new Map,o=new Map,s=[],a=c=>{t.set(c,e),o.set(c,e),e++,r.push(c),i.add(c);for(let l of n.get(c)||[])t.has(l)?i.has(l)&&o.set(c,Math.min(o.get(c),t.get(l))):(a(l),o.set(c,Math.min(o.get(c),o.get(l))));if(o.get(c)===t.get(c)){let l=[];for(;r.length>0;){let u=r.pop();if(i.delete(u),l.push(u),u===c)break}s.push(l)}};for(let c of n.keys())t.has(c)||a(c);return s}function RI(n,e,r){let i=r.get(n);if(i===void 0){try{i=wI.readFileSync(n,"utf8")}catch{i=""}r.set(n,i)}if(!i)return!1;let t=e.module_specifier.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`import\\s+type\\s+.*from\\s+['"]${t}['"]`,"i"),s=new RegExp(`import\\s+\\{.*type\\s+.*\\}.*from\\s+['"]${t}['"]`,"s");if(o.test(i)||s.test(i))return!0;let a=e.imported_symbols.split(",").map(c=>c.trim());for(let c of a){if(!c||c==="*")continue;let l=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\(\\s*\\)\\s*=>\\s*${l}`).test(i))return!0}return!1}function PI(n){let e=new Map;for(let r of n){if(!r.resolved_path)continue;let i=`${r.file_path}|${r.resolved_path}`;e.has(i)||e.set(i,[]),e.get(i).push(r)}return e}function I_(n,e){let r=new Map,i=new Map;for(let a of n)a.resolved_path&&(r.has(a.file_path)||r.set(a.file_path,new Set),i.has(a.file_path)||i.set(a.file_path,new Set),r.has(a.resolved_path)||r.set(a.resolved_path,new Set),i.has(a.resolved_path)||i.set(a.resolved_path,new Set),r.get(a.file_path).add(a.resolved_path),i.get(a.resolved_path).add(a.file_path));let o=Array.from(new Set([...r.keys(),...i.keys()])).map(a=>{let c=r.get(a)?.size||0,l=i.get(a)?.size||0,u=l+c===0?0:c/(l+c);return{file:Di.relative(e,a),afferent:l,efferent:c,instability:Number(u.toFixed(3))}}),s=o.length===0?0:Number((o.reduce((a,c)=>a+c.instability,0)/o.length).toFixed(3));return{module_count:o.length,average_instability:s,top_efferent:[...o].sort((a,c)=>c.efferent-a.efferent).slice(0,10),top_afferent:[...o].sort((a,c)=>c.afferent-a.afferent).slice(0,10),most_unstable:[...o].filter(a=>a.afferent+a.efferent>0).sort((a,c)=>c.instability-a.instability||c.efferent-a.efferent).slice(0,10)}}async function T_(n){let{repoPath:e,mode:r,limit:i=50,includeTests:t=!1,includeMigrations:o=!1,includeFixtures:s=!1,excludePatterns:a=[],confidenceThreshold:c="all"}=n;await te(e);let{exports:l,imports:u}=z.getInstance(e);if(r==="dead-code"){let p=l.findDeadExports({limit:i,includeTests:t,includeMigrations:o,includeFixtures:s,excludePatterns:a,confidenceThreshold:c}),d=new Yt(e),m=u.getAllResolved(),f=I_(m,e),h=p.map(k=>{let I=d.getMappedTestsForSymbol(k.file_path,k.name,6),N=EI(k.file_path,k.name,k.confidence,k.reason),L=N.confidence,C=N.reason;return I.length>0&&(L=kI(L),C+="; covered by tests"),{name:k.name,kind:k.kind,file:Di.relative(e,k.file_path),line:k.start_line,confidence:L,reason:C,testCoverage:{mappedTestCount:I.length,mappedTests:I.map(S=>S.file),coverageHint:I.length>0?"covered":"uncovered"}}}),v={high:{},medium:{},low:{}};for(let k of h)v[k.confidence][k.file]||(v[k.confidence][k.file]=[]),v[k.confidence][k.file].push({name:k.name,kind:k.kind,line:k.line,reason:k.reason,testCoverage:k.testCoverage});let y=[],b=Object.values(v.high).flat().length,_=Object.values(v.medium).flat().length,x=Object.values(v.low).flat().length;return y.push(`# Dead Export Analysis
|
|
949
|
+
`),y.push(`Found ${h.length} potentially unused exports.`),y.push(`- **High confidence** (likely dead): ${b}`),y.push(`- **Medium confidence** (possibly intentional): ${_}`),y.push(`- **Low confidence** (likely intentional): ${x}
|
|
950
|
+
`),b>0&&(y.push(`## High Confidence (Likely Dead)
|
|
951
|
+
`),y.push(JSON.stringify(v.high,null,2))),_>0&&c!=="high"&&(y.push(`
|
|
809
952
|
## Medium Confidence (Possibly Intentional)
|
|
810
|
-
`),
|
|
953
|
+
`),y.push(JSON.stringify(v.medium,null,2))),x>0&&c==="all"&&(y.push(`
|
|
811
954
|
## Low Confidence (Likely Intentional)
|
|
812
|
-
`),
|
|
813
|
-
|
|
955
|
+
`),y.push(JSON.stringify(v.low,null,2))),y.push(`
|
|
956
|
+
## Structural Risk Metrics
|
|
957
|
+
`),y.push(JSON.stringify(f,null,2)),{content:[{type:"text",text:y.join(`
|
|
958
|
+
`)}]}}else if(r==="circular-deps"){let p=typeof i=="number"?i:20,d=u.getAllResolved(),m=II(d),f=TI(m),h=PI(d),v=new Map,y=I_(d,e),_=f.filter(x=>{if(x.length>1)return!0;let k=x[0];return(m.get(k)||new Set).has(k)}).map(x=>{let k=new Set(x),I=[];for(let L of x)for(let C of m.get(L)||[])k.has(C)&&I.push({from:L,to:C});let N=I.filter(({from:L,to:C})=>{let S=h.get(`${L}|${C}`)||[];return S.length===0?!0:!S.every(R=>RI(L,R,v))});return{component:x,internalEdges:I,unsafeEdges:N}}).filter(x=>x.unsafeEdges.length>0).sort((x,k)=>k.component.length-x.component.length||k.unsafeEdges.length-x.unsafeEdges.length).slice(0,p).map((x,k)=>({id:k+1,size:x.component.length,files:x.component.map(I=>Di.relative(e,I)).sort(),internal_edge_count:x.internalEdges.length,unsafe_edge_count:x.unsafeEdges.length,unsafe_edges:x.unsafeEdges.slice(0,10).map(I=>`${Di.relative(e,I.from)} -> ${Di.relative(e,I.to)}`)}));return{content:[{type:"text",text:`# Circular Dependency Analysis
|
|
959
|
+
|
|
960
|
+
Found ${_.length} circular dependency group(s).
|
|
814
961
|
|
|
815
|
-
|
|
962
|
+
## SCC Groups
|
|
963
|
+
${JSON.stringify(_,null,2)}
|
|
816
964
|
|
|
817
|
-
|
|
818
|
-
|
|
965
|
+
## Structural Risk Metrics
|
|
966
|
+
${JSON.stringify(y,null,2)}`}]}}return{isError:!0,content:[{type:"text",text:"Invalid mode"}]}}async function R_(n){let{repoPath:e,subPath:r,maxDepth:i=5}=n,t=5e4,o=[{level:"signatures",depth:i},{level:"summaries",depth:i,meta:{warning:"Export lists omitted for token efficiency.",action:"Use 'shadow_inspect_file' on specific files to see exports."}},{level:"structure",depth:i,meta:{warning:"Detailed signatures omitted due to repo size.",action:"Use 'shadow_inspect_file' on specific files to see details."}},{level:"summaries",depth:2,meta:{warning:"Repository is large. Showing top 2 levels with summaries only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore deeper."}},{level:"structure",depth:2,meta:{warning:"Repository is large. Showing top 2 levels structure only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}},{level:"lite",depth:1,meta:{warning:"Repository is massive. Showing root files only.",action:"Use 'shadow_recon_tree' with a 'subPath' to explore."}}];for(let s of o){let a=await qc(e,5,s.level,r,s.depth);s.meta&&(a._meta=s.meta);let c=JSON.stringify(a,null,2);if(c.length<=t)return{content:[{type:"text",text:c}]}}return{content:[{type:"text",text:`Warning: The repository at ${r||"root"} is massive (exceeds ${t} chars even at minimal depth).
|
|
967
|
+
Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_search_symbol' to find what you need.`}]}}We();async function P_(n){let{repoPath:e,compact:r=!1}=n,t=new ce(e).getSnapshot();if(r&&t.gravity?.hotspots){let o=t.gravity.hotspots.length;t={...t,gravity:{...t.gravity,hotspots:t.gravity.hotspots.slice(0,20),_truncated:o>20,_totalHotspots:o}}}return{content:[{type:"text",text:JSON.stringify(t,null,2)}],suggestedNext:{tool:"shadow_ops_chronicle",reason:"Recent decisions and ADRs"}}}ee();yt();We();function N_(n){switch(n){case"Entry":return"\u{1F6AA}";case"Logic":return"\u2699\uFE0F";case"Data":return"\u{1F4BE}";case"Utility":return"\u{1F527}";case"Infrastructure":return"\u{1F3D7}\uFE0F";case"Test":return"\u{1F9EA}";case"Types":return"\u{1F4DD}";case"Unknown":return"\u2753"}}async function z_(n){let{repoPath:e}=n;await te(e);let r=z.getInstance(e),i=He(r,e);new ce(e).updateTopography(i);let o=["Entry","Logic","Data","Utility","Infrastructure","Test","Types","Unknown"],s=`# \u{1F3D7}\uFE0F Architecture Summary
|
|
819
968
|
|
|
820
969
|
`;if(s+=`## Detected Pattern: **${i.pattern}**
|
|
821
970
|
`,s+=`Confidence: ${i.patternConfidence.toFixed(0)}%
|
|
@@ -827,18 +976,18 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
|
|
|
827
976
|
|
|
828
977
|
`,s+=`| Layer | Files | % of Total |
|
|
829
978
|
`,s+=`|-------|------:|:----------:|
|
|
830
|
-
`;let a=o.reduce((c,l)=>c+i.layers[l].count,0);for(let c of o){let l=i.layers[c],u=a>0?(l.count/a*100).toFixed(1):"0.0",p=
|
|
979
|
+
`;let a=o.reduce((c,l)=>c+i.layers[l].count,0);for(let c of o){let l=i.layers[c],u=a>0?(l.count/a*100).toFixed(1):"0.0",p=N_(c);s+=`| ${p} ${c} | ${l.count} | ${u}% |
|
|
831
980
|
`}s+=`
|
|
832
981
|
## Top Files by Layer
|
|
833
982
|
|
|
834
|
-
`;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=
|
|
983
|
+
`;for(let c of o){let l=i.layers[c];if(l.count===0)continue;let u=N_(c);if(s+=`### ${u} ${c} (${l.count} files)
|
|
835
984
|
`,l.topFiles.length>0)for(let p of l.topFiles)s+=`- \`${p.path}\` (${p.confidence}% conf)
|
|
836
985
|
`,p.signals.length>0&&(s+=` - ${p.signals.join("; ")}
|
|
837
986
|
`);else s+=`- _No files classified with high confidence_
|
|
838
987
|
`;s+=`
|
|
839
988
|
`}return s+=`---
|
|
840
989
|
`,s+=`**Next Steps:**
|
|
841
|
-
`,s+="- Use `shadow_inspect_file` to explore files in each layer\n",s+="- Use `shadow_analyze_flow` to trace execution from Entry \u2192 Logic \u2192 Data\n",s+="- Use `shadow_analyze_deps` to understand layer boundaries\n",{content:[{type:"text",text:s}],suggestedNext:{tool:"shadow_recon_tree",reason:"Explore a subPath or use shadow_inspect_file"}}}
|
|
990
|
+
`,s+="- Use `shadow_inspect_file` to explore files in each layer\n",s+="- Use `shadow_analyze_flow` to trace execution from Entry \u2192 Logic \u2192 Data\n",s+="- Use `shadow_analyze_deps` to understand layer boundaries\n",{content:[{type:"text",text:s}],suggestedNext:{tool:"shadow_recon_tree",reason:"Explore a subPath or use shadow_inspect_file"}}}ee();yt();We();import Ot from"path";async function C_(n){let{repoPath:e}=n;await te(e);let r=z.getInstance(e),i=He(r,e),o=new ce(e).getSnapshot(),s=[],a=[],c=Object.values(i.layers.Entry.topFiles).map(d=>d.path),l=new Set(Object.values(i.layers.Data.topFiles).map(d=>d.path));for(let d of c){let m=Ot.isAbsolute(d)?d:Ot.join(e,d),f=r.imports.findByFile(m);for(let h of f)h.resolved_path&&l.has(Ot.relative(e,h.resolved_path))&&s.push(`\u2694\uFE0F LAYER BYPASS: \`${Ot.relative(e,d)}\` directly imports Data layer \`${Ot.relative(e,h.resolved_path)}\`. Should go through Logic.`)}let u=o.gravity?.hotspots||[];for(let d of u){let m=Bt(d.filePath,r);(m.layer==="Utility"||m.layer==="Unknown")&&d.gravity>50&&a.push(`\u{1F6A8} GRAVITY ANOMALY: \`${Ot.relative(e,d.filePath)}\` has high gravity (${d.gravity.toFixed(0)}) but is classified as ${m.layer}. Consider promoting to Core Logic.`)}for(let d of c){let m=Ot.isAbsolute(d)?d:Ot.join(e,d),f=r.exports.findByFile(m);f.length>10&&a.push(`\u{1F388} ENTRY BLOAT: \`${Ot.relative(e,d)}\` exports ${f.length} symbols. Entry handlers should be thin interfaces.`)}let p=`# \u{1F575}\uFE0F Architectural Scout Report
|
|
842
991
|
|
|
843
992
|
`;return s.length===0&&a.length===0?p+=`\u2705 No significant architectural drift detected. The structure remains "Legit".
|
|
844
993
|
`:(s.length>0&&(p+=`## \u274C Structural Violations
|
|
@@ -847,59 +996,107 @@ Please use 'shadow_recon_tree' with a more specific 'subPath' or use 'shadow_sea
|
|
|
847
996
|
`),a.length>0&&(p+=`## \u26A0\uFE0F Architectural Warnings
|
|
848
997
|
`,a.forEach(d=>p+=`- ${d}
|
|
849
998
|
`),p+=`
|
|
850
|
-
`)),{content:[{type:"text",text:p}]}}
|
|
999
|
+
`)),{content:[{type:"text",text:p}]}}Oe();ee();Q();import kt from"path";We();yt();Q();Ln();import he from"fs";import NI from"os";import wt from"path";var An=$.child({module:"git-hooks"}),zI="Generated by liquid-shadow",CI=1e6,A_=["post-merge","post-checkout","post-commit"];function AI(){let n=process.env.LIQUID_SHADOW_CLI_ENTRY;if(n){let r=wt.resolve(n);if(he.existsSync(r))return r}let e=nt("dist/entry/cli/index.js");return he.existsSync(e)?e:null}function gf(n){return n.includes("liquid-shadow")||n.includes("mcp-liquid-shadow")||n.includes(zI)}function DI(){let n=wt.join(NI.homedir(),".mcp-liquid-shadow","logs"),e=wt.join(n,"post-checkout.log");try{if(!he.existsSync(e)||he.statSync(e).size<=CI)return null;he.mkdirSync(n,{recursive:!0});let i=`${e}.1`;return he.existsSync(i)&&he.unlinkSync(i),he.renameSync(e,i),null}catch(r){return`Failed to rotate post-checkout.log: ${r}`}}function LI(n,e){return{"post-merge":`#!/bin/sh
|
|
1000
|
+
# Liquid Shadow: Auto-refresh index after merge/pull
|
|
1001
|
+
# Generated by liquid-shadow
|
|
1002
|
+
|
|
1003
|
+
REPO_PATH="$(git rev-parse --show-toplevel)"
|
|
1004
|
+
|
|
1005
|
+
# Run liquid-shadow sync in background to avoid blocking git operations
|
|
1006
|
+
nohup "${n}" "${e}" sync "$REPO_PATH" > /dev/null 2>&1 &
|
|
1007
|
+
|
|
1008
|
+
exit 0
|
|
1009
|
+
`,"post-checkout":`#!/bin/sh
|
|
1010
|
+
# Liquid Shadow: Auto-refresh index after branch checkout
|
|
1011
|
+
# Generated by liquid-shadow
|
|
1012
|
+
|
|
1013
|
+
# Only run on branch checkouts, not file checkouts
|
|
1014
|
+
# $3 is 1 for branch checkout, 0 for file checkout
|
|
1015
|
+
[ "$3" = "1" ] || exit 0
|
|
1016
|
+
|
|
1017
|
+
# Skip no-op checkouts where HEAD does not change
|
|
1018
|
+
[ "$1" = "$2" ] && exit 0
|
|
1019
|
+
|
|
1020
|
+
REPO_PATH="$(git rev-parse --show-toplevel)"
|
|
1021
|
+
LOG_DIR="$HOME/.mcp-liquid-shadow/logs"
|
|
1022
|
+
LOG_FILE="$LOG_DIR/post-checkout.log"
|
|
1023
|
+
|
|
1024
|
+
mkdir -p "$LOG_DIR"
|
|
1025
|
+
|
|
1026
|
+
# Run incremental index in background (force=false default preserves fast-path)
|
|
1027
|
+
nohup "${n}" "${e}" index "$REPO_PATH" --deep >> "$LOG_FILE" 2>&1 &
|
|
1028
|
+
|
|
1029
|
+
exit 0
|
|
1030
|
+
`,"post-commit":`#!/bin/sh
|
|
1031
|
+
# Liquid Shadow: Trigger symbol shift detection after commit
|
|
1032
|
+
# Generated by liquid-shadow
|
|
1033
|
+
|
|
1034
|
+
REPO_PATH="$(git rev-parse --show-toplevel)"
|
|
1035
|
+
|
|
1036
|
+
# Run liquid-shadow sync in background
|
|
1037
|
+
nohup "${n}" "${e}" sync "$REPO_PATH" > /dev/null 2>&1 &
|
|
1038
|
+
|
|
1039
|
+
exit 0
|
|
1040
|
+
`}}function Li(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=wt.join(e,".git","hooks"),o=[],s=[],a=[];if(!he.existsSync(wt.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};he.existsSync(t)||he.mkdirSync(t,{recursive:!0});let c=AI();if(!c)return a.push(`Unable to resolve CLI entry at install time. Expected ${nt("dist/entry/cli/index.js")} to exist.`),{installed:o,skipped:s,errors:a};let l=LI(process.execPath,c),u=new Set;if(r&&(u.add("post-merge"),u.add("post-checkout")),i&&u.add("post-commit"),u.has("post-checkout")){let p=DI();p&&(a.push(p),An.warn({rotationError:p},"Post-checkout log rotation failed"))}for(let p of u){let d=wt.join(t,p),m=l[p];if(!m){a.push(`No template found for hook: ${p}`);continue}try{if(he.existsSync(d)){let f=he.readFileSync(d,"utf-8"),h=gf(f);if(h&&f===m){he.chmodSync(d,493),s.push(p),An.info({hookName:p},"Hook already installed, skipping");continue}if(!h){let v=`${d}.backup-${Date.now()}`;he.copyFileSync(d,v),An.info({hookName:p,backupPath:v},"Backed up existing hook")}}he.writeFileSync(d,m,{mode:493}),he.chmodSync(d,493),o.push(p),An.info({hookName:p},"Installed git hook")}catch(f){a.push(`Failed to install ${p}: ${f}`),An.error({hookName:p,err:f},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function yf(n){let e=wt.join(n,".git","hooks"),r=[],i=[];if(!he.existsSync(e))return{removed:r,errors:i};for(let t of A_){let o=wt.join(e,t);try{if(he.existsSync(o)){let s=he.readFileSync(o,"utf-8");gf(s)&&(he.unlinkSync(o),r.push(t),An.info({hookName:t},"Removed git hook"))}}catch(s){i.push(`Failed to remove ${t}: ${s}`),An.error({hookName:t,err:s},"Failed to remove hook")}}return{removed:r,errors:i}}function OI(n,e){let r=wt.join(n,".git","hooks"),i=wt.join(r,e);if(!he.existsSync(r)||!he.existsSync(i))return"missing";try{let t=he.readFileSync(i,"utf-8");return gf(t)?(he.statSync(i).mode&73)!==0?"installed":"disabled":"foreign"}catch{return"foreign"}}function Oi(n){let e=[],r=[],i=[],t=[],o={};for(let a of A_){let c=OI(n,a);o[a]=c,c==="installed"&&e.push(a),c==="missing"&&r.push(a),c==="foreign"&&i.push(a),c==="disabled"&&t.push(a)}let s=[...r,...i,...t];return{installed:e,notInstalled:s,missing:r,foreign:i,disabled:t,statuses:o}}async function D_(n){let{repoPath:e}=n;$.info({repoPath:e},"Setting up repository..."),$.info({repoPath:e}," Ensuring index is up-to-date...");let r=Date.now();await te(e,void 0,!1,!0,E=>{let G=E.total>0?Math.round(E.current/E.total*100):0;$.info({phase:E.phase,progress:`${E.current}/${E.total}`,percentage:`${G}%`},E.message||`Indexing progress: ${E.phase}`)});let t=((Date.now()-r)/1e3).toFixed(1);$.info({repoPath:e,indexTime:`${t}s`}," Index check complete"),await Ur();let o="";try{let E=Li({repoPath:e,enableAutoRefresh:!0,enableSymbolHealing:!0});E.errors.length>0&&$.warn({repoPath:e,errors:E.errors},"Git hook install had non-fatal errors"),o=`
|
|
1041
|
+
## Git Hooks
|
|
1042
|
+
* Installed: ${E.installed.length}, skipped: ${E.skipped.length}, errors: ${E.errors.length}
|
|
1043
|
+
`}catch(E){$.warn({repoPath:e,error:E instanceof Error?E.message:String(E)},"Git hook installation failed (non-fatal)"),o=`
|
|
1044
|
+
## Git Hooks
|
|
1045
|
+
* Installation failed (non-fatal). Run \`shadow_env_hooks\` manually.
|
|
1046
|
+
`}let s=z.getInstance(e);$.info({repoPath:e},"Populating Project Hologram...");let a=new ce(e),c=He(s,e);a.updateTopography(c);let l=a.computeGravityZones();a.updateGravityZones(l),$.info({repoPath:e,sections:2},"Project Hologram populated (topography + gravity)");let u=s.files.getCount(),p=s.exports.getCount(),d=s.configs.getAll(),m=s.files.getTopDirectories(e),f=[],h=[],v="Standalone",y=E=>s.files.findPackageJsonChildren(E),b=E=>{let G=kt.join(E,"package.json"),Y=d.filter(me=>me.file_path===G),re=[],B=me=>Y.some(Se=>Se.key.startsWith("dep: ")&&Se.key.includes(me));B("react")&&re.push("React"),B("vue")&&re.push("Vue"),B("next")&&re.push("Next.js"),B("fastify")&&re.push("Fastify"),B("express")&&re.push("Express"),B("nestjs")&&re.push("NestJS"),(B("prisma")||B("typeorm"))&&re.push("DB");let X=Y.find(me=>me.key==="description")?.value||"";return{stack:re.join(", "),description:X.length>80?X.substring(0,77)+"...":X}},_=kt.join(e,"apps"),x=kt.join(e,"packages"),k=kt.join(e,"services"),I=s.files.hasFilesPattern(_+"/%"),N=s.files.hasFilesPattern(x+"/%"),L=s.files.hasFilesPattern(k+"/%"),C=(E,G)=>{let Y=y(E);Y.length>0&&(f.push(`| **${G}/ (Directory)** | \uFE0F **DO NOT SUMMARIZE FULL DIR** | |`),Y.forEach(re=>{let B=kt.dirname(re.path),X=kt.basename(B);if(X.startsWith("_")||X.includes("template"))return;let me=kt.relative(e,B),Se=b(B);f.push(`| \u2514\u2500 \`${me}\` | ${Se.stack||"Module"} | ${Se.description} |`),h.push(me)}))};I||N||L?(v="Monorepo",C(_,"apps"),C(k,"services"),C(x,"packages")):m.forEach(E=>{let G=E.root;if(!G||G.startsWith("."))return;let Y=b(kt.join(e,G));f.push(`| \`${G}/\` | ${Y.stack||"Module"} | ${Y.description} |`)});let S=kt.join(e,"package.json"),A=d.find(E=>E.key==="name"&&E.kind==="Service"&&E.file_path===S)?.value||kt.basename(e),H=d.filter(E=>E.kind==="Service"&&(E.key.startsWith("service:")||E.file==="docker-compose.yml")),W=[...new Set(H.map(E=>E.value).filter(E=>E&&typeof E=="string"&&!E.includes("[object Object]")&&!["postgres","redis","db","worker","undefined"].includes(E.toLowerCase())))],O=W.slice(0,5),K=O.length>0?`Service Cluster: ${O.join(", ")}${W.length>5?` (+${W.length-5} others)`:""}`:"",D=u<100?"small":"large",M=D==="small"?"You can safely use `shadow_recon_tree` to view the full tree.":' **AVOID summarizing large directories like `apps/` or `services/` as a whole.**\n Instead, look for a specific component in the map below and use `shadow_recon_tree({ subPath: "apps/my-app" })` on it.\n\uFE0F **Prefer Search:** Use `shadow_search_symbol` for directly finding symbols.',V="";try{let G=new ze(e).detectAndRepairShifts(),Y=new zt(e),re=s.missions.findLastMission();Y.analyzeGhostChanges(re?.commit_sha||void 0),s.intentLogs.countByType("heritage")===0&&new bn(e).analyzeHeritage(20);let X=s.intentLogs.countByType("heritage"),me=s.intentLogs.countByType("discovery");X>0||me>0||G.repaired>0?V=`
|
|
851
1047
|
## Shadow Engine Insights
|
|
852
|
-
`+(
|
|
853
|
-
`:"")+(
|
|
854
|
-
`:"")+(
|
|
855
|
-
`:""):
|
|
1048
|
+
`+(X>0?`* **Architectural Heritage**: Bootstrapped ${X} significant historical moves.
|
|
1049
|
+
`:"")+(me>0?`* **Recent Changes**: Detected ${me} external modifications.
|
|
1050
|
+
`:"")+(G.repaired>0?`* **Symbol Healing**: Automatically repaired ${G.repaired} orphaned intent links.
|
|
1051
|
+
`:""):V=`
|
|
856
1052
|
## Shadow Engine Status: **Active**
|
|
857
1053
|
* **Integrity**: Git River matches Symbol Index.
|
|
858
1054
|
* **Heritage**: Ready to track developer intent.
|
|
859
|
-
`}catch(
|
|
1055
|
+
`}catch(E){V=`
|
|
860
1056
|
## Shadow Engine Status: **Offline**
|
|
861
|
-
* Error: ${
|
|
862
|
-
`}try{let
|
|
1057
|
+
* Error: ${E instanceof Error?E.message:"Unknown"}
|
|
1058
|
+
`}try{let G=new vn(e).runMaintenance();(G.pruning.deleted>0||G.pruning.converted>0)&&(V+=`
|
|
863
1059
|
### Clean Sweep Cycle
|
|
864
|
-
* **Pruned**: ${
|
|
865
|
-
`+(
|
|
866
|
-
`:""))}catch(
|
|
867
|
-
## Active Mission: **${
|
|
1060
|
+
* **Pruned**: ${G.pruning.deleted} orphaned logs deleted, ${G.pruning.converted} converted to lapsed.
|
|
1061
|
+
`+(G.compaction.eligible>0?`* **Compaction**: ${G.compaction.eligible} cold missions eligible for briefing synthesis.
|
|
1062
|
+
`:""))}catch(E){$.warn({error:E},"Metabolism maintenance failed")}let J="";try{let E=s.missions.findActiveByPriority();E?J=`
|
|
1063
|
+
## Active Mission: **${E.name}** (#${E.id})
|
|
868
1064
|
* Use \`shadow_ops_briefing\` to resume context.
|
|
869
|
-
`:
|
|
1065
|
+
`:J=`
|
|
870
1066
|
## Mission Status: **Idle**
|
|
871
1067
|
* No active mission. Use \`shadow_ops_plan\` to begin task tracking.
|
|
872
1068
|
`}catch{}return{content:[{type:"text",text:`
|
|
873
|
-
# Repository Indexed: ${
|
|
1069
|
+
# Repository Indexed: ${A}
|
|
874
1070
|
|
|
875
1071
|
\u23F1\uFE0F **Initial deep index completed in ${t}s** (one-time operation - future syncs are instant)
|
|
876
1072
|
|
|
877
|
-
## \u{1F3D7}\uFE0F Architecture: ${
|
|
878
|
-
${
|
|
1073
|
+
## \u{1F3D7}\uFE0F Architecture: ${v}
|
|
1074
|
+
${K?`> ${K}
|
|
879
1075
|
`:""}
|
|
880
1076
|
|
|
881
|
-
${
|
|
882
|
-
${
|
|
1077
|
+
${V}
|
|
1078
|
+
${o}
|
|
1079
|
+
${J}
|
|
883
1080
|
|
|
884
|
-
This is a ${
|
|
1081
|
+
This is a ${D} repository with ${u} files.
|
|
885
1082
|
|
|
886
1083
|
## System Overview
|
|
887
1084
|
| Statistic | Value |
|
|
888
1085
|
|-----------|-------|
|
|
889
|
-
| Total Files | ${
|
|
890
|
-
| Exported Symbols | ${
|
|
891
|
-
| Primary Stack | ${
|
|
1086
|
+
| Total Files | ${u} |
|
|
1087
|
+
| Exported Symbols | ${p} |
|
|
1088
|
+
| Primary Stack | ${c.primaryStack} |
|
|
892
1089
|
|
|
893
1090
|
## Component Map
|
|
894
1091
|
| Component | Tech Stack | Description |
|
|
895
1092
|
|-----------|------------|-------------|
|
|
896
|
-
${
|
|
1093
|
+
${f.length>20?f.slice(0,20).join(`
|
|
897
1094
|
`)+`
|
|
898
|
-
| ... | ... | (*${
|
|
1095
|
+
| ... | ... | (*${f.length-20} more components hidden*) |`:f.join(`
|
|
899
1096
|
`)}
|
|
900
1097
|
|
|
901
1098
|
## Recommended Exploration Strategy
|
|
902
|
-
${
|
|
1099
|
+
${M}
|
|
903
1100
|
|
|
904
1101
|
## \uFE0F Quick Reference
|
|
905
1102
|
| Goal | Tool | Example |
|
|
@@ -911,15 +1108,15 @@ ${G}
|
|
|
911
1108
|
|
|
912
1109
|
---
|
|
913
1110
|
**Ready.** What would you like to investigate first?
|
|
914
|
-
`}]}}
|
|
915
|
-
`),t=[],o=0;for(let p=0;p<Math.min(i.length,50);p++){let d=i[p].trim();if(d.startsWith("import ")||d.startsWith("from ")||d.startsWith("export ")&&d.includes(" from "))o=p+1;else if(d&&!d.startsWith("//")&&!d.startsWith("/*")&&!d.startsWith("*")&&d!==""&&o>0)break}o>0&&(t.push(...i.slice(0,o)),t.push(""));let s=[...r].sort((p,d)=>p.startLine-d.startLine),a=0,c=0;for(let p of s)if(p.isTarget){t.push(`// \u2501\u2501\u2501 REQUESTED: ${p.name} \u2501\u2501\u2501`);let d=i.slice(p.startLine-1,p.endLine);t.push(...d),t.push("// \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),c++}else{let d=p.signature
|
|
916
|
-
`),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function
|
|
917
|
-
However, it likely exists inside: ${
|
|
918
|
-
Try: shadow_inspect_symbol({ symbolName: "${
|
|
1111
|
+
`}]}}ee();import L_ from"path";import MI from"fs";function jI(n,e,r){let i=n.split(`
|
|
1112
|
+
`),t=[],o=0;for(let p=0;p<Math.min(i.length,50);p++){let d=i[p].trim();if(d.startsWith("import ")||d.startsWith("from ")||d.startsWith("export ")&&d.includes(" from "))o=p+1;else if(d&&!d.startsWith("//")&&!d.startsWith("/*")&&!d.startsWith("*")&&d!==""&&o>0)break}o>0&&(t.push(...i.slice(0,o)),t.push(""));let s=[...r].sort((p,d)=>p.startLine-d.startLine),a=0,c=0;for(let p of s)if(p.isTarget){t.push(`// \u2501\u2501\u2501 REQUESTED: ${p.name} \u2501\u2501\u2501`);let d=i.slice(p.startLine-1,p.endLine);t.push(...d),t.push("// \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),c++}else{let d=p.signature||FI(i,p.startLine-1,p.kind);d&&(t.push(`${d}`),t.push(` /* implementation: ${p.lineCount} lines */`),t.push(""),a++)}let l=s[s.length-1];if(l)for(let p=l.endLine;p<i.length;p++){let d=i[p].trim();if(d==="}"||d==="};"){t.push(i[p]);break}else if(d&&!d.startsWith("//"))break}return{foldedSource:t.join(`
|
|
1113
|
+
`),totalOriginalLines:i.length,foldedToLines:t.length,siblingsShown:c,siblingsFolded:a}}function FI(n,e,r){let i=n[e];if(r.includes("Function")||r.includes("Method")||r.includes("Arrow")){let t="";for(let o=e;o<Math.min(e+5,n.length);o++)if(t+=n[o],t.includes("{")||t.includes("=>")){let s=t.indexOf("{");s>0&&(t=t.substring(0,s).trim());break}return t.trim()}return i}function UI(n,e=","){let r=[],i="",t=0,o=0,s=0,a=0,c=null,l=!1;for(let p of n){if(c){if(i+=p,l){l=!1;continue}if(p==="\\"){l=!0;continue}p===c&&(c=null);continue}if(p==='"'||p==="'"||p==="`"){c=p,i+=p;continue}if(p==="("?t++:p===")"?t=Math.max(0,t-1):p==="{"?o++:p==="}"?o=Math.max(0,o-1):p==="["?s++:p==="]"?s=Math.max(0,s-1):p==="<"?a++:p===">"&&(a=Math.max(0,a-1)),p===e&&t===0&&o===0&&s===0&&a===0){let d=i.trim();d&&r.push(d),i="";continue}i+=p}let u=i.trim();return u&&r.push(u),r}function ZI(n){let e=n.indexOf("(");if(e<0)return null;let r=0;for(let i=e;i<n.length;i++){let t=n[i];if(t==="("&&r++,t===")"&&(r--,r===0))return{start:e,end:i}}return null}function Oa(n,e){let r=0,i=0,t=0,o=0,s=null,a=!1;for(let c=0;c<n.length;c++){let l=n[c];if(s){a?a=!1:l==="\\"?a=!0:l===s&&(s=null);continue}if(l==='"'||l==="'"||l==="`"){s=l;continue}if(l==="("?r++:l===")"?r=Math.max(0,r-1):l==="{"?i++:l==="}"?i=Math.max(0,i-1):l==="["?t++:l==="]"?t=Math.max(0,t-1):l==="<"?o++:l===">"&&(o=Math.max(0,o-1)),l===e&&r===0&&i===0&&t===0&&o===0)return c}return-1}function HI(n){let r=n.trim(),i=!1;r.startsWith("...")&&(i=!0,r=r.slice(3).trim());let t=Oa(r,"="),o=t>=0,s=o?r.slice(0,t).trim():r,a=o?r.slice(t+1).trim():void 0,c=Oa(s,":"),l=(c>=0?s.slice(0,c):s).replace(/^(?:readonly\s+)?(?:public|private|protected)\s+/,"").trim(),u=l.includes("?"),p=l.replace(/\?/g,"").trim(),d=c>=0&&s.slice(c+1).trim()||null;return{name:p||"(anonymous)",type:d,optional:u,rest:i,hasDefault:o,...a?{defaultValue:a}:{}}}function WI(n,e){let r=n.slice(e+1).trim();if(!r)return null;let i=r.indexOf("=>");if(i>=0){let o=r.slice(0,i).trim(),s=Oa(o,":");if(s>=0){let c=o.slice(s+1).trim();if(c)return c}return r.slice(i+2).replace(/\{.*$/,"").trim()||null}let t=Oa(r,":");return t>=0&&r.slice(t+1).replace(/\{.*$/,"").trim()||null}function BI(n){let e=n.trim();if(!e)return[];if(e==="*")return["*"];if(e.startsWith("[")&&e.endsWith("]"))try{let i=JSON.parse(e);if(Array.isArray(i))return i.map(t=>String(t).trim()).filter(Boolean).map(t=>t.replace(/^['"`]|['"`]$/g,""))}catch{}return e.replace(/^\{|\}$/g,"").split(",").map(i=>i.trim()).filter(Boolean).map(i=>i.replace(/^type\s+/,"")).map(i=>i.split(/\s+as\s+/i)[0]?.trim()||i).map(i=>i.replace(/^['"`]|['"`]$/g,""))}function GI(n,e,r){let i=n?.replace(/\s+/g," ").trim()||null,o=i?.match(/\b(public|private|protected)\b/)?.[1]||null,a=(i?.match(/\bfunction\s*\*?\s+([A-Za-z_$][A-Za-z0-9_$]*)/)||i?.match(/\bclass\s+([A-Za-z_$][A-Za-z0-9_$]*)/)||i?.match(/^(?:export\s+)?(?:async\s+)?([A-Za-z_$][A-Za-z0-9_$]*)\s*(?:<[^>]*>)?\s*\(/))?.[1]||e,c=i?ZI(i):null,l=i&&c?i.slice(c.start+1,c.end):"",u=l?UI(l).map(HI):[],p=i&&c?WI(i,c.end):null,d=i?.match(/(?:function\s+[A-Za-z_$][A-Za-z0-9_$]*|[A-Za-z_$][A-Za-z0-9_$]*)\s*(<[^>]+>)\s*\(/);return{raw:n,normalized:i,symbol:a,kind:r,visibility:o,isStatic:/\bstatic\b/.test(i||""),isAsync:/\basync\b/.test(i||""),isGenerator:/function\s*\*/.test(i||"")||/\*\s*[A-Za-z_$][A-Za-z0-9_$]*\s*\(/.test(i||""),isArrowFunction:/=>/.test(i||""),typeParameters:d?.[1]||null,parameters:u,parameterCount:u.length,returnType:p}}function JI(n,e,r=5){let i=new Map;for(let s of n){let a=i.get(s.file_path)||{classification:s.classification||null,importedSymbols:new Set,wildcard:!1},c=BI(s.imported_symbols);(c.length===0||c.includes("*"))&&(a.wildcard=!0);for(let l of c)a.importedSymbols.add(l);!a.classification&&s.classification&&(a.classification=s.classification),i.set(s.file_path,a)}let t=Array.from(i.entries()).map(([s,a])=>({file:L_.relative(e,s),classification:a.classification,importedSymbols:a.importedSymbols.size>0?Array.from(a.importedSymbols).sort():["*"],wildcard:a.wildcard})),o=t.slice(0,Math.max(1,r));return{totalVerifiedCallers:t.length,showing:o.length,wildcardCallers:t.filter(s=>s.wildcard).length,topCallers:o.map(({wildcard:s,...a})=>a)}}async function bf(n){let{repoPath:e,filePath:r,resolver:i}=Re(n),t=String(n.symbolName),o=n.context||"definition";if(r&&!i.isWithinRoot(r))return{content:[{type:"text",text:`Error: Access denied. Path ${r} is outside the repository root.`}],isError:!0};await te(e);let s=z.getInstance(e),a=[];if(t.includes(".")){let[S,R]=t.split(".");a=s.exports.findMemberCandidates(S,R,r)}else a=s.exports.findDefinitionCandidates(t,r);if(a.length===0){let S=s.exports.findPotentialParents(t);if(S.length>0){let W=S.map(O=>`\`${O.name}\` (in ${i.getRelative(O.file_path)})`).join(", ");return{content:[{type:"text",text:`Symbol "${t}" not found as a top-level export.
|
|
1114
|
+
However, it likely exists inside: ${W}.
|
|
1115
|
+
Try: shadow_inspect_symbol({ symbolName: "${S[0].name}", context: "full" }) to see the class body.`}]}}let A=s.exports.findFuzzyCandidates(t).map(W=>W.name),H=Bn(t,A,50,3);if(H.length>0){let W=H.map(O=>` \u2022 \`${O.match}\` (${O.score}% match)`).join(`
|
|
919
1116
|
`);return{content:[{type:"text",text:`Error: Symbol "${t}" not found in the index.
|
|
920
1117
|
|
|
921
1118
|
Suggestions:
|
|
922
|
-
${
|
|
1119
|
+
${W}
|
|
923
1120
|
|
|
924
1121
|
Next steps:
|
|
925
1122
|
\u2022 Search semantically: shadow_search_concept({ query: "${t}" })
|
|
@@ -928,8 +1125,8 @@ Next steps:
|
|
|
928
1125
|
Next steps:
|
|
929
1126
|
\u2022 Search for it: shadow_search_concept({ query: "${t}" })
|
|
930
1127
|
\u2022 Try with file path: shadow_inspect_symbol({ symbolName: "${t}", filePath: "..." })
|
|
931
|
-
`}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let
|
|
932
|
-
`),p=c.end_line-c.start_line+1,d=150,m,f=!1,h=null;if(o==="definition"&&p>d){let
|
|
1128
|
+
`}]}}let c=a[0];if(c.kind==="ExportSpecifier"||c.kind==="ExportAllDeclaration"){let S=s.imports.findImportSource(c.file_path,t);if(S&&S.resolved_path)return bf({...n,filePath:S.resolved_path})}let l=MI.readFileSync(c.file_path,"utf8"),u=l.split(`
|
|
1129
|
+
`),p=c.end_line-c.start_line+1,d=150,m,f=!1,h=null;if(o==="definition"&&p>d){let R=s.exports.findSiblings(c.file_path).map(A=>({name:A.name,kind:A.kind,signature:A.signature||"",startLine:A.start_line,endLine:A.end_line,lineCount:A.end_line-A.start_line+1,isTarget:A.name===c.name&&A.start_line===c.start_line,parentName:A.parent_name}));if(R.length>1){h=jI(l,{name:c.name,startLine:c.start_line,endLine:c.end_line},R);let A=i.getRelative(c.file_path);m=h.foldedSource+`
|
|
933
1130
|
|
|
934
1131
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
935
1132
|
\u{1F4CA} Semantic Fold Applied (context: "definition")
|
|
@@ -939,69 +1136,43 @@ Next steps:
|
|
|
939
1136
|
Target Symbol: ${c.name}
|
|
940
1137
|
\u{1F4A1} Need more context?
|
|
941
1138
|
\u2022 Full symbol + dependencies + usage: shadow_inspect_symbol({ symbolName: "${c.name}", context: "full" })
|
|
942
|
-
\u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${
|
|
1139
|
+
\u2022 ALL symbols in this file: shadow_inspect_file({ filePath: "${A}", detailLevel: "signatures" })
|
|
943
1140
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501`,f=!0}else m=u.slice(c.start_line-1,c.start_line-1+d).join(`
|
|
944
1141
|
`)+`
|
|
945
1142
|
|
|
946
1143
|
... (truncated ${p-d} lines)`,f=!0}else m=u.slice(c.start_line-1,c.end_line).join(`
|
|
947
|
-
`);let
|
|
1144
|
+
`);let v=c.parent_name?`${c.parent_name}.${c.name}`:c.name,y=s.exports.findHydratedById(c.id),b=c.parent_name||c.name,_=s.imports.findProxies(c.file_path).map(S=>S.file_path),x=Array.from(new Set([c.file_path,..._])),k=s.imports.findVerifiedDependents(x,b),I=JI(k,e),N=GI(c.signature,v,c.kind),L={name:v,kind:c.kind,signature:N,file:i.getRelative(c.file_path),startLine:c.start_line,endLine:c.end_line,totalLines:p,...f&&{truncated:!0,previewLines:d},classification:c.classification,callerSummary:I,source:m};if(y&&y.recent_intents&&y.recent_intents.length>0){let S={},R=Date.now();for(let A of y.recent_intents){if(A.is_crystallized&&A.type!=="crystal")continue;let H=A.created_at;H<1e10&&(H*=1e3);let W=new Date(H).getTime(),O=R-W,K="just now";if(O>0){let D=Math.floor(O/1e3),M=Math.floor(D/60),V=Math.floor(M/60),J=Math.floor(V/24);J>0?K=`${J}d ago`:V>0?K=`${V}h ago`:M>0?K=`${M}m ago`:K=`${D}s ago`}S[A.type]||(S[A.type]=[]),S[A.type].push(`[${K}] ${A.content}`)}L.intelligence={working_set_of:y.active_missions.map(A=>`Mission #${A.id}: ${A.name}`),total_intents:y.intent_log_count,recent_activity:S}}else y&&(L.intelligence={working_set_of:y.active_missions.map(S=>`Mission #${S.id}: ${S.name}`),total_intents:y.intent_log_count,recent_activity:null});try{let{generateEmbedding:S}=await Promise.resolve().then(()=>(Oe(),gt)),R=`Symbol: ${L.name}
|
|
948
1145
|
Signature: ${c.signature||""}
|
|
949
|
-
File: ${
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
\
|
|
956
|
-
|
|
957
|
-
\
|
|
958
|
-
\u269B\uFE0F Hologram: Refreshed architectural map (${
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
nohup npx @precisionutilityguild/liquid-shadow sync "$REPO_PATH" > /dev/null 2>&1 &
|
|
966
|
-
|
|
967
|
-
exit 0
|
|
968
|
-
`,"post-checkout":`#!/bin/sh
|
|
969
|
-
# Liquid Shadow: Auto-refresh index after branch checkout
|
|
970
|
-
# Generated by liquid-shadow
|
|
971
|
-
|
|
972
|
-
# Only run on branch checkouts, not file checkouts
|
|
973
|
-
# $3 is 1 for branch checkout, 0 for file checkout
|
|
974
|
-
if [ "$3" = "1" ]; then
|
|
975
|
-
REPO_PATH="$(git rev-parse --show-toplevel)"
|
|
976
|
-
|
|
977
|
-
# Run liquid-shadow sync in background
|
|
978
|
-
nohup npx @precisionutilityguild/liquid-shadow sync "$REPO_PATH" > /dev/null 2>&1 &
|
|
979
|
-
fi
|
|
980
|
-
|
|
981
|
-
exit 0
|
|
982
|
-
`,"post-commit":`#!/bin/sh
|
|
983
|
-
# Liquid Shadow: Trigger symbol shift detection after commit
|
|
984
|
-
# Generated by liquid-shadow
|
|
985
|
-
|
|
986
|
-
REPO_PATH="$(git rev-parse --show-toplevel)"
|
|
987
|
-
|
|
988
|
-
# Run liquid-shadow sync in background
|
|
989
|
-
nohup npx @precisionutilityguild/liquid-shadow sync "$REPO_PATH" > /dev/null 2>&1 &
|
|
990
|
-
|
|
991
|
-
exit 0
|
|
992
|
-
`};function Rm(n){let{repoPath:e,enableAutoRefresh:r=!0,enableSymbolHealing:i=!0}=n,t=gn.join(e,".git","hooks"),o=[],s=[],a=[];if(!ze.existsSync(gn.join(e,".git")))return a.push("Not a git repository"),{installed:o,skipped:s,errors:a};ze.existsSync(t)||ze.mkdirSync(t,{recursive:!0});let c=[];r&&c.push("post-merge","post-checkout"),i&&c.push("post-commit");for(let l of c){let u=gn.join(t,l),p=ia[l];if(!p){a.push(`No template found for hook: ${l}`);continue}try{if(ze.existsSync(u)){let d=ze.readFileSync(u,"utf-8");if(d.includes("liquid-shadow")||d.includes("mcp-liquid-shadow")){s.push(l),ur.info({hookName:l},"Hook already installed, skipping");continue}let m=`${u}.backup-${Date.now()}`;ze.copyFileSync(u,m),ur.info({hookName:l,backupPath:m},"Backed up existing hook")}ze.writeFileSync(u,p,{mode:493}),o.push(l),ur.info({hookName:l},"Installed git hook")}catch(d){a.push(`Failed to install ${l}: ${d}`),ur.error({hookName:l,err:d},"Failed to install hook")}}return{installed:o,skipped:s,errors:a}}function Nm(n){let e=gn.join(n,".git","hooks"),r=[],i=[];if(!ze.existsSync(e))return{removed:r,errors:i};let t=Object.keys(ia);for(let o of t){let s=gn.join(e,o);try{if(ze.existsSync(s)){let a=ze.readFileSync(s,"utf-8");(a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow"))&&(ze.unlinkSync(s),r.push(o),ur.info({hookName:o},"Removed git hook"))}}catch(a){i.push(`Failed to remove ${o}: ${a}`),ur.error({hookName:o,err:a},"Failed to remove hook")}}return{removed:r,errors:i}}function mi(n){let e=gn.join(n,".git","hooks"),r=[],i=[];if(!ze.existsSync(e))return{installed:r,notInstalled:Object.keys(ia)};let t=Object.keys(ia);for(let o of t){let s=gn.join(e,o);if(ze.existsSync(s)){let a=ze.readFileSync(s,"utf-8");a.includes("liquid-shadow")||a.includes("mcp-liquid-shadow")?r.push(o):i.push(o)}else i.push(o)}return{installed:r,notInstalled:i}}J();var zm=b.child({module:"mcp:tools:env:hooks"});async function g_(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){zm.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=Rm({repoPath:e,enableAutoRefresh:i??!0,enableSymbolHealing:t??!0}),s=["# Git Hooks Installation","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
|
|
1146
|
+
File: ${L.file}`,A=await S(R);if(A){let H=s.intentLogs.findSemanticMatches(A,3,c.id),W=new Promise(K=>setTimeout(()=>K([]),100)),O=await Promise.race([H,W]);O&&O.length>0&&(L.intelligence||(L.intelligence={}),L.intelligence.related_knowledge=O.map(K=>({type:K.type,content:K.content,from_symbol:K.symbol_name,similarity:`${(K.similarity*100).toFixed(0)}%`})))}}catch{}if(o==="definition")return{content:[{type:"text",text:JSON.stringify(L,null,2)}]};let C={definition:L,dependencies:s.imports.getImportsForFile(c.file_path).map(S=>({module:S.module_specifier,symbols:S.imported_symbols,relativePath:S.resolved_path?L_.relative(e,S.resolved_path):null})),callerSummary:I};return C.verifiedUsages=I.topCallers,{content:[{type:"text",text:JSON.stringify(C,null,2)}]}}ee();yt();import VI from"fs";import O_ from"path";var qI=new Set(["ClassDeclaration","FunctionDeclaration","TsInterfaceDeclaration","TsTypeAliasDeclaration","TsEnumDeclaration","VariableDeclaration"]);function M_(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vf(n,e,r){let i=r.trim();return!!(!i||i.length>8e3||/^\w{1,4}\s+['"].*['"];?$/.test(i)&&!i.startsWith("export ")||i.includes(`
|
|
1147
|
+
import `)&&!i.startsWith("import ")||e&&qI.has(e)&&n&&!new RegExp(`\\b${M_(n)}\\b`).test(i))}function KI(n,e){let r=Math.max(0,(n.start_line||1)-1),i=Math.min(e.length,Math.max(r+1,(n.end_line||n.start_line||1)+1,r+120)),t=e.slice(r,i).join(`
|
|
1148
|
+
`),o=Ke(t,n.kind);return o?o.length>800?`${o.slice(0,797)}...`:o:n.signature||""}function YI(n,e,r){if(!n)return null;let i=M_(n),t=[];e==="TsTypeAliasDeclaration"&&t.push(new RegExp(`^\\s*export\\s+type\\s+${i}\\b`)),e==="TsInterfaceDeclaration"&&t.push(new RegExp(`^\\s*export\\s+interface\\s+${i}\\b`)),e==="FunctionDeclaration"&&t.push(new RegExp(`^\\s*(?:export\\s+)?(?:async\\s+)?function\\s+${i}\\b`)),e==="ClassDeclaration"&&t.push(new RegExp(`^\\s*(?:export\\s+)?(?:abstract\\s+)?class\\s+${i}\\b`)),e==="VariableDeclaration"&&t.push(new RegExp(`^\\s*(?:export\\s+)?(?:const|let|var)\\s+${i}\\b`)),t.push(new RegExp(`\\b${i}\\b`));for(let o of t)for(let s=0;s<r.length;s++)if(o.test(r[s]))return s+1;return null}function XI(n,e,r){let i=Math.max(0,n-1);if(e==="TsTypeAliasDeclaration"||e==="VariableDeclaration"||e==="TsEnumDeclaration"){for(let t=i;t<r.length;t++){if(r[t].includes(";"))return t+1;if(/^\s*export\s+(type|interface|class|function|const|let|var)\b/.test(r[t])&&t>i)return t}return Math.min(r.length,n+20)}if(e==="TsInterfaceDeclaration"||e==="ClassDeclaration"||e==="FunctionDeclaration"){let t=0,o=!1;for(let s=i;s<r.length;s++){let a=r[s];for(let c of a)c==="{"?(t+=1,o=!0):c==="}"&&(t-=1);if(o&&t<=0)return s+1}return Math.min(r.length,n+120)}return Math.min(r.length,n+40)}function QI(n){return Array.isArray(n)?n.filter(e=>e.module!=="__type_reference__"):n}function eT(n,e){return n?e==="TsTypeAliasDeclaration"?`type ${n}`:e==="TsInterfaceDeclaration"?`interface ${n}`:e==="FunctionDeclaration"?`function ${n}()`:e==="ClassDeclaration"?`class ${n}`:e==="VariableDeclaration"?`const ${n}`:`${e||"symbol"} ${n}`:e||"symbol"}function tT(n,e){if(!n||e!=="TsTypeAliasDeclaration"&&e!=="TsInterfaceDeclaration")return n;let r=n.indexOf(`
|
|
1149
|
+
export `);return r<=0?n:n.slice(0,r).trim()}async function j_(n){let{repoPath:e,filePath:r}=Re(n);if(!r)return{content:[{type:"text",text:"Error: filePath is required"}],isError:!0};let i=n.detailLevel||"signatures";await te(e);let{files:t,exports:o}=z.getInstance(e),s=t.findByPath(r),a=O_.basename(r),c=/\.(ts|tsx|php|py|go)$/.test(a),l;c?l=await On(r):l={exports:o.findByFile(r),imports:[]};let u=null;if(c)try{u=VI.readFileSync(r,"utf8").split(`
|
|
1150
|
+
`)}catch{u=null}Array.isArray(l.exports)&&u&&(l.exports=l.exports.map(f=>{let h=typeof f.signature=="string"?f.signature:"",v=f.start_line??f.line??1,y=f.end_line??f.endLine??v;if(vf(f.name||"",f.kind,h)){let _=YI(f.name||"",f.kind,u),x=_??v,k=_?XI(x,f.kind,u):y,I=KI({name:f.name||"",kind:f.kind,signature:h,start_line:x,end_line:k},u),N=tT(I,f.kind),L=vf(f.name||"",f.kind,N)?eT(f.name||"",f.kind):N;return{...f,signature:L,start_line:x,end_line:k,line:x,endLine:k,members:Array.isArray(f.members)?f.members.filter(C=>{let S=typeof C.signature=="string"?C.signature:"";return!vf(C.name||"",C.kind,S)}):f.members}}return f})),l.imports=QI(l.imports),i==="structure"?(l.exports=l.exports.map(f=>{let h={name:f.name,kind:f.kind,line:f.start_line,classification:f.classification};return f.members&&f.members.length>0?{...h,members:f.members.map(v=>({name:`${f.name}.${v.name}`,kind:v.kind,line:v.start_line}))}:h}),delete l.imports):i==="signatures"&&(l.exports=l.exports.map(f=>{let h={name:f.name,kind:f.kind,signature:f.signature,line:f.start_line,classification:f.classification,capabilities:JSON.parse(f.capabilities||"[]")};return f.members&&f.members.length>0?{...h,members:f.members.map(v=>({name:`${f.name}.${v.name}`,kind:v.kind,signature:v.signature,line:v.start_line}))}:h}),delete l.imports);let p=O_.relative(e,r),d=l.exports?.length||0,m="";return i==="structure"&&d>0?m=`
|
|
1151
|
+
|
|
1152
|
+
\u{1F4A1} Showing ${d} symbol names. For full signatures: shadow_inspect_file({ filePath: "${p}", detailLevel: "signatures" })`:i==="signatures"&&d>0&&(m=`
|
|
1153
|
+
|
|
1154
|
+
\u{1F4A1} Showing ${d} complete signatures. To inspect a specific symbol: shadow_inspect_symbol({ symbolName: "...", context: "full" })`),{content:[{type:"text",text:JSON.stringify({...l,fileDescription:s?.summary||"",classification:s?.classification&&s.classification!=="Unknown"?s.classification:Bt(r,z.getInstance(e)).layer},null,2)+m}]}}ee();yt();async function F_(n){let{repoPath:e,enableContextPivot:r,enableMergeSentinel:i}=n;try{await te(e),new zt(e).analyzeGhostChanges();let o=new ze(e),s=o.detectAndRepairShifts(),a=o.syncLifecycle({enableContextPivot:r,enableMergeSentinel:i}),l=await new et(e).recoverFromGitNotes(),{HologramService:u}=await Promise.resolve().then(()=>(We(),$g)),p=new u(e),d=He(z.getInstance(e),e);p.updateTopography(d);let m=p.computeGravityZones();p.updateGravityZones(m);let f="Shadow Sync complete. Code changes indexed and intent logs updated.";return f+=`
|
|
1155
|
+
\u269B\uFE0F Hologram: Refreshed architectural map (${m.length} hotspots).`,s.repaired>0&&(f+=`
|
|
1156
|
+
\u2728 Nano-Repair: Fixed ${s.repaired} links.`),f+=`
|
|
1157
|
+
\u{1F9ED} Lifecycle: contextPivot=${a.contextPivotEnabled?"on":"off"}, mergeSentinel=${a.mergeSentinelEnabled?"on":"off"}, suspended=${a.suspended}, resumed=${a.resumed}, completed=${a.completed}.`,l.missionsRecovered>0&&(f+=`
|
|
1158
|
+
\u{1F9EC} Re-hydration: Recovered ${l.missionsRecovered} missions.`),{content:[{type:"text",text:f}]}}catch(t){return{content:[{type:"text",text:`Error: ${t.message}`}],isError:!0}}}We();async function U_(n){let{repoPath:e,deep:r,enableContextPivot:i,enableMergeSentinel:t}=n;try{let o=r===!0;await te(e,5,o,o);let s=new ze(e),a=s.detectAndRepairShifts(),c=s.syncLifecycle({enableContextPivot:i,enableMergeSentinel:t}),l=new ce(e);l.refreshTopography();let u=l.computeGravityZones();l.updateGravityZones(u);let p=`Repository at ${e} has been ${r?"deeply ":""}re-indexed.`;return a.repaired>0&&(p+=`
|
|
1159
|
+
\u2728 Nano-Repair: Fixed ${a.repaired} links.`),p+=`
|
|
1160
|
+
\u{1F9ED} Lifecycle: contextPivot=${c.contextPivotEnabled?"on":"off"}, mergeSentinel=${c.mergeSentinelEnabled?"on":"off"}, suspended=${c.suspended}, resumed=${c.resumed}, completed=${c.completed}.`,p+=`
|
|
1161
|
+
\u269B\uFE0F Hologram: Refreshed architectural map (${u.length} hotspots).`,{content:[{type:"text",text:p}]}}catch(o){return{content:[{type:"text",text:`Error: ${o.message}`}],isError:!0}}}async function Z_(n){let{repoPath:e}=n;try{let i=new ze(e).detectAndRepairShifts();return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}catch(r){return{content:[{type:"text",text:`Error tracing shifts: ${r.message}`}],isError:!0}}}Q();var _f=$.child({module:"mcp:tools:env:hooks"});async function H_(n){let{repoPath:e,action:r,enableAutoRefresh:i,enableSymbolHealing:t}=n;if(r==="install"){_f.info({repoPath:e,enableAutoRefresh:i,enableSymbolHealing:t},"Installing git hooks");let o=Li({repoPath:e,enableAutoRefresh:i??!0,enableSymbolHealing:t??!0}),s=["# Git Hooks Installation","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(a=>`- \`${a}\``).join(`
|
|
993
1162
|
`):"- None","",`## \u23ED\uFE0F Skipped (${o.skipped.length})`,o.skipped.length>0?o.skipped.map(a=>`- \`${a}\` (already installed)`).join(`
|
|
994
1163
|
`):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
|
|
995
1164
|
`)),s.push("")),s.push("---"),s.push("**What happens now?**"),(i??!0)&&s.push("- After `git pull` or `git checkout`: Index auto-refreshes in background"),(t??!0)&&s.push("- After `git commit`: Symbol shift detection runs automatically"),{content:[{type:"text",text:s.join(`
|
|
996
|
-
`)}]}}if(r==="remove"){
|
|
1165
|
+
`)}]}}if(r==="remove"){_f.info({repoPath:e},"Uninstalling git hooks");let o=yf(e),s=["# Git Hooks Uninstallation","",`## Removed (${o.removed.length})`,o.removed.length>0?o.removed.map(a=>`- \`${a}\``).join(`
|
|
997
1166
|
`):"- None",""];return o.errors.length>0&&(s.push(`## Errors (${o.errors.length})`),s.push(o.errors.map(a=>`- ${a}`).join(`
|
|
998
1167
|
`))),{content:[{type:"text",text:s.join(`
|
|
999
|
-
`)}]}}if(r==="status"){
|
|
1000
|
-
`):"- None","",`##
|
|
1001
|
-
`):"- None",""
|
|
1002
|
-
`)
|
|
1003
|
-
`)}]}}X();J();import wk from"path";import Ek from"fs";var __=b.child({module:"mcp:tools:workspace:list"});async function b_(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;__.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(Ek.existsSync(a))try{let{missions:c}=L.getInstance(a),l=c.findAll(r);for(let u of l){let p=c.getLinks(u.id);o.push({...u,repo_path:a,repo_name:wk.basename(a),cross_repo_links:p})}}catch(c){__.error({error:c,repoPath:a},"Failed to query repo missions")}if(o.sort((a,c)=>{let l=d=>d==="in-progress"?0:d==="verifying"?1:2,u=l(a.status),p=l(c.status);return u!==p?u-p:(a.created_at||0)-(c.created_at||0)}),t||o.length>50&&!i){let a=i||20,c=o.slice(0,a),l=o.reduce((p,d)=>(p[d.status]=(p[d.status]||0)+1,p),{}),u=o.reduce((p,d)=>(p[d.repo_name]=(p[d.repo_name]||0)+1,p),{});return{content:[{type:"text",text:JSON.stringify({summary:{total_missions:o.length,by_status:l,by_repo:u,showing_top:a},top_missions:c,hint:`Showing top ${a} of ${o.length} missions. Use limit to adjust or summarize:false for full list.`},null,2)}]}}let s=i?o.slice(0,i):o;return{content:[{type:"text",text:JSON.stringify({total_missions:o.length,showing:s.length,missions:s},null,2)}]}}X();J();var Ik=b.child({module:"mcp:tools:workspace:link"});async function x_(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;Ik.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=L.getInstance(e),{missions:a}=L.getInstance(i);try{let c=s.findById(r),l=a.findById(t);if(!c)throw new Error(`Parent mission ${r} not found`);if(!l)throw new Error(`Child mission ${t} not found`);return s.createLink(r,i,t,o,"parent"),a.createLink(t,e,r,o,"child"),{content:[{type:"text",text:JSON.stringify({status:"linked",relationship:o},null,2)}]}}catch(c){throw new Error(`Failed to link: ${c.message}`)}}J();var Tk=b.child({module:"mcp:tools:workspace:fuse"});async function S_(n){let{repoPaths:e,name:r}=n;Tk.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=bc({repoPaths:e,name:r||`workspace-${Date.now()}`});return{content:[{type:"text",text:JSON.stringify({message:"Fused index created",status:i.getStatus()},null,2)}]}}catch(i){throw new Error(`Failed to fuse: ${i.message}`)}}var sa=g.object({repoPath:g.string(),name:g.string().optional(),goal:g.string().optional(),strategy:g.string().optional(),missionId:g.number().optional(),parentId:g.number().optional(),outcomeContract:g.string().optional(),templateId:g.string().optional(),templateVars:g.record(g.string(),g.string()).optional()}),aa=g.object({repoPath:g.string(),missionId:g.number(),stepId:g.string().optional(),status:g.enum(["pending","in-progress","completed","failed","skipped"]).optional(),contextPivot:g.string().optional(),updates:g.array(g.object({stepId:g.string(),status:g.enum(["pending","in-progress","completed","failed","skipped"]),contextPivot:g.string().optional()})).optional(),artifacts:g.array(g.object({type:g.string(),identifier:g.string(),metadata:g.record(g.string(),g.any()).optional()})).optional()}),ca=g.object({repoPath:g.string(),missionId:g.number().optional(),scope:g.enum(["mission","project"]).optional(),altitude:g.enum(["orbit","atmosphere","ground"]).optional(),activeMissionsLimit:g.number().int().positive().optional(),recentActivityLimit:g.number().int().positive().optional(),compact:g.boolean().optional()}),la=g.object({repoPath:g.string(),missionId:g.number().optional(),type:g.enum(["decision","blocker","discovery","fix"]),content:g.string(),filePath:g.string().optional(),symbolName:g.string().optional(),standalone:g.boolean().optional()}),ua=g.object({repoPath:g.string(),missionId:g.number()}),pa=g.object({repoPath:g.string(),format:g.enum(["markdown","json"]).optional(),limit:g.number().optional(),offset:g.number().optional(),since:g.number().optional(),until:g.number().optional()}),da=g.object({repoPath:g.string()}),ma=g.object({repoPath:g.string(),compact:g.boolean().optional()}),fa=g.object({repoPath:g.string(),missionId:g.number().optional(),symbolId:g.number().optional()}),ha=g.object({repoPath:g.string(),missionId:g.number().optional(),depth:g.number().optional(),limit:g.number().optional(),format:g.enum(["mermaid","json"]).optional()}),$_=g.object({repoPath:g.string(),filePaths:g.array(g.string())}),ga=g.object({repoPath:g.string(),subPath:g.string().optional(),maxDepth:g.number().int().optional()}),ya=g.object({repoPath:g.string(),compact:g.boolean().optional()}),va=g.object({repoPath:g.string()}),_a=g.object({repoPath:g.string()}),ba=g.object({repoPath:g.string()}),xa=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),compact:g.boolean().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),Sa=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),matchMode:g.enum(["any","all","exact"]).optional()}),$a=g.object({repoPath:g.string(),query:g.string().optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().optional(),showUsage:g.boolean().optional()}),ka=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),ranked:g.boolean().optional()}),wa=g.object({repoPath:g.string(),filePath:g.string().optional(),symbolName:g.string(),depth:g.number().int().optional(),limit:g.number().int().positive().optional(),offset:g.number().int().nonnegative().optional()}),Ea=g.object({repoPath:g.string(),filePath:g.string(),symbolName:g.string().optional()}),Ia=g.object({repoPath:g.string(),filePath:g.string(),direction:g.enum(["imports","imported_by"]),limit:g.number().int().positive().optional(),offset:g.number().int().nonnegative().optional()}),Ta=g.object({repoPath:g.string(),mode:g.enum(["dead-code","circular-deps"]),limit:g.number().int().optional(),excludePatterns:g.array(g.string()).optional(),includeMigrations:g.boolean().optional(),includeFixtures:g.boolean().optional(),confidenceThreshold:g.enum(["all","high","medium"]).optional()}),Pa=g.object({repoPath:g.string(),symbolName:g.string(),filePath:g.string().optional(),context:g.enum(["definition","full"]).optional()}),Ra=g.object({repoPath:g.string(),filePath:g.string(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional()}),Na=g.object({repoPath:g.string()}),za=g.object({repoPath:g.string(),deep:g.boolean().optional()}),Da=g.object({repoPath:g.string()}),Oa=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),Aa=g.object({repoPath:g.string()}),La=g.object({repoPaths:g.array(g.string()),status:g.string().optional(),limit:g.number().int().positive().optional(),summarize:g.boolean().optional()}),Ca=g.object({parentRepoPath:g.string(),parentMissionId:g.number(),childRepoPath:g.string(),childMissionId:g.number(),relationship:g.string()}),ja=g.object({repoPaths:g.array(g.string()),name:g.string().optional()});J();var Pk=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function Ma(n,e){if(!(!n||typeof n!="object"))for(let r in n)typeof n[r]=="string"?["filePath","subPath","path","repoPath","parentRepoPath","childRepoPath"].includes(r)&&(n[r]=e.resolve(n[r])):Array.isArray(n[r])?n[r].forEach(i=>Ma(i,e)):typeof n[r]=="object"&&Ma(n[r],e)}function k_(n){if(!(!n||typeof n!="object")){for(let e of Pk)if(typeof n[e]=="string")try{n[e]=fn(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?fn(e):e))}}function w_(n,e){return async r=>{let i=b.child({handler:n});try{k_(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),Jt("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new cr(r.repoPath);Ma(r,o)}i.info({args:r},"Handling tool call");let t=await e(r);return i.debug("Tool call successful"),t}catch(t){i.error({err:t},"Error in tool handler");let o=t.message?.includes("Access denied"),s=`Handler '${n}' failed: ${t.message}`;return!o&&r?.repoPath&&(s+=li),Jt(o?"FORBIDDEN":"INTERNAL_ERROR",s,{stack:t.stack})}}}function E_(n,e,r){return async i=>{let t=b.child({handler:n});try{k_(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),Jt("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new cr(i.repoPath);Ma(i,s)}t.info({args:i},"Handling tool call with validation");let o=e.safeParse(i);if(!o.success){let s=o.error.issues.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`).join(", ");return t.warn({validationIssues:o.error.issues},"Validation failed"),Jt("VALIDATION_ERROR",`Validation error: ${s}`,{issues:o.error.issues})}try{let s=await r(o.data);return t.debug("Tool call successful"),s}catch(s){t.error({err:s},"Error in tool handler");let a=s.message?.includes("Access denied"),c=`Handler '${n}' failed: ${s.message}`,l=o.data;return!a&&l?.repoPath&&(c+=li),Jt(a?"FORBIDDEN":"INTERNAL_ERROR",c,{stack:s.stack})}}}function pr(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=Wv(i,e);return t||n(r)}}var Rk={shadow_ops_plan:{default:Sv},shadow_ops_track:{default:Ev},shadow_ops_briefing:{default:ea},shadow_ops_log:{default:Av},shadow_ops_synthesize:{default:Pv},shadow_ops_chronicle:{default:Nv},shadow_ops_context:{default:pr(zv,"shadow_ops_context")},shadow_ops_health:{default:Ov},shadow_ops_graph:{default:Mv},shadow_ops_crystallize:{default:Fv},shadow_working_set_check:{default:pr(Zv,"shadow_working_set_check")},shadow_recon_tree:{default:i_},shadow_recon_hologram:{default:o_},shadow_recon_topography:{default:a_},shadow_recon_scout:{default:c_},shadow_recon_onboard:{default:l_},shadow_search_concept:{default:Bv},shadow_search_symbol:{default:Jv},shadow_search_config:{default:Vv},shadow_search_path:{default:qv},shadow_analyze_impact:{default:Kv},shadow_analyze_flow:{default:Xv},shadow_analyze_deps:{default:t_},shadow_analyze_debt:{default:r_},shadow_inspect_symbol:{default:pr(Pm,"shadow_inspect_symbol")},shadow_inspect_file:{default:pr(d_,"shadow_inspect_file")},shadow_sync_trace:{default:pr(m_,"shadow_sync_trace")},shadow_sync_index:{default:f_},shadow_sync_repair:{default:pr(h_,"shadow_sync_repair")},shadow_env_hooks:{default:g_},shadow_env_diagnose:{default:v_},shadow_workspace_list:{default:b_},shadow_workspace_link:{default:x_},shadow_workspace_fuse:{default:S_}},Nk={shadow_ops_plan:sa,shadow_ops_track:aa,shadow_ops_briefing:ca,shadow_ops_log:la,shadow_ops_synthesize:ua,shadow_ops_chronicle:pa,shadow_ops_context:ma,shadow_ops_health:da,shadow_ops_graph:ha,shadow_ops_crystallize:fa,shadow_working_set_check:$_,shadow_recon_tree:ga,shadow_recon_hologram:ya,shadow_recon_topography:va,shadow_recon_scout:_a,shadow_recon_onboard:ba,shadow_search_concept:xa,shadow_search_symbol:Sa,shadow_search_config:$a,shadow_search_path:ka,shadow_analyze_impact:wa,shadow_analyze_flow:Ea,shadow_analyze_deps:Ia,shadow_analyze_debt:Ta,shadow_inspect_symbol:Pa,shadow_inspect_file:Ra,shadow_sync_trace:Na,shadow_sync_index:za,shadow_sync_repair:Da,shadow_env_hooks:Oa,shadow_env_diagnose:Aa,shadow_workspace_list:La,shadow_workspace_link:Ca,shadow_workspace_fuse:ja},Dm=new Map;for(let[n,e]of Object.entries(Rk)){let r=Nk[n];r?Dm.set(n,E_(n,r,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t){let s=Object.keys(e);return{content:[{type:"text",text:`Missing required parameter "mode" or "action" for tool ${n}.
|
|
1168
|
+
`)}]}}if(r==="status"){_f.info({repoPath:e},"Checking git hooks status");let o=Oi(e),s=o.statuses["post-checkout"];return{content:[{type:"text",text:["# Git Hooks Status","",`## Installed (${o.installed.length})`,o.installed.length>0?o.installed.map(c=>`- \`${c}\``).join(`
|
|
1169
|
+
`):"- None","",`## Missing (${o.missing.length})`,o.missing.length>0?o.missing.map(c=>`- \`${c}\``).join(`
|
|
1170
|
+
`):"- None","",`## Foreign (${o.foreign.length})`,o.foreign.length>0?o.foreign.map(c=>`- \`${c}\` (non-Liquid hook content)`).join(`
|
|
1171
|
+
`):"- None","",`## Disabled (${o.disabled.length})`,o.disabled.length>0?o.disabled.map(c=>`- \`${c}\` (not executable)`).join(`
|
|
1172
|
+
`):"- None","","---",`**Post-checkout status**: \`${s}\``,s==="installed"?"**Branch-switch delta reindex**: active":"**Branch-switch delta reindex**: inactive",'**To install hooks**: Use `shadow_env_hooks({ action: "install" })`'].join(`
|
|
1173
|
+
`)}]}}return{content:[{type:"text",text:`Unknown action: ${r}`}],isError:!0}}ft();import Ma from"path";import W_ from"fs";Q();var nT=$.child({module:"mcp:tools:env:diagnose"});async function B_(n){let{repoPath:e}=n,r=Ma.isAbsolute(e)?Ma.normalize(e):Ma.resolve(process.cwd(),e);nT.info({repoPath:r},"Running MCP diagnose");let i=["# MCP Server Health Check","",`**Repository path**: \`${r}\``,""],t=!1;try{t=W_.statSync(r).isDirectory()}catch{}i.push("## 1. Path"),i.push(t?"\u2705 Directory exists":"\u274C Path missing or not a directory"),i.push("");let o=Ma.join(r,".git"),s=t&&W_.existsSync(o);i.push("## 2. Git repository"),i.push(s?"\u2705 `.git` found":"\u274C Not a Git repository (or path invalid)"),i.push("");let a=!1,c=!1;if(t)try{ke(r),a=!0,c=rt(r)}catch{}i.push("## 3. Database & index"),i.push(a?"\u2705 Database connected":"\u274C Database not available"),i.push(c?"\u2705 Repository indexed":"\u26A0\uFE0F Not indexed yet"),i.push("");let l=t?Oi(r):{installed:[],notInstalled:[],missing:[],foreign:[],disabled:[],statuses:{}};i.push("## 4. Git hooks");let u=["post-merge","post-checkout","post-commit"],p=d=>d==="installed"?"\u2705":d==="missing"?"\u26A0\uFE0F":d==="foreign"?"\u274C":d==="disabled"?"\u23F8\uFE0F":"\u2753";if(t){for(let d of u){let m=l.statuses[d]??"missing";i.push(`- \`${d}\`: ${p(m)} ${m}`)}l.notInstalled.length>0&&i.push('- Run `shadow_env_hooks({ action: "install" })` to repair missing hooks.')}else i.push("\u26A0\uFE0F Path unavailable; hook status not checked");return i.push(""),i.push("## 5. Next steps"),t?c?((l.statuses["post-checkout"]??"missing")!=="installed"&&i.push('- Install/repair hooks: run **shadow_env_hooks** with `action: "install"`.'),i.push("- Index is ready. Use shadow_search_*, shadow_inspect_*, shadow_analyze_*.")):i.push("- Run **shadow_recon_onboard** to populate the index."):i.push("- Use a valid repository path."),{content:[{type:"text",text:i.join(`
|
|
1174
|
+
`)}]}}ee();Q();import rT from"path";import iT from"fs";var G_=$.child({module:"mcp:tools:workspace:list"});async function J_(n){let{repoPaths:e,status:r,limit:i,summarize:t=!1}=n;G_.info({repoCount:e.length,status:r,summarize:t},"Getting workspace missions");let o=[];for(let a of e)if(iT.existsSync(a))try{let{missions:c}=z.getInstance(a),l=c.findAll(r);for(let u of l){let p=c.getLinks(u.id);o.push({...u,repo_path:a,repo_name:rT.basename(a),cross_repo_links:p})}}catch(c){G_.error({error:c,repoPath:a},"Failed to query repo missions")}if(o.sort((a,c)=>{let l=d=>d==="in-progress"?0:d==="verifying"?1:2,u=l(a.status),p=l(c.status);return u!==p?u-p:(a.created_at||0)-(c.created_at||0)}),t||o.length>50&&!i){let a=i||20,c=o.slice(0,a),l=o.reduce((p,d)=>(p[d.status]=(p[d.status]||0)+1,p),{}),u=o.reduce((p,d)=>(p[d.repo_name]=(p[d.repo_name]||0)+1,p),{});return{content:[{type:"text",text:JSON.stringify({summary:{total_missions:o.length,by_status:l,by_repo:u,showing_top:a},top_missions:c,hint:`Showing top ${a} of ${o.length} missions. Use limit to adjust or summarize:false for full list.`},null,2)}]}}let s=i?o.slice(0,i):o;return{content:[{type:"text",text:JSON.stringify({total_missions:o.length,showing:s.length,missions:s},null,2)}]}}ee();Q();var oT=$.child({module:"mcp:tools:workspace:link"});async function V_(n){let{parentRepoPath:e,parentMissionId:r,childRepoPath:i,childMissionId:t,relationship:o="related"}=n;oT.info({parentRepoPath:e,childRepoPath:i},"Linking cross-repo missions");let{missions:s}=z.getInstance(e),{missions:a}=z.getInstance(i);try{let c=s.findById(r),l=a.findById(t);if(!c)throw new Error(`Parent mission ${r} not found`);if(!l)throw new Error(`Child mission ${t} not found`);return s.createLink(r,i,t,o,"parent"),a.createLink(t,e,r,o,"child"),{content:[{type:"text",text:JSON.stringify({status:"linked",relationship:o},null,2)}]}}catch(c){throw new Error(`Failed to link: ${c.message}`)}}Xr();Q();var sT=$.child({module:"mcp:tools:workspace:fuse"});async function q_(n){let{repoPaths:e,name:r}=n;sT.info({repoCount:e.length,name:r},"Creating fused workspace index");try{let i=No({repoPaths:e,name:r||`workspace-${Date.now()}`});return{content:[{type:"text",text:JSON.stringify({message:"Fused index created",status:i.getStatus()},null,2)}]}}catch(i){throw new Error(`Failed to fuse: ${i.message}`)}}var ja=g.object({repoPath:g.string(),name:g.string().optional(),goal:g.string().optional(),strategy:g.string().optional(),missionId:g.number().optional(),parentId:g.number().optional(),outcomeContract:g.string().optional(),templateId:g.string().optional(),templateVars:g.record(g.string(),g.string()).optional()}),Fa=g.object({repoPath:g.string(),missionId:g.number(),stepId:g.string().optional(),status:g.enum(["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]).optional(),contextPivot:g.string().optional(),updates:g.array(g.object({stepId:g.string(),status:g.enum(["pending","planned","in-progress","verifying","completed","failed","skipped","suspended"]),contextPivot:g.string().optional()})).optional(),artifacts:g.array(g.object({type:g.string(),identifier:g.string(),metadata:g.record(g.string(),g.any()).optional()})).optional()}),Ua=g.object({repoPath:g.string(),missionId:g.number().optional(),scope:g.enum(["mission","project"]).optional(),altitude:g.enum(["orbit","atmosphere","ground"]).optional(),activeMissionsLimit:g.number().int().positive().optional(),recentActivityLimit:g.number().int().positive().optional(),compact:g.boolean().optional()}),Za=g.object({repoPath:g.string(),missionId:g.number().optional(),type:g.enum(["decision","blocker","discovery","fix","note","system","adr"]),content:g.string(),filePath:g.string().optional(),symbolName:g.string().optional(),standalone:g.boolean().optional()}),Ha=g.object({repoPath:g.string(),missionId:g.number()}),Wa=g.object({repoPath:g.string(),format:g.enum(["markdown","json"]).optional(),limit:g.number().optional(),offset:g.number().optional(),since:g.number().optional(),until:g.number().optional(),branch:g.string().optional()}),Ba=g.object({repoPath:g.string()}),Ga=g.object({repoPath:g.string(),compact:g.boolean().optional(),branch:g.string().optional(),includeSessionDelta:g.boolean().optional(),sinceCommit:g.string().optional()}),Ja=g.object({repoPath:g.string(),missionId:g.number().optional(),symbolId:g.number().optional()}),K_=g.object({repoPath:g.string(),theme:g.string(),missionIds:g.array(g.number()).optional(),limit:g.number().optional()}),Va=g.object({repoPath:g.string(),missionId:g.number().optional(),depth:g.number().optional(),limit:g.number().optional(),format:g.enum(["mermaid","json"]).optional()}),Y_=g.object({repoPath:g.string(),filePaths:g.array(g.string())}),X_=g.object({repoPath:g.string(),missionId:g.number().optional(),kind:g.enum(["recon_report","risk_assessment","impact_map","debt_scan","custom"]),findings:g.array(g.object({statement:g.string(),confidence:g.number(),refs:g.record(g.string(),g.any()).optional()})),risks:g.array(g.object({severity:g.enum(["low","medium","high","critical"]),description:g.string(),refs:g.record(g.string(),g.any()).optional()})).optional(),missionsCreated:g.array(g.number()).optional(),gaps:g.array(g.string()).optional(),confidence:g.number().optional(),agentTag:g.string().optional()}),Q_=g.object({repoPath:g.string(),missionId:g.number().optional(),kind:g.enum(["recon_report","risk_assessment","impact_map","debt_scan","custom"]).optional(),query:g.string().optional(),limit:g.number().optional()}),qa=g.object({repoPath:g.string(),subPath:g.string().optional(),maxDepth:g.number().int().optional()}),Ka=g.object({repoPath:g.string(),compact:g.boolean().optional()}),Ya=g.object({repoPath:g.string()}),Xa=g.object({repoPath:g.string()}),Qa=g.object({repoPath:g.string()}),ec=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),compact:g.boolean().optional(),tokenBudget:g.number().int().positive().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional()}),tc=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),matchMode:g.enum(["any","all","exact"]).optional()}),nc=g.object({repoPath:g.string(),query:g.string().optional(),key:g.string().optional(),kind:g.enum(["Service","Image","Port","Env"]).optional(),limit:g.number().int().optional(),showUsage:g.boolean().optional()}),rc=g.object({repoPath:g.string(),query:g.string(),limit:g.number().int().optional(),offset:g.number().int().optional(),fileType:g.string().optional(),layer:g.enum(["Solid","Liquid","Virtual","Intel","Phantom"]).optional(),ranked:g.boolean().optional()}),ic=g.object({repoPath:g.string(),filePath:g.string().optional(),symbolName:g.string(),depth:g.number().int().optional(),limit:g.number().int().positive().optional(),offset:g.number().int().nonnegative().optional()}),ex=g.object({repoPath:g.string(),baseCommit:g.string().optional(),headCommit:g.string().optional(),staged:g.boolean().optional(),includeUntracked:g.boolean().optional(),maxSymbols:g.number().int().positive().optional(),impactDepth:g.number().int().positive().optional(),impactLimit:g.number().int().positive().optional()}),tx=g.object({repoPath:g.string(),symbolName:g.string(),filePath:g.string().optional(),direction:g.enum(["outbound","inbound","both"]).optional(),relationship:g.enum(["extends","implements","constrained_by"]).optional(),limit:g.number().int().positive().optional()}),oc=g.object({repoPath:g.string(),filePath:g.string(),symbolName:g.string().optional()}),sc=g.object({repoPath:g.string(),filePath:g.string(),direction:g.enum(["imports","imported_by"]),limit:g.number().int().positive().optional(),offset:g.number().int().nonnegative().optional()}),nx=g.object({repoPath:g.string(),topic:g.string(),type:g.enum(["socket_event","api_route","pubsub_topic"]).optional(),includeCrossRepo:g.boolean().optional(),format:g.enum(["json","text"]).optional()}),ac=g.object({repoPath:g.string(),mode:g.enum(["dead-code","circular-deps"]),limit:g.number().int().optional(),includeTests:g.boolean().optional(),excludePatterns:g.array(g.string()).optional(),includeMigrations:g.boolean().optional(),includeFixtures:g.boolean().optional(),confidenceThreshold:g.enum(["all","high","medium"]).optional()}),cc=g.object({repoPath:g.string(),symbolName:g.string(),filePath:g.string().optional(),context:g.enum(["definition","full"]).optional()}),lc=g.object({repoPath:g.string(),filePath:g.string(),detailLevel:g.enum(["structure","signatures","summaries","detailed"]).optional()}),uc=g.object({repoPath:g.string(),enableContextPivot:g.boolean().optional(),enableMergeSentinel:g.boolean().optional()}),pc=g.object({repoPath:g.string(),deep:g.boolean().optional(),enableContextPivot:g.boolean().optional(),enableMergeSentinel:g.boolean().optional()}),dc=g.object({repoPath:g.string()}),mc=g.object({repoPath:g.string(),action:g.enum(["install","remove","status"]),enableAutoRefresh:g.boolean().optional(),enableSymbolHealing:g.boolean().optional()}),fc=g.object({repoPath:g.string()}),hc=g.object({repoPaths:g.array(g.string()),status:g.string().optional(),limit:g.number().int().positive().optional(),summarize:g.boolean().optional()}),gc=g.object({parentRepoPath:g.string(),parentMissionId:g.number(),childRepoPath:g.string(),childMissionId:g.number(),relationship:g.string()}),yc=g.object({repoPaths:g.array(g.string()),name:g.string().optional()});Q();Gn();var aT=["repoPath","filePath","subPath","path","parentRepoPath","childRepoPath"];function bc(n,e){if(!(!n||typeof n!="object"))for(let r in n)typeof n[r]=="string"?["filePath","subPath","path","repoPath","parentRepoPath","childRepoPath"].includes(r)&&(n[r]=e.resolve(n[r])):Array.isArray(n[r])?n[r].forEach(i=>bc(i,e)):typeof n[r]=="object"&&bc(n[r],e)}function rx(n){if(!(!n||typeof n!="object")){for(let e of aT)if(typeof n[e]=="string")try{n[e]=Pn(n[e])}catch(r){throw r}Array.isArray(n.repoPaths)&&(n.repoPaths=n.repoPaths.map(e=>typeof e=="string"?Pn(e):e))}}function ix(n,e){return async r=>{let i=$.child({handler:n});try{rx(r)}catch(t){return i.warn({err:t},"Path sanitization failed"),ln("VALIDATION_ERROR",t.message,{})}try{if(r?.repoPath&&typeof r.repoPath=="string"){let o=new Rr(r.repoPath);bc(r,o)}i.info({args:r},"Handling tool call");let t=await e(r);return i.debug("Tool call successful"),t}catch(t){i.error({err:t},"Error in tool handler");let o=bt(t),s=o.includes("Access denied"),a=`Handler '${n}' failed: ${o}`;return!s&&r?.repoPath&&(a+=Ci),ln(s?"FORBIDDEN":"INTERNAL_ERROR",a,we(t))}}}function ox(n,e,r){return async i=>{let t=$.child({handler:n});try{rx(i)}catch(s){return t.warn({err:s},"Path sanitization failed"),ln("VALIDATION_ERROR",s.message,{})}if(i?.repoPath&&typeof i.repoPath=="string"){let s=new Rr(i.repoPath);bc(i,s)}t.info({args:i},"Handling tool call with validation");let o=e.safeParse(i);if(!o.success){let s=o.error.issues.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`).join(", ");return t.warn({validationIssues:o.error.issues},"Validation failed"),ln("VALIDATION_ERROR",`Validation error: ${s}`,{issues:o.error.issues})}try{let s=await r(o.data);return t.debug("Tool call successful"),s}catch(s){t.error({err:s},"Error in tool handler");let a=bt(s),c=a.includes("Access denied"),l=`Handler '${n}' failed: ${a}`,u=o.data;return!c&&u?.repoPath&&(l+=Ci),ln(c?"FORBIDDEN":"INTERNAL_ERROR",l,we(s))}}}function zr(n,e){return async r=>{let i=r.repoPath;if(!i)return n(r);let t=o_(i,e);return t||n(r)}}var cT={shadow_ops_plan:{default:Cv},shadow_ops_track:{default:Ov},shadow_ops_briefing:{default:Ia},shadow_ops_log:{default:Jv},shadow_ops_synthesize:{default:Fv},shadow_ops_chronicle:{default:Zv},shadow_ops_context:{default:zr(Hv,"shadow_ops_context")},shadow_ops_health:{default:Bv},shadow_ops_graph:{default:Yv},shadow_ops_crystallize:{default:Qv},shadow_ops_crystallize_theme:{default:e_},shadow_ops_handoff:{default:t_},shadow_ops_handoff_read:{default:n_},shadow_working_set_check:{default:zr(r_,"shadow_working_set_check")},shadow_recon_tree:{default:R_},shadow_recon_hologram:{default:P_},shadow_recon_topography:{default:z_},shadow_recon_scout:{default:C_},shadow_recon_onboard:{default:D_},shadow_search_concept:{default:s_},shadow_search_symbol:{default:a_},shadow_search_config:{default:l_},shadow_search_path:{default:u_},shadow_analyze_mesh:{default:d_},shadow_analyze_impact:{default:p_},shadow_analyze_explain_diff:{default:h_},shadow_analyze_type_graph:{default:g_},shadow_analyze_flow:{default:$_},shadow_analyze_deps:{default:k_},shadow_analyze_debt:{default:T_},shadow_inspect_symbol:{default:zr(bf,"shadow_inspect_symbol")},shadow_inspect_file:{default:zr(j_,"shadow_inspect_file")},shadow_sync_trace:{default:zr(F_,"shadow_sync_trace")},shadow_sync_index:{default:U_},shadow_sync_repair:{default:zr(Z_,"shadow_sync_repair")},shadow_env_hooks:{default:H_},shadow_env_diagnose:{default:B_},shadow_workspace_list:{default:J_},shadow_workspace_link:{default:V_},shadow_workspace_fuse:{default:q_}},lT={shadow_ops_plan:ja,shadow_ops_track:Fa,shadow_ops_briefing:Ua,shadow_ops_log:Za,shadow_ops_synthesize:Ha,shadow_ops_chronicle:Wa,shadow_ops_context:Ga,shadow_ops_health:Ba,shadow_ops_graph:Va,shadow_ops_crystallize:Ja,shadow_ops_crystallize_theme:K_,shadow_ops_handoff:X_,shadow_ops_handoff_read:Q_,shadow_working_set_check:Y_,shadow_recon_tree:qa,shadow_recon_hologram:Ka,shadow_recon_topography:Ya,shadow_recon_scout:Xa,shadow_recon_onboard:Qa,shadow_search_concept:ec,shadow_search_symbol:tc,shadow_search_config:nc,shadow_search_path:rc,shadow_analyze_mesh:nx,shadow_analyze_impact:ic,shadow_analyze_explain_diff:ex,shadow_analyze_type_graph:tx,shadow_analyze_flow:oc,shadow_analyze_deps:sc,shadow_analyze_debt:ac,shadow_inspect_symbol:cc,shadow_inspect_file:lc,shadow_sync_trace:uc,shadow_sync_index:pc,shadow_sync_repair:dc,shadow_env_hooks:mc,shadow_env_diagnose:fc,shadow_workspace_list:hc,shadow_workspace_link:gc,shadow_workspace_fuse:yc},xf=new Map;for(let[n,e]of Object.entries(cT)){let r=lT[n];r?xf.set(n,ox(n,r,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t){let s=Object.keys(e);return{content:[{type:"text",text:`Missing required parameter "mode" or "action" for tool ${n}.
|
|
1004
1175
|
|
|
1005
1176
|
\u{1F4A1} Solution: Specify one of: ${s.join(", ")}`}],isError:!0}}let o=e[t];if(!o){let s=Object.keys(e);return{content:[{type:"text",text:`Invalid mode/action "${t}" for tool ${n}.
|
|
1006
1177
|
|
|
1007
|
-
\u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):
|
|
1178
|
+
\u{1F4A1} Solution: Use one of these modes: ${s.join(", ")}`}],isError:!0}}return o(i)})):xf.set(n,ix(n,async i=>{if(e.default)return e.default(i);let t=i.mode||i.action;if(!t)throw new Error(`Missing mode/action for tool ${n}`);let o=e[t];if(!o)throw new Error(`Unknown mode/action '${t}' for tool ${n}`);return o(i)}))}async function sx(n,e){let r=xf.get(n);if(!r)throw new Error(`Tool not found: ${n}`);return r(e)}var uT={shadow_ops_plan:ja,shadow_ops_track:Fa,shadow_ops_briefing:Ua,shadow_ops_log:Za,shadow_ops_synthesize:Ha,shadow_ops_chronicle:Wa,shadow_ops_context:Ga,shadow_ops_health:Ba,shadow_ops_graph:Va,shadow_ops_crystallize:Ja,shadow_recon_tree:qa,shadow_recon_hologram:Ka,shadow_recon_topography:Ya,shadow_recon_scout:Xa,shadow_recon_onboard:Qa,shadow_search_concept:ec,shadow_search_symbol:tc,shadow_search_config:nc,shadow_search_path:rc,shadow_analyze_impact:ic,shadow_analyze_flow:oc,shadow_analyze_deps:sc,shadow_analyze_debt:ac,shadow_inspect_symbol:cc,shadow_inspect_file:lc,shadow_sync_trace:uc,shadow_sync_index:pc,shadow_sync_repair:dc,shadow_env_hooks:mc,shadow_env_diagnose:fc,shadow_workspace_list:hc,shadow_workspace_link:gc,shadow_workspace_fuse:yc};function pT(){let n={};for(let e of Tv){let r=uT[e.name];r&&(n[e.name]={name:e.name,description:e.description,parameters:r,execute:async i=>{try{let t=await sx(e.name,i);if(t.isError)return`Error: ${t.content[0]?.text}`;let o;try{o=JSON.parse(t.content[0].text)}catch{return t.content[0].text}return o}catch(t){return`Error: ${t.message}`}}})}return n}ee();Dc();ft();Xr();yt();We();of();export{$t as BriefingEngine,_n as BriefingStatusService,vn as CleanSweep,Io as DecayScorer,lo as EmbeddingPriorityQueue,Zn as EmbeddingWorkerPool,Yr as FusedIndexManager,Ni as GitNotesAdapter,Ta as GraphExporterService,bn as HeritageAnalyzer,ce as HologramService,Lh as IGNORED_PATH_SEGMENTS,Ah as INDEXABLE_EXTENSIONS,Dh as INDEXABLE_FILENAMES,Nt as ImpactService,xg as MatchType,Gr as MissionRepository,ze as NanoRepair,Rn as NarrativeService,et as PersistencePivotService,z as RepositoryFactory,Be as SearchService,zt as ShadowTrace,iC as analyzeImpact,Or as buildTree,Oi as checkGitHooks,Oc as checkVirtualMerge,zx as chunkFile,Bt as classifyFileLayer,Nc as closeDB,zg as closeFusedIndex,fn as computeContentHash,Br as cosineSimilarity,no as diagnoseResolution,te as ensureCacheUpToDate,ef as expandTemplate,uf as findBackendRoute,Bn as findFuzzyMatches,uo as generateEmbedding,po as generateEmbeddingsBatch,pT as getAITools,Vr as getAncestors,He as getArchitectureSummary,aC as getBriefing,jc as getChangedFiles,ge as getCurrentBranch,Me as getCurrentCommit,ke as getDB,gn as getDefaultPool,No as getFusedIndex,uC as getGravityHotspots,sC as getHologram,lC as getIntentLogs,jr as getLastIndexedCommit,Ax as getMetrics,Tc as getMetricsSnapshot,cC as getMissions,zv as getTemplate,oC as getTopography,Mc as hasChangesSince,Pc as hasContentChanged,Kf as initDB,jn as initResolver,Li as installGitHooks,rt as isIndexed,zo as listFusedIndexes,dE as listTemplates,to as markAsIndexed,On as parseFile,qc as processRepo,Ki as recordIndexCacheHit,dn as recordQueryStart,mt as recordSearchHistoryFailure,Ht as resolveImportPath,Pn as sanitizePathInput,Nn as sanitizeQueryInput,xc as scanRepo,rC as searchSymbol,Wr as setUseWorkerThreads,Ur as shutdownDefaultPool,yf as uninstallGitHooks};
|