@estevia/evafusion-agent 1.9.2 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ ${O.diagram}`)}catch{F=T}else F=u(T),T&&typeof T=="object"&&T.diagram&&(F+=`
|
|
|
149
149
|
### Neural Blueprint
|
|
150
150
|
${T.diagram}`);const de={role:"assistant",content:F,variant:C,timestamp:new Date().toISOString(),rawPayload:L.data,inputData:re,usage:L.data.usage};d(O=>[...O,de])}else Se.error("Neural synthesis failed. Please check payload integrity.")}catch(f){Se.error(`API Error: ${f.message||"Failed to reach EvaFusion"}`)}finally{l(!1)}},[m,r,b,C,y]);return{messages:a,input:m,setInput:v,isProcessing:b,activeVariant:C,setActiveVariant:N,handleSend:me,payloadConfig:y,updatePayloadConfig:I,samples:te.map(B=>({...B,isDataDriven:!!B.data})),selectedSampleId:G,setSelectedSampleId:W,applySample:ae,clearChat:$,isAuthorized:!!r}};function we(...n){return n.filter(Boolean).join(" ")}const ze=({chart:n})=>{s.useRef(null);const[r,i]=s.useState(""),[a,d]=s.useState(null),[m,v]=s.useState(!1);return s.useEffect(()=>{if(window.__EVA_PRIVATE_ENGINE__){v(!0);return}const b=document.createElement("script");b.src="https://cdn.jsdelivr.net/npm/mermaid@10.2.4/dist/mermaid.min.js",b.async=!0,b.onload=()=>{const l=window.mermaid;l&&(window.__EVA_PRIVATE_ENGINE__=l,l.initialize({startOnLoad:!1,theme:"dark",securityLevel:"loose",fontFamily:"Inter, sans-serif",themeVariables:{fontSize:"14px",primaryColor:"#6366f1",primaryTextColor:"#fff",primaryBorderColor:"#6366f1",lineColor:"#818cf8",secondaryColor:"#1e293b",tertiaryColor:"#0f172a"}}),v(!0))},document.body.appendChild(b)},[]),s.useEffect(()=>{if(!m)return;const b=window.__EVA_PRIVATE_ENGINE__;if(!b)return;const l=N=>{if(!N)return"";let y=N.replace(/```mermaid/gi,"").replace(/```/g,"").replace(/#+.*mermaid\.js.*$/gim,"").replace(/#+.*system architecture.*$/gim,"").replace(/here's a .*diagram.*$/gim,"").replace(/this diagram shows.*$/gim,"").replace(/^#+.*$/gm,"").replace(/<[^>]*>/g,"").replace(/^\s*[\r\n]/gm,"").trim();const k=y.split(`
|
|
151
151
|
`);if(k.length>0){const G=k[0].trim();["graph","sequencediagram","flowchart","erdiagram","classdiagram","statediagram","journey","gantt","pie","timeline","gitgraph","mindmap","quadrantchart","sankey","xychart"].some(te=>G.toLowerCase().startsWith(te))&&(k[0]=G.replace(/;$/,""),y=k.join(`
|
|
152
|
-
`))}return y};(async()=>{const N=l(n);if(N)try{d(null);const y=`mermaid-render-${Math.random().toString(36).substr(2,9)}`,{svg:k}=await b.render(y,N);i(k)}catch(y){console.error("Mermaid render error:",y),d("Neural Blueprint Syntax Error")}})()},[n,m]),a?e.jsx("div",{className:"flex flex-col items-center justify-center p-8 bg-rose-500/5 rounded-2xl border border-rose-500/20 text-rose-400 gap-3 my-4",children:e.jsx("p",{className:"text-[10px] font-black uppercase tracking-tight text-center",children:a})}):e.jsxs("div",{className:"relative group w-full my-4",children:[e.jsx("div",{className:"bg-slate-900/40 rounded-2xl border border-white/5 p-6 overflow-hidden max-h-[500px] flex justify-center relative",dangerouslySetInnerHTML:{__html:r}}),!r&&e.jsx("div",{className:"p-8 flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-indigo-500"})})]})},$e=n=>{const r=n.pendingTasks||n.tasks,i=n.resources||n.team;return!r&&!i?null:e.jsxs("div",{className:"space-y-6 mt-6",children:[r&&r.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-500",children:[e.jsx(D.Layout,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Maestro Orchestration Board"})]}),e.jsx("div",{className:"grid gap-2",children:r.map((a,d)=>e.jsxs("div",{className:"bg-white/5 border border-white/10 p-3 rounded-xl flex items-center justify-between group hover:bg-white/[0.08] transition-all",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[11px] font-bold text-white group-hover:text-amber-500 transition-colors",children:a.task||a.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[8px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded uppercase font-black tracking-widest",children:["Sprint ",a.sprint]}),e.jsx("span",{className:we("text-[8px] px-1.5 py-0.5 rounded font-black uppercase tracking-widest",a.priority==="P0"?"bg-rose-500/20 text-rose-500":"bg-blue-500/20 text-blue-500"),children:a.priority})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:a.owner||a.assignedTo}),e.jsxs("div",{className:"text-[10px] font-mono text-amber-500/60",children:[a.points||a.effort," pts"]})]})]},d))})]}),i&&i.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[e.jsx(D.Users,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Team Resonance Map"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map((a,d)=>{var m,v;return e.jsxs("div",{className:"bg-white/5 border border-white/5 p-3 rounded-xl space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-indigo-500/20 flex items-center justify-center text-[10px] font-black text-indigo-400",children:((m=a.name)==null?void 0:m[0])||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-bold text-white",children:a.name}),e.jsx("div",{className:"text-[8px] text-slate-500 uppercase font-black",children:a.role})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:(v=a.skills)==null?void 0:v.slice(0,2).map((b,l)=>e.jsx("span",{className:"text-[7px] bg-white/5 text-slate-400 px-1 py-0.5 rounded",children:b},l))})]},d)})})]})]})},Re=({data:n})=>{if(!n||!Array.isArray(n))return null;const r=Object.keys(n[0]||{}).filter(i=>i!=="id");return e.jsx("div",{className:"w-full overflow-hidden rounded-2xl border border-white/5 bg-slate-900/40 my-4",children:e.jsx("div",{className:"overflow-x-auto no-scrollbar",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-white/5 border-b border-white/5",children:r.map(i=>e.jsx("th",{className:"p-3 text-[8px] font-black text-slate-500 uppercase tracking-widest",children:i},i))})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:n.map((i,a)=>e.jsx("tr",{className:"hover:bg-white/[0.02] transition-colors",children:r.map(d=>e.jsx("td",{className:"p-3 text-[10px] font-medium text-slate-300",children:d.toLowerCase()==="status"?e.jsx("span",{className:we("px-1.5 py-0.5 rounded-full text-[8px] font-black uppercase tracking-widest",i[d]==="Nominal"?"bg-emerald-500/20 text-emerald-500":"bg-amber-500/20 text-amber-500"),children:i[d]}):i[d]},d))},a))})]})})})},et=({data:n})=>n?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-bottom-4 duration-1000",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-tighter italic",children:n.strategicContextTitle||"Neural Strategy"}),e.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:n.matrixSubtitle})]}),n.phases&&e.jsx("div",{className:"relative space-y-6 pl-6 border-l border-white/5",children:n.phases.map((r,i)=>{var a,d;return e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[27px] top-1 w-2.5 h-2.5 rounded-full bg-amber-500 shadow-[0_0_10px_rgba(245,158,11,0.4)] group-hover:scale-125 transition-transform"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:r.title}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:r.milestone})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 bg-white/5 rounded-xl p-3 border border-white/5 group-hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-emerald-500/60 uppercase tracking-widest",children:"Growth Points"}),e.jsx("ul",{className:"space-y-1",children:(a=r.growthPoints)==null?void 0:a.map((m,v)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/40"})," ",m]},v))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-rose-500/60 uppercase tracking-widest",children:"Frictions"}),e.jsx("ul",{className:"space-y-1",children:(d=r.frictions)==null?void 0:d.map((m,v)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-rose-500/40"})," ",m]},v))})]})]})]})]},i)})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.riskSimulations&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Neural Risk Assessment"}),e.jsx("div",{className:"space-y-2",children:n.riskSimulations.map((r,i)=>e.jsxs("div",{className:"p-3 rounded-xl bg-black/20 border border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-300",children:r.threat}),e.jsx("div",{className:"text-[8px] text-slate-500 italic",children:r.mitigation})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:we("text-[9px] font-black uppercase",r.impact==="High"?"text-rose-500":"text-amber-500"),children:[r.impact," Impact"]}),e.jsxs("div",{className:"text-[8px] font-mono text-slate-600",children:[r.probability,"% Prob"]})]})]},i))})]}),n.projections&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Market Projections (2026)"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:Object.entries(n.projections).map(([r,i],a)=>e.jsxs("div",{className:"p-3 rounded-xl bg-amber-500/5 border border-amber-500/10 flex items-center justify-between group hover:bg-amber-500/10 transition-all",children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:r}),e.jsx("span",{className:"text-[10px] font-mono text-amber-500 font-bold",children:i})]},a))}),e.jsx("div",{className:"p-3 rounded-xl bg-white/5 border border-white/5 italic text-[9px] text-slate-500 leading-relaxed",children:n.trajectorySummary})]})]})]}):null,Ge=({data:n})=>{var r;return n?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-right-4 duration-700",children:[n.okrAlignment&&e.jsx("div",{className:"bg-gradient-to-br from-amber-500/10 to-indigo-500/5 rounded-3xl p-6 border border-white/5 flex items-center justify-between shadow-2xl",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:"Neural OKR Alignment"}),e.jsx("div",{className:"flex gap-2",children:(r=n.okrAlignment.frictionPoints)==null?void 0:r.map((i,a)=>e.jsx("span",{className:"text-[8px] bg-rose-500/10 text-rose-400 px-2 py-0.5 rounded-full border border-rose-500/20",children:i},a))})]})}),e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[n.sprints&&n.sprints.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Orchestrated Sprints"}),e.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4 no-scrollbar",children:n.sprints.map((i,a)=>{var d;return e.jsxs("div",{className:"min-w-[240px] p-4 rounded-2xl bg-white/5 border border-white/5 space-y-4 shrink-0 hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-2",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500",children:["SPRINT ",i.id]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:i.allocation?`${i.allocation.reduce((m,v)=>m+(v.load||0),0)} pts`:`${i.velocity||0} pts`})]}),e.jsx("div",{className:"space-y-4",children:i.allocation?i.allocation.map((m,v)=>{var b;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest",children:m.role}),e.jsxs("span",{className:"text-[7px] font-mono text-amber-500/60",children:[m.load,"% Load"]})]}),e.jsx("div",{className:"space-y-1 pl-2 border-l border-amber-500/20",children:(b=m.tasks)==null?void 0:b.map((l,C)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40"})," ",l]},C))})]},v)}):e.jsx("div",{className:"space-y-2",children:(d=i.tasks)==null?void 0:d.map((m,v)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500"})," ",m]},v))})})]},a)})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Critical Dependency Chains"}),n.chains&&n.chains.length>0?e.jsx("div",{className:"space-y-3",children:n.chains.map((i,a)=>{const d=i.sequence||i.nodes||[];return e.jsxs("div",{className:"p-4 rounded-xl bg-black/40 border border-white/5 flex items-center gap-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/10 flex items-center justify-center shrink-0 border border-indigo-500/20",children:e.jsx(D.Activity,{size:14,className:"text-indigo-400"})}),e.jsx("div",{className:"flex-1 flex items-center gap-2 overflow-x-auto no-scrollbar",children:d.map((m,v)=>e.jsxs(s.Fragment,{children:[e.jsx("span",{className:"text-[9px] font-bold text-slate-400 whitespace-nowrap",children:m}),v<d.length-1&&e.jsx("span",{className:"text-slate-700",children:"→"})]},v))})]},a)})}):e.jsx("div",{className:"p-4 rounded-xl bg-white/5 border border-white/5 border-dashed flex items-center justify-center",children:e.jsx("span",{className:"text-[9px] font-black text-slate-600 uppercase tracking-widest italic",children:"No Critical Dependency Chains Detected"})})]})]}),e.jsxs("div",{className:"flex items-center gap-6 pt-4 border-t border-white/5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Compute Load"}),e.jsx("span",{className:"text-[9px] font-mono text-emerald-500",children:n.computeLoad||"IDLE"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Neural Latency"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:n.latency||"0ms"})]})]})]}):null},tt=({threats:n})=>!n||!Array.isArray(n)?null:e.jsxs("div",{className:"space-y-3 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-rose-500 mb-2",children:[e.jsx(D.ShieldAlert,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Active Threat Matrix"})]}),e.jsx("div",{className:"grid gap-3",children:n.map((r,i)=>e.jsxs(Ae.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:i*.1},className:"p-4 rounded-2xl bg-rose-500/5 border border-rose-500/10 flex items-start gap-4 group hover:bg-rose-500/10 transition-all",children:[e.jsx("div",{className:we("w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border",r.impact==="High"?"bg-rose-500/20 border-rose-500/40 text-rose-500":"bg-amber-500/20 border-amber-500/40 text-amber-500"),children:e.jsx(D.AlertTriangle,{size:16})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[11px] font-black text-white uppercase tracking-tight",children:r.threat||r.type}),e.jsxs("span",{className:we("text-[8px] font-black uppercase tracking-widest px-2 py-0.5 rounded-full",r.impact==="High"?"bg-rose-500 text-white":"bg-amber-500 text-black"),children:[r.impact," Risk"]})]}),e.jsxs("p",{className:"text-[10px] text-slate-400 leading-relaxed italic",children:['"',r.mitigation||r.description||"Neural mitigation in progress...",'"']})]})]},i))})]}),at=({data:n})=>!n||!Array.isArray(n)?null:e.jsxs("div",{className:"space-y-4 mt-6 pl-4 border-l border-white/5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-emerald-500 -ml-5 mb-4",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.4)]"}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Regulatory Event Stream"})]}),e.jsx("div",{className:"space-y-4",children:n.map((r,i)=>e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[21px] top-1.5 w-2 h-2 rounded-full bg-slate-800 border border-slate-700 group-hover:bg-emerald-500 transition-colors"}),e.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 group-hover:border-emerald-500/20 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[10px] font-black text-white uppercase",children:r.action||r.control||"Audit Check"}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:r.time||r.timestamp||"Real-time"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[8px] text-slate-500 uppercase font-black tracking-widest",children:"User:"}),e.jsx("span",{className:"text-[9px] text-slate-300 font-bold",children:r.user||r.subject||"System"})]}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-white/10"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[8px] text-slate-500 uppercase font-black tracking-widest",children:"Status:"}),e.jsx("span",{className:we("text-[8px] font-black uppercase tracking-widest px-1.5 py-0.5 rounded",r.status==="PASS"||r.status==="SUCCESS"||r.status==="CLEARED"?"bg-emerald-500/20 text-emerald-500":"bg-rose-500/20 text-rose-500"),children:r.status})]})]})]})]},i))})]}),rt=({data:n})=>!n||!Array.isArray(n)?null:e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[e.jsx(D.Fingerprint,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Sensitive Data Mapping (PII)"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:n.map((r,i)=>e.jsxs("div",{className:"p-4 rounded-2xl bg-indigo-500/5 border border-indigo-500/10 hover:border-indigo-500/30 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[10px] font-black text-white uppercase tracking-tight",children:r.category||"Data Class"}),e.jsx(D.Shield,{size:12,className:"text-indigo-500/40"})]}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400 mb-2",children:r.dataPoints||r.value||"Encrypted"}),e.jsxs("div",{className:"text-[7px] font-black uppercase text-slate-600 tracking-[0.2em]",children:["Origin: ",r.storageSource||r.source||"Vault"]})]},i))})]}),nt=({data:n})=>{if(!n||typeof n!="object")return null;const r=Object.entries(n).filter(([i,a])=>typeof a!="object"||Array.isArray(a));return e.jsxs("div",{className:"mt-6 w-full rounded-3xl bg-slate-900/40 border border-white/5 overflow-hidden",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D.Database,{size:12,className:"text-slate-500"}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Neural Structured Matrix"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),e.jsx("span",{className:"text-[7px] font-black text-emerald-500 uppercase tracking-widest",children:"Live Trace"})]})]}),e.jsx("div",{className:"p-2",children:r.map(([i,a],d)=>e.jsxs("div",{className:we("flex items-center justify-between p-3 rounded-xl hover:bg-white/5 transition-all",d!==r.length-1?"border-b border-white/5":""),children:[e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:i.replace(/([A-Z])/g," $1")}),e.jsx("span",{className:"text-[10px] font-bold text-slate-300",children:Array.isArray(a)?`${a.length} items`:String(a)})]},d))})]})},Ht=({data:n,variant:r})=>{if(!n)return null;let i={label:"Generic Matrix",details:"Raw payload detected"};try{const a=typeof n=="string"?JSON.parse(n):n;if(r==="MAESTRO"){const d=(a.pendingTasks||a.tasks||[]).length,m=(a.resources||a.team||[]).length;i={label:"Maestro Orchestration Matrix",details:`${d} Tasks • ${m} Resources`}}else r==="ANALYST"?i={label:"Analyst Data Stream",details:Array.isArray(a)?`${a.length} Records`:"Structured Dataset"}:r==="SENTINEL"?i={label:"Sentinel Telemetry Logs",details:typeof a=="string"?`${a.length} chars`:"Log Stream"}:i={label:"Neural Input Matrix",details:typeof a=="object"?"Structured Data":"Raw Text"}}catch{}return e.jsxs("div",{className:"mt-2 p-3 rounded-xl bg-black/20 border border-white/5 flex items-center gap-3 group hover:border-amber-500/20 transition-all cursor-default",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center border border-amber-500/20",children:e.jsx(D.Database,{size:14,className:"text-amber-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-black text-amber-500/80 uppercase tracking-widest truncate",children:i.label}),e.jsx("div",{className:"text-[9px] text-slate-500 font-mono",children:i.details})]})]})},Xt=({isOpen:n,onClose:r,input:i,prompt:a,output:d,variant:m})=>{if(!n)return null;const v=i&&(Array.isArray(i)&&i.length>0||typeof i=="object"&&Object.keys(i).length>0),b=()=>{if(!d||typeof d!="object")return e.jsx("pre",{className:"text-[10px] font-mono text-emerald-400/80 leading-relaxed whitespace-pre-wrap",children:String(d)});const l=d;return m==="MAESTRO"||l.tasks||l.sprints?e.jsxs("div",{className:"space-y-6",children:[l.tasks&&e.jsx($e,{tasks:l.tasks,team:l.team}),l.sprints&&e.jsx(Ge,{data:l})]}):m==="STRATEGIST"||l.phases?e.jsx(et,{data:l}):l.threats?e.jsx(tt,{threats:l.threats}):l.auditStream||l.auditResults||l.activeViolations?e.jsx(at,{data:l.auditStream||l.auditResults||l.activeViolations}):l.piiData?e.jsx(rt,{data:l.piiData}):l.nodes||l.metrics||Array.isArray(l.data)?e.jsx(Re,{data:l.nodes||l.metrics||l.data}):l.diagram?e.jsx(ze,{chart:l.diagram}):e.jsx(nt,{data:l})};return e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4 sm:p-10",children:[e.jsx("div",{className:"absolute inset-0 bg-[#020210]/80 backdrop-blur-xl",onClick:r}),e.jsxs("div",{className:"relative w-full h-full max-w-6xl eva-holographic-glass bg-[#0a0a20]/40 rounded-3xl border border-white/10 flex flex-col overflow-hidden shadow-[0_0_100px_rgba(99,102,241,0.1)]",children:[e.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between bg-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center",children:e.jsx(D.Activity,{size:20,className:"text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-widest italic",children:"Neural Transfer Comparator"}),e.jsxs("p",{className:"text-[9px] text-slate-500 uppercase font-bold tracking-widest",children:[m||"Universal"," Orchestration • Real-time Trace"]})]})]}),e.jsx("button",{onClick:r,className:"p-2 rounded-xl text-slate-400 hover:text-white hover:bg-white/5 transition-all",children:e.jsx(D.X,{size:20})})]}),e.jsxs("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[e.jsxs("div",{className:"flex-1 border-r border-white/5 flex flex-col overflow-hidden bg-black/20",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(D.Database,{size:12})," ",v?"Source Matrix":"Generative Prompt"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:v?"Input Stream":"Instruction"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:v?e.jsx("pre",{className:"text-[10px] font-mono text-indigo-200/60 leading-relaxed whitespace-pre-wrap",children:typeof i=="string"?i:JSON.stringify(i,null,2)}):e.jsxs("div",{className:"min-h-full flex flex-col items-center justify-center text-center px-10 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-amber-500/5 flex items-center justify-center mb-4 border border-amber-500/10",children:e.jsx(D.Sparkles,{size:20,className:"text-amber-500/40"})}),e.jsxs("p",{className:"text-xs text-indigo-200/80 font-medium leading-relaxed italic",children:['"',a||"No instruction context captured",'"']}),e.jsx("div",{className:"mt-4 px-3 py-1 rounded-full bg-amber-500/10 border border-amber-500/20 text-[7px] font-black uppercase tracking-[0.2em] text-amber-500/60",children:"Neural Synthesis Mode Active"})]})})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-indigo-500/[0.02]",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(D.Sparkles,{size:12})," Neural Synthesis"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:"Engine Output"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:b()})]})]}),e.jsxs("div",{className:"p-4 border-t border-white/5 flex items-center justify-center gap-8 bg-black/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Ground Truth"})]}),e.jsx("div",{className:"w-12 h-[1px] bg-white/10 relative",children:e.jsx(Ae.motion.div,{className:"absolute top-[-2px] w-1.5 h-1.5 rounded-full bg-indigo-500",animate:{left:["0%","100%","0%"]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500 shadow-[0_0_8px_rgba(99,102,241,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Synergized Output"})]})]})]})]})},Gt=({usage:n,rawPayload:r,inputData:i,variant:a,onInspect:d})=>{const[m,v]=s.useState(!1),b=()=>{navigator.clipboard.writeText(JSON.stringify(r,null,2)),v(!0),setTimeout(()=>v(!1),2e3)};return e.jsxs("div",{className:"mt-16 pt-10 pb-4 px-2 border-t border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[n&&e.jsxs("div",{className:"flex gap-4 p-2 border-r border-white/5 mr-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Input Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:n.inputTokens})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Output Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:n.outputTokens})]})]}),d&&e.jsxs("button",{onClick:d,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-indigo-500/5 border border-indigo-500/10 text-[9px] font-black uppercase tracking-widest text-indigo-400 hover:bg-indigo-500/20 transition-all",children:[e.jsx(D.Activity,{size:12}),"Inspect Neural Transfer"]})]}),e.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-white/5 border border-white/10 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:bg-amber-500/5 hover:border-amber-500/20 transition-all",children:[m?e.jsx(D.Check,{size:12,className:"text-emerald-500"}):e.jsx(D.Copy,{size:12}),m?"Copied":"Copy JSON"]})]})},it={name:"@estevia/evafusion-agent",version:"1.9.2",description:"Premium React-based ChatWizard Agent for EvaFusion Workbench Integration",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist"],scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{"framer-motion":"^10.12.16","lucide-react":"^0.244.0",sonner:"^0.3.1"},peerDependencies:{react:"^18.2.0","react-dom":"^18.2.0","@estevia/evafusion-sdk":"^1.6.8"},devDependencies:{"@estevia/evafusion-sdk":"^1.6.8","@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^4.0.0",autoprefixer:"^10.4.14",postcss:"^8.4.24",tailwindcss:"^3.3.2",typescript:"^5.0.2",vite:"^4.3.9","vite-plugin-dts":"^2.3.0"}},Qt={ARCHITECT:"System blueprinting & infrastructure design",STRATEGIST:"Roadmap planning & market penetration",MAESTRO:"Resource orchestration & sprint management",ANALYST:"Data-driven discovery & trend projection",PULSE:"Workforce sentiment & cultural resonance",RECRUITER:"Talent sourcing & resonance scoring",SENTINEL:"Real-time threat detection & industrial safety",COMPLIANCE:"Regulatory audit & privacy enforcement"},je=Ne.VARIANT_REQUIREMENTS||{ARCHITECT:"OPTIONAL",ANALYST:"MANDATORY",STRATEGIST:"OPTIONAL",RECRUITER:"OPTIONAL",SENTINEL:"MANDATORY",MAESTRO:"HYBRID",COMPLIANCE:"MANDATORY",PULSE:"MANDATORY",NEXUS:"OPTIONAL"},Yt=({onClose:n,onMinimize:r})=>{const i=s.useContext(Xe),[a,d]=s.useState(!1);s.useState(!1);const m=s.useRef(null);if(!i)return null;const{messages:v,input:b,setInput:l,isProcessing:C,activeVariant:N,setActiveVariant:y,handleSend:k,payloadConfig:G,updatePayloadConfig:W,samples:te,selectedSampleId:ae,setSelectedSampleId:$,applySample:I,clearChat:me,isAuthorized:B}=_e(),[x,E]=s.useState(G),[z,ce]=s.useState(N),[f,re]=s.useState(ae),[g,L]=s.useState({isValid:!0,error:null}),[u,T]=s.useState(null),F=s.useRef(null);s.useEffect(()=>{a&&(E(G),ce(N),re(ae))},[a]),s.useEffect(()=>{const A=Ne.NeuralDataUtils.validatePayload(z,x.data);L(A)},[x.data,z]);const de=A=>{var K;const H=(K=A.target.files)==null?void 0:K[0];if(!H)return;const p=new FileReader;p.onload=se=>{var X;const pe=(X=se.target)==null?void 0:X.result,Z=Ne.NeuralDataUtils.parseCSV(pe);E(Q=>({...Q,data:JSON.stringify(Z,null,2)})),re("")},p.readAsText(H)},O=()=>{const A=Ne.NeuralDataUtils.normalizeForWorkbench(z,x.data);E(H=>({...H,data:JSON.stringify(A,null,2)}))},ge=()=>{y(z),W(x),$(f),d(!1)};s.useEffect(()=>{E(A=>({...A,data:null}))},[z]);const ue=[{id:"SOFTWARE_DEV",name:"Software & Cloud"},{id:"FINANCE",name:"Finance & Quants"},{id:"HEALTHCARE",name:"Healthcare & Life"},{id:"MANUFACTURING",name:"Industrial & MFG"},{id:"REAL_ESTATE",name:"Real Estate & Const."},{id:"RETAIL",name:"Retail & Commerce"},{id:"EDUCATION",name:"Education & Learning"}],Be=()=>{var A;(A=m.current)==null||A.scrollIntoView({behavior:"smooth"})};s.useEffect(()=>{Be()},[v,C]);const Pe=({msg:A})=>{const{content:H,rawPayload:p,usage:K}=A,se=H.split(/(?=### )/g),pe=X=>{const Q=X.trim();return Q.startsWith("{")&&Q.endsWith("}")||Q.startsWith("[")&&Q.endsWith("]")},Z=X=>X.includes("```mermaid")?X.split(/```mermaid([\s\S]*?)```/).map((Y,S)=>S%2===1?e.jsx(ze,{chart:Y.trim()},S):e.jsx("div",{children:Z(Y)},S)):X.split(`
|
|
152
|
+
`))}return y};(async()=>{const N=l(n);if(N)try{d(null);const y=`mermaid-render-${Math.random().toString(36).substr(2,9)}`,{svg:k}=await b.render(y,N);i(k)}catch(y){console.error("Mermaid render error:",y),d("Neural Blueprint Syntax Error")}})()},[n,m]),a?e.jsx("div",{className:"flex flex-col items-center justify-center p-8 bg-rose-500/5 rounded-2xl border border-rose-500/20 text-rose-400 gap-3 my-4",children:e.jsx("p",{className:"text-[10px] font-black uppercase tracking-tight text-center",children:a})}):e.jsxs("div",{className:"relative group w-full my-4",children:[e.jsx("div",{className:"bg-slate-900/40 rounded-2xl border border-white/5 p-6 overflow-hidden max-h-[500px] flex justify-center relative",dangerouslySetInnerHTML:{__html:r}}),!r&&e.jsx("div",{className:"p-8 flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-indigo-500"})})]})},$e=n=>{const r=n.pendingTasks||n.tasks,i=n.resources||n.team;return!r&&!i?null:e.jsxs("div",{className:"space-y-6 mt-6",children:[r&&r.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-500",children:[e.jsx(D.Layout,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Maestro Orchestration Board"})]}),e.jsx("div",{className:"grid gap-2",children:r.map((a,d)=>e.jsxs("div",{className:"bg-white/5 border border-white/10 p-3 rounded-xl flex items-center justify-between group hover:bg-white/[0.08] transition-all",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[11px] font-bold text-white group-hover:text-amber-500 transition-colors",children:a.task||a.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[8px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded uppercase font-black tracking-widest",children:["Sprint ",a.sprint]}),e.jsx("span",{className:we("text-[8px] px-1.5 py-0.5 rounded font-black uppercase tracking-widest",a.priority==="P0"?"bg-rose-500/20 text-rose-500":"bg-blue-500/20 text-blue-500"),children:a.priority})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:a.owner||a.assignedTo}),e.jsxs("div",{className:"text-[10px] font-mono text-amber-500/60",children:[a.points||a.effort," pts"]})]})]},d))})]}),i&&i.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[e.jsx(D.Users,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Team Resonance Map"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.map((a,d)=>{var m,v;return e.jsxs("div",{className:"bg-white/5 border border-white/5 p-3 rounded-xl space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-indigo-500/20 flex items-center justify-center text-[10px] font-black text-indigo-400",children:((m=a.name)==null?void 0:m[0])||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-bold text-white",children:a.name}),e.jsx("div",{className:"text-[8px] text-slate-500 uppercase font-black",children:a.role})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:(v=a.skills)==null?void 0:v.slice(0,2).map((b,l)=>e.jsx("span",{className:"text-[7px] bg-white/5 text-slate-400 px-1 py-0.5 rounded",children:b},l))})]},d)})})]})]})},Re=({data:n})=>{if(!n||!Array.isArray(n))return null;const r=Object.keys(n[0]||{}).filter(i=>i!=="id");return e.jsx("div",{className:"w-full overflow-hidden rounded-2xl border border-white/5 bg-slate-900/40 my-4",children:e.jsx("div",{className:"overflow-x-auto no-scrollbar",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-white/5 border-b border-white/5",children:r.map(i=>e.jsx("th",{className:"p-3 text-[8px] font-black text-slate-500 uppercase tracking-widest",children:i},i))})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:n.map((i,a)=>e.jsx("tr",{className:"hover:bg-white/[0.02] transition-colors",children:r.map(d=>e.jsx("td",{className:"p-3 text-[10px] font-medium text-slate-300",children:d.toLowerCase()==="status"?e.jsx("span",{className:we("px-1.5 py-0.5 rounded-full text-[8px] font-black uppercase tracking-widest",i[d]==="Nominal"?"bg-emerald-500/20 text-emerald-500":"bg-amber-500/20 text-amber-500"),children:i[d]}):i[d]},d))},a))})]})})})},et=({data:n})=>n?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-bottom-4 duration-1000",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-tighter italic",children:n.strategicContextTitle||"Neural Strategy"}),e.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:n.matrixSubtitle})]}),n.phases&&e.jsx("div",{className:"relative space-y-6 pl-6 border-l border-white/5",children:n.phases.map((r,i)=>{var a,d;return e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[27px] top-1 w-2.5 h-2.5 rounded-full bg-amber-500 shadow-[0_0_10px_rgba(245,158,11,0.4)] group-hover:scale-125 transition-transform"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:r.title}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:r.milestone})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 bg-white/5 rounded-xl p-3 border border-white/5 group-hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-emerald-500/60 uppercase tracking-widest",children:"Growth Points"}),e.jsx("ul",{className:"space-y-1",children:(a=r.growthPoints)==null?void 0:a.map((m,v)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/40"})," ",m]},v))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-rose-500/60 uppercase tracking-widest",children:"Frictions"}),e.jsx("ul",{className:"space-y-1",children:(d=r.frictions)==null?void 0:d.map((m,v)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-rose-500/40"})," ",m]},v))})]})]})]})]},i)})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.riskSimulations&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Neural Risk Assessment"}),e.jsx("div",{className:"space-y-2",children:n.riskSimulations.map((r,i)=>e.jsxs("div",{className:"p-3 rounded-xl bg-black/20 border border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-300",children:r.threat}),e.jsx("div",{className:"text-[8px] text-slate-500 italic",children:r.mitigation})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:we("text-[9px] font-black uppercase",r.impact==="High"?"text-rose-500":"text-amber-500"),children:[r.impact," Impact"]}),e.jsxs("div",{className:"text-[8px] font-mono text-slate-600",children:[r.probability,"% Prob"]})]})]},i))})]}),n.projections&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Market Projections (2026)"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:Object.entries(n.projections).map(([r,i],a)=>e.jsxs("div",{className:"p-3 rounded-xl bg-amber-500/5 border border-amber-500/10 flex items-center justify-between group hover:bg-amber-500/10 transition-all",children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:r}),e.jsx("span",{className:"text-[10px] font-mono text-amber-500 font-bold",children:i})]},a))}),e.jsx("div",{className:"p-3 rounded-xl bg-white/5 border border-white/5 italic text-[9px] text-slate-500 leading-relaxed",children:n.trajectorySummary})]})]})]}):null,Ge=({data:n})=>{var r;return n?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-right-4 duration-700",children:[n.okrAlignment&&e.jsx("div",{className:"bg-gradient-to-br from-amber-500/10 to-indigo-500/5 rounded-3xl p-6 border border-white/5 flex items-center justify-between shadow-2xl",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:"Neural OKR Alignment"}),e.jsx("div",{className:"flex gap-2",children:(r=n.okrAlignment.frictionPoints)==null?void 0:r.map((i,a)=>e.jsx("span",{className:"text-[8px] bg-rose-500/10 text-rose-400 px-2 py-0.5 rounded-full border border-rose-500/20",children:i},a))})]})}),e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[n.sprints&&n.sprints.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Orchestrated Sprints"}),e.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4 no-scrollbar",children:n.sprints.map((i,a)=>{var d;return e.jsxs("div",{className:"min-w-[240px] p-4 rounded-2xl bg-white/5 border border-white/5 space-y-4 shrink-0 hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-2",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500",children:["SPRINT ",i.id]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:i.allocation?`${i.allocation.reduce((m,v)=>m+(v.load||0),0)} pts`:`${i.velocity||0} pts`})]}),e.jsx("div",{className:"space-y-4",children:i.allocation?i.allocation.map((m,v)=>{var b;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest",children:m.role}),e.jsxs("span",{className:"text-[7px] font-mono text-amber-500/60",children:[m.load,"% Load"]})]}),e.jsx("div",{className:"space-y-1 pl-2 border-l border-amber-500/20",children:(b=m.tasks)==null?void 0:b.map((l,C)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40"})," ",l]},C))})]},v)}):e.jsx("div",{className:"space-y-2",children:(d=i.tasks)==null?void 0:d.map((m,v)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500"})," ",m]},v))})})]},a)})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Critical Dependency Chains"}),n.chains&&n.chains.length>0?e.jsx("div",{className:"space-y-3",children:n.chains.map((i,a)=>{const d=i.sequence||i.nodes||[];return e.jsxs("div",{className:"p-4 rounded-xl bg-black/40 border border-white/5 flex items-center gap-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/10 flex items-center justify-center shrink-0 border border-indigo-500/20",children:e.jsx(D.Activity,{size:14,className:"text-indigo-400"})}),e.jsx("div",{className:"flex-1 flex items-center gap-2 overflow-x-auto no-scrollbar",children:d.map((m,v)=>e.jsxs(s.Fragment,{children:[e.jsx("span",{className:"text-[9px] font-bold text-slate-400 whitespace-nowrap",children:m}),v<d.length-1&&e.jsx("span",{className:"text-slate-700",children:"→"})]},v))})]},a)})}):e.jsx("div",{className:"p-4 rounded-xl bg-white/5 border border-white/5 border-dashed flex items-center justify-center",children:e.jsx("span",{className:"text-[9px] font-black text-slate-600 uppercase tracking-widest italic",children:"No Critical Dependency Chains Detected"})})]})]}),e.jsxs("div",{className:"flex items-center gap-6 pt-4 border-t border-white/5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Compute Load"}),e.jsx("span",{className:"text-[9px] font-mono text-emerald-500",children:n.computeLoad||"IDLE"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Neural Latency"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:n.latency||"0ms"})]})]})]}):null},tt=({threats:n})=>!n||!Array.isArray(n)?null:e.jsxs("div",{className:"space-y-3 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-rose-500 mb-2",children:[e.jsx(D.ShieldAlert,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Active Threat Matrix"})]}),e.jsx("div",{className:"grid gap-3",children:n.map((r,i)=>e.jsxs(Ae.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:i*.1},className:"p-4 rounded-2xl bg-rose-500/5 border border-rose-500/10 flex items-start gap-4 group hover:bg-rose-500/10 transition-all",children:[e.jsx("div",{className:we("w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border",r.impact==="High"?"bg-rose-500/20 border-rose-500/40 text-rose-500":"bg-amber-500/20 border-amber-500/40 text-amber-500"),children:e.jsx(D.AlertTriangle,{size:16})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[11px] font-black text-white uppercase tracking-tight",children:r.threat||r.type}),e.jsxs("span",{className:we("text-[8px] font-black uppercase tracking-widest px-2 py-0.5 rounded-full",r.impact==="High"?"bg-rose-500 text-white":"bg-amber-500 text-black"),children:[r.impact," Risk"]})]}),e.jsxs("p",{className:"text-[10px] text-slate-400 leading-relaxed italic",children:['"',r.mitigation||r.description||"Neural mitigation in progress...",'"']})]})]},i))})]}),at=({data:n})=>!n||!Array.isArray(n)?null:e.jsxs("div",{className:"space-y-4 mt-6 pl-4 border-l border-white/5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-emerald-500 -ml-5 mb-4",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.4)]"}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Regulatory Event Stream"})]}),e.jsx("div",{className:"space-y-4",children:n.map((r,i)=>e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[21px] top-1.5 w-2 h-2 rounded-full bg-slate-800 border border-slate-700 group-hover:bg-emerald-500 transition-colors"}),e.jsxs("div",{className:"bg-white/5 border border-white/5 rounded-2xl p-4 group-hover:border-emerald-500/20 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[10px] font-black text-white uppercase",children:r.action||r.control||"Audit Check"}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:r.time||r.timestamp||"Real-time"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[8px] text-slate-500 uppercase font-black tracking-widest",children:"User:"}),e.jsx("span",{className:"text-[9px] text-slate-300 font-bold",children:r.user||r.subject||"System"})]}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-white/10"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[8px] text-slate-500 uppercase font-black tracking-widest",children:"Status:"}),e.jsx("span",{className:we("text-[8px] font-black uppercase tracking-widest px-1.5 py-0.5 rounded",r.status==="PASS"||r.status==="SUCCESS"||r.status==="CLEARED"?"bg-emerald-500/20 text-emerald-500":"bg-rose-500/20 text-rose-500"),children:r.status})]})]})]})]},i))})]}),rt=({data:n})=>!n||!Array.isArray(n)?null:e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[e.jsx(D.Fingerprint,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Sensitive Data Mapping (PII)"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:n.map((r,i)=>e.jsxs("div",{className:"p-4 rounded-2xl bg-indigo-500/5 border border-indigo-500/10 hover:border-indigo-500/30 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[10px] font-black text-white uppercase tracking-tight",children:r.category||"Data Class"}),e.jsx(D.Shield,{size:12,className:"text-indigo-500/40"})]}),e.jsx("p",{className:"text-[10px] font-medium text-slate-400 mb-2",children:r.dataPoints||r.value||"Encrypted"}),e.jsxs("div",{className:"text-[7px] font-black uppercase text-slate-600 tracking-[0.2em]",children:["Origin: ",r.storageSource||r.source||"Vault"]})]},i))})]}),nt=({data:n})=>{if(!n||typeof n!="object")return null;const r=Object.entries(n).filter(([i,a])=>typeof a!="object"||Array.isArray(a));return e.jsxs("div",{className:"mt-6 w-full rounded-3xl bg-slate-900/40 border border-white/5 overflow-hidden",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D.Database,{size:12,className:"text-slate-500"}),e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Neural Structured Matrix"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),e.jsx("span",{className:"text-[7px] font-black text-emerald-500 uppercase tracking-widest",children:"Live Trace"})]})]}),e.jsx("div",{className:"p-2",children:r.map(([i,a],d)=>e.jsxs("div",{className:we("flex items-center justify-between p-3 rounded-xl hover:bg-white/5 transition-all",d!==r.length-1?"border-b border-white/5":""),children:[e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:i.replace(/([A-Z])/g," $1")}),e.jsx("span",{className:"text-[10px] font-bold text-slate-300",children:Array.isArray(a)?`${a.length} items`:String(a)})]},d))})]})},Ht=({data:n,variant:r})=>{if(!n)return null;let i={label:"Generic Matrix",details:"Raw payload detected"};try{const a=typeof n=="string"?JSON.parse(n):n;if(r==="MAESTRO"){const d=(a.pendingTasks||a.tasks||[]).length,m=(a.resources||a.team||[]).length;i={label:"Maestro Orchestration Matrix",details:`${d} Tasks • ${m} Resources`}}else r==="ANALYST"?i={label:"Analyst Data Stream",details:Array.isArray(a)?`${a.length} Records`:"Structured Dataset"}:r==="SENTINEL"?i={label:"Sentinel Telemetry Logs",details:typeof a=="string"?`${a.length} chars`:"Log Stream"}:i={label:"Neural Input Matrix",details:typeof a=="object"?"Structured Data":"Raw Text"}}catch{}return e.jsxs("div",{className:"mt-2 p-3 rounded-xl bg-black/20 border border-white/5 flex items-center gap-3 group hover:border-amber-500/20 transition-all cursor-default",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center border border-amber-500/20",children:e.jsx(D.Database,{size:14,className:"text-amber-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-black text-amber-500/80 uppercase tracking-widest truncate",children:i.label}),e.jsx("div",{className:"text-[9px] text-slate-500 font-mono",children:i.details})]})]})},Xt=({isOpen:n,onClose:r,input:i,prompt:a,output:d,variant:m})=>{if(!n)return null;const v=i&&(Array.isArray(i)&&i.length>0||typeof i=="object"&&Object.keys(i).length>0),b=()=>{if(!d||typeof d!="object")return e.jsx("pre",{className:"text-[10px] font-mono text-emerald-400/80 leading-relaxed whitespace-pre-wrap",children:String(d)});const l=d;return m==="MAESTRO"||l.tasks||l.sprints?e.jsxs("div",{className:"space-y-6",children:[l.tasks&&e.jsx($e,{tasks:l.tasks,team:l.team}),l.sprints&&e.jsx(Ge,{data:l})]}):m==="STRATEGIST"||l.phases?e.jsx(et,{data:l}):l.threats?e.jsx(tt,{threats:l.threats}):l.auditStream||l.auditResults||l.activeViolations?e.jsx(at,{data:l.auditStream||l.auditResults||l.activeViolations}):l.piiData?e.jsx(rt,{data:l.piiData}):l.nodes||l.metrics||Array.isArray(l.data)?e.jsx(Re,{data:l.nodes||l.metrics||l.data}):l.diagram?e.jsx(ze,{chart:l.diagram}):e.jsx(nt,{data:l})};return e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4 sm:p-10",children:[e.jsx("div",{className:"absolute inset-0 bg-[#020210]/80 backdrop-blur-xl",onClick:r}),e.jsxs("div",{className:"relative w-full h-full max-w-6xl eva-holographic-glass bg-[#0a0a20]/40 rounded-3xl border border-white/10 flex flex-col overflow-hidden shadow-[0_0_100px_rgba(99,102,241,0.1)]",children:[e.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between bg-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center",children:e.jsx(D.Activity,{size:20,className:"text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-widest italic",children:"Neural Transfer Comparator"}),e.jsxs("p",{className:"text-[9px] text-slate-500 uppercase font-bold tracking-widest",children:[m||"Universal"," Orchestration • Real-time Trace"]})]})]}),e.jsx("button",{onClick:r,className:"p-2 rounded-xl text-slate-400 hover:text-white hover:bg-white/5 transition-all",children:e.jsx(D.X,{size:20})})]}),e.jsxs("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[e.jsxs("div",{className:"flex-1 border-r border-white/5 flex flex-col overflow-hidden bg-black/20",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(D.Database,{size:12})," ",v?"Source Matrix":"Generative Prompt"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:v?"Input Stream":"Instruction"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:v?e.jsx("pre",{className:"text-[10px] font-mono text-indigo-200/60 leading-relaxed whitespace-pre-wrap",children:typeof i=="string"?i:JSON.stringify(i,null,2)}):e.jsxs("div",{className:"min-h-full flex flex-col items-center justify-center text-center px-10 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-amber-500/5 flex items-center justify-center mb-4 border border-amber-500/10",children:e.jsx(D.Sparkles,{size:20,className:"text-amber-500/40"})}),e.jsxs("p",{className:"text-xs text-indigo-200/80 font-medium leading-relaxed italic",children:['"',a||"No instruction context captured",'"']}),e.jsx("div",{className:"mt-4 px-3 py-1 rounded-full bg-amber-500/10 border border-amber-500/20 text-[7px] font-black uppercase tracking-[0.2em] text-amber-500/60",children:"Neural Synthesis Mode Active"})]})})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-indigo-500/[0.02]",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(D.Sparkles,{size:12})," Neural Synthesis"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:"Engine Output"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:b()})]})]}),e.jsxs("div",{className:"p-4 border-t border-white/5 flex items-center justify-center gap-8 bg-black/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Ground Truth"})]}),e.jsx("div",{className:"w-12 h-[1px] bg-white/10 relative",children:e.jsx(Ae.motion.div,{className:"absolute top-[-2px] w-1.5 h-1.5 rounded-full bg-indigo-500",animate:{left:["0%","100%","0%"]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500 shadow-[0_0_8px_rgba(99,102,241,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Synergized Output"})]})]})]})]})},Gt=({usage:n,rawPayload:r,inputData:i,variant:a,onInspect:d})=>{const[m,v]=s.useState(!1),b=()=>{navigator.clipboard.writeText(JSON.stringify(r,null,2)),v(!0),setTimeout(()=>v(!1),2e3)};return e.jsxs("div",{className:"mt-16 pt-10 pb-4 px-2 border-t border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[n&&e.jsxs("div",{className:"flex gap-4 p-2 border-r border-white/5 mr-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Input Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:n.inputTokens})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Output Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:n.outputTokens})]})]}),d&&e.jsxs("button",{onClick:d,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-indigo-500/5 border border-indigo-500/10 text-[9px] font-black uppercase tracking-widest text-indigo-400 hover:bg-indigo-500/20 transition-all",children:[e.jsx(D.Activity,{size:12}),"Inspect Neural Transfer"]})]}),e.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-white/5 border border-white/10 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:bg-amber-500/5 hover:border-amber-500/20 transition-all",children:[m?e.jsx(D.Check,{size:12,className:"text-emerald-500"}):e.jsx(D.Copy,{size:12}),m?"Copied":"Copy JSON"]})]})},it={name:"@estevia/evafusion-agent",version:"1.9.3",description:"Premium React-based ChatWizard Agent for EvaFusion Workbench Integration",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist"],scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{"framer-motion":"^10.12.16","lucide-react":"^0.244.0",sonner:"^0.3.1"},peerDependencies:{react:"^18.2.0","react-dom":"^18.2.0","@estevia/evafusion-sdk":"^1.6.9"},devDependencies:{"@estevia/evafusion-sdk":"^1.6.9","@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^4.0.0",autoprefixer:"^10.4.14",postcss:"^8.4.24",tailwindcss:"^3.3.2",typescript:"^5.0.2",vite:"^4.3.9","vite-plugin-dts":"^2.3.0"}},Qt={ARCHITECT:"System blueprinting & infrastructure design",STRATEGIST:"Roadmap planning & market penetration",MAESTRO:"Resource orchestration & sprint management",ANALYST:"Data-driven discovery & trend projection",PULSE:"Workforce sentiment & cultural resonance",RECRUITER:"Talent sourcing & resonance scoring",SENTINEL:"Real-time threat detection & industrial safety",COMPLIANCE:"Regulatory audit & privacy enforcement"},je=Ne.VARIANT_REQUIREMENTS||{ARCHITECT:"OPTIONAL",ANALYST:"MANDATORY",STRATEGIST:"OPTIONAL",RECRUITER:"OPTIONAL",SENTINEL:"MANDATORY",MAESTRO:"HYBRID",COMPLIANCE:"MANDATORY",PULSE:"MANDATORY",NEXUS:"OPTIONAL"},Yt=({onClose:n,onMinimize:r})=>{const i=s.useContext(Xe),[a,d]=s.useState(!1);s.useState(!1);const m=s.useRef(null);if(!i)return null;const{messages:v,input:b,setInput:l,isProcessing:C,activeVariant:N,setActiveVariant:y,handleSend:k,payloadConfig:G,updatePayloadConfig:W,samples:te,selectedSampleId:ae,setSelectedSampleId:$,applySample:I,clearChat:me,isAuthorized:B}=_e(),[x,E]=s.useState(G),[z,ce]=s.useState(N),[f,re]=s.useState(ae),[g,L]=s.useState({isValid:!0,error:null}),[u,T]=s.useState(null),F=s.useRef(null);s.useEffect(()=>{a&&(E(G),ce(N),re(ae))},[a]),s.useEffect(()=>{const A=Ne.NeuralDataUtils.validatePayload(z,x.data);L(A)},[x.data,z]);const de=A=>{var K;const H=(K=A.target.files)==null?void 0:K[0];if(!H)return;const p=new FileReader;p.onload=se=>{var X;const pe=(X=se.target)==null?void 0:X.result,Z=Ne.NeuralDataUtils.parseCSV(pe);E(Q=>({...Q,data:JSON.stringify(Z,null,2)})),re("")},p.readAsText(H)},O=()=>{const A=Ne.NeuralDataUtils.normalizeForWorkbench(z,x.data);E(H=>({...H,data:JSON.stringify(A,null,2)}))},ge=()=>{y(z),W(x),$(f),d(!1)};s.useEffect(()=>{E(A=>({...A,data:null}))},[z]);const ue=[{id:"SOFTWARE_DEV",name:"Software & Cloud"},{id:"FINANCE",name:"Finance & Quants"},{id:"HEALTHCARE",name:"Healthcare & Life"},{id:"MANUFACTURING",name:"Industrial & MFG"},{id:"REAL_ESTATE",name:"Real Estate & Const."},{id:"RETAIL",name:"Retail & Commerce"},{id:"EDUCATION",name:"Education & Learning"}],Be=()=>{var A;(A=m.current)==null||A.scrollIntoView({behavior:"smooth"})};s.useEffect(()=>{Be()},[v,C]);const Pe=({msg:A})=>{const{content:H,rawPayload:p,usage:K}=A,se=H.split(/(?=### )/g),pe=X=>{const Q=X.trim();return Q.startsWith("{")&&Q.endsWith("}")||Q.startsWith("[")&&Q.endsWith("]")},Z=X=>X.includes("```mermaid")?X.split(/```mermaid([\s\S]*?)```/).map((Y,S)=>S%2===1?e.jsx(ze,{chart:Y.trim()},S):e.jsx("div",{children:Z(Y)},S)):X.split(`
|
|
153
153
|
`).map((Q,Y)=>{const S=Q.trim();if(!S)return e.jsx("div",{className:"h-2"},Y);if(S.startsWith("- ")||S.startsWith("* ")||S.match(/^\d+\. /))return e.jsxs("div",{className:"flex gap-2 items-start mb-1.5 pl-2 group",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500/60 mt-1.5 shrink-0 group-hover:scale-125 transition-transform"}),e.jsx("span",{className:"text-[11px] leading-relaxed text-slate-300",children:S.replace(/^- |\* |\d+\. /,"")})]},Y);const ve=S.split(/(\*\*.*?\*\*)/g);return e.jsx("p",{className:"mb-2 leading-relaxed text-slate-300",children:ve.map((_,xe)=>_.startsWith("**")&&_.endsWith("**")?e.jsx("strong",{className:"text-amber-500/90 font-black",children:_.slice(2,-2)},xe):_)},Y)});return e.jsxs("div",{className:"space-y-4",children:[se.map((X,Q)=>{if(pe(X))return null;if(X.startsWith("### ")){const Y=X.split(`
|
|
154
154
|
`),S=Y[0].replace("### ",""),ve=Y.slice(1).join(`
|
|
155
155
|
`),_=S.toLowerCase().includes("blueprint"),xe=/^\s*(graph|flowchart|sequenceDiagram|gantt|classDiagram|stateDiagram|erDiagram|pie|journey|C4Context|mindmap|timeline)/i.test(ve.trim());return e.jsxs("div",{className:ie("group relative",_?"p-4 rounded-2xl bg-amber-500/5 border border-amber-500/10 mt-6":""),children:[_&&e.jsx("div",{className:"absolute top-0 right-0 p-2 opacity-20 group-hover:opacity-100 transition-opacity",children:e.jsx(D.Sparkles,{size:12,className:"text-amber-500"})}),e.jsxs("h4",{className:ie("text-[9px] font-black uppercase tracking-[0.2em] mb-3 flex items-center gap-2",_?"text-amber-500":"text-slate-500"),children:[!_&&e.jsx("div",{className:"w-1 h-3 bg-amber-500/20 rounded-full"}),S,_&&e.jsxs("span",{className:"text-[7px] bg-amber-500/20 px-1.5 py-0.5 rounded text-amber-500 ml-auto",children:["Neural Core v",it.version]})]}),e.jsx("div",{className:ie("font-sans",_?"font-mono text-[10px] text-amber-500/70":""),children:xe?e.jsx(ze,{chart:ve.trim()}):Z(ve)})]},Q)}return e.jsx("div",{children:Z(X)},Q)}),p&&e.jsxs(e.Fragment,{children:[p.tasks&&e.jsx($e,{tasks:p.tasks,team:p.team}),p.phases&&e.jsx(et,{data:p}),p.sprints&&e.jsx(Ge,{data:p}),p.chains&&e.jsx(Ge,{data:p}),p.nodes&&e.jsx(Re,{data:p.nodes}),p.metrics&&e.jsx(Re,{data:p.metrics}),p.threats&&e.jsx(tt,{threats:p.threats}),(p.auditStream||p.auditResults||p.activeViolations)&&e.jsx(at,{data:p.auditStream||p.auditResults||p.activeViolations}),p.piiData&&e.jsx(rt,{data:p.piiData}),Array.isArray(p.data)&&e.jsx(Re,{data:p.data}),p.diagram&&e.jsx(ze,{chart:p.diagram}),(()=>{const X=["tasks","team","phases","sprints","chains","nodes","metrics","threats","auditStream","auditResults","activeViolations","piiData","data","diagram","usage","metadata","focus","ingestionType"];return Object.entries(p).filter(([Y,S])=>!X.includes(Y)&&typeof S=="object"&&S!==null).map(([Y,S],ve)=>e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-2 px-1",children:[Y.replace(/([A-Z])/g," $1")," Matrix"]}),Array.isArray(S)?e.jsx(Re,{data:S}):e.jsx(nt,{data:S})]},Y))})()]}),e.jsx(Gt,{usage:K,rawPayload:p,inputData:A.inputData,variant:A.variant,onInspect:p?()=>T({input:A.inputData,prompt:A.content,output:p,variant:A.variant}):void 0})]})};return e.jsxs(e.Fragment,{children:[e.jsx(Ae.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/40 backdrop-blur-sm z-[9990]"}),e.jsxs(Ae.motion.div,{initial:{x:"100%",opacity:.5},animate:{x:0,opacity:1},exit:{x:"100%",opacity:.5},transition:{type:"spring",damping:25,stiffness:200},className:ie("fixed top-0 right-0 h-full w-full sm:max-w-[480px] z-[9991] flex flex-col eva-holographic-glass overflow-hidden border-l border-white/10 shadow-2xl",C?"eva-glow-thinking":"eva-glow-listening"),children:[e.jsxs("div",{className:"p-6 flex items-center justify-between shrink-0 bg-[#0a0a20]/90 border-b border-white/5 backdrop-blur-xl",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Ke,alt:"Eva",className:"w-7 h-7 object-contain"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-black text-white uppercase tracking-widest italic eva-agent-gradient-text",children:["Eva Agent ",e.jsxs("span",{className:"text-indigo-400 font-normal ml-1",children:["v",it.version]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:ie("w-1.5 h-1.5 rounded-full animate-pulse",B?"bg-emerald-500":"bg-rose-500")}),e.jsx("span",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:B?"Neural Link Active":"Unauthorized Access"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:me,title:"Clear Neural Context",className:"p-2 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-rose-500/10 transition-all",children:e.jsx(D.Trash2,{size:16})}),e.jsxs("button",{onClick:()=>d(!a),className:ie("p-2 rounded-lg transition-all group/settings relative",a?"bg-amber-500/20 text-amber-500":"text-slate-400 hover:text-white hover:bg-white/5"),children:[e.jsx(D.Settings2,{size:16}),e.jsx("div",{className:"absolute top-full right-0 mt-2 px-2 py-1 bg-amber-500 text-black text-[8px] font-black uppercase tracking-widest rounded whitespace-nowrap opacity-0 group-hover/settings:opacity-100 transition-opacity pointer-events-none z-[100] shadow-xl",children:"Neural Configuration"})]}),e.jsx("button",{onClick:r,className:"p-2 rounded-lg text-slate-400 hover:text-white hover:bg-white/5 transition-all",children:e.jsx(D.Minimize,{size:16})}),e.jsx("button",{onClick:n,className:"p-2 rounded-lg text-rose-400 hover:text-rose-300 hover:bg-rose-500/10 transition-all",children:e.jsx(D.X,{size:16})})]})]}),e.jsx("div",{className:"px-6 py-2 flex items-center gap-2 overflow-x-auto eva-agent-scrollbar bg-black/20 border-b border-white/5 no-scrollbar",children:["ARCHITECT","STRATEGIST","MAESTRO","ANALYST","PULSE","RECRUITER","SENTINEL","COMPLIANCE"].map(A=>e.jsxs("div",{className:"relative group/variant",children:[e.jsxs("button",{onClick:()=>y(A),className:ie("px-3 py-1 rounded-full text-[8px] font-black uppercase tracking-widest transition-all whitespace-nowrap border flex items-center",N===A?"shadow-[0_0_15px_rgba(212,175,55,0.3)] border-amber-500":"text-slate-400 border-white/5 hover:border-white/20 hover:text-white"),style:{backgroundColor:N===A?"#d4af37":"transparent",color:N===A?"black":void 0},children:[A,je[A]==="MANDATORY"&&e.jsx("div",{className:ie("w-1 h-1 rounded-full ml-1.5 shadow-[0_0_5px_rgba(245,158,11,1)]",N===A?"bg-black":"bg-amber-500")})]}),e.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 px-2 py-1 bg-[#0a0a20] border border-amber-500/30 text-amber-500 text-[7px] font-black uppercase tracking-[0.1em] rounded whitespace-nowrap opacity-0 group-hover/variant:opacity-100 transition-opacity pointer-events-none z-[100] shadow-2xl backdrop-blur-md",children:Qt[A]})]},A))}),e.jsx("div",{className:"flex-1 overflow-y-auto eva-agent-scrollbar p-6 space-y-6 relative",children:B?v.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 space-y-8",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 bg-amber-500/5 rounded-full blur-3xl animate-pulse"}),e.jsx(D.Cpu,{size:64,className:"text-amber-500/20 relative z-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-lg font-black text-white uppercase tracking-tighter italic",children:"Awaiting Directives"}),e.jsx("p",{className:"text-[9px] text-slate-500 uppercase tracking-[0.2em] font-bold",children:"Invoke Eva Intelligence to process your neural matrix."})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 w-full max-w-[280px]",children:["Analyze data for anomalies","Synthesize architecture blueprint","Forecast operational trajectory"].map((A,H)=>e.jsx("button",{onClick:()=>k(A),className:"p-3 rounded-xl bg-white/5 border border-white/5 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:bg-amber-500/5 hover:border-amber-500/20 transition-all text-left",children:A},H))})]}):e.jsxs(e.Fragment,{children:[v.map((A,H)=>e.jsxs("div",{className:ie("flex flex-col space-y-2",A.role==="user"?"items-end":"items-start"),children:[e.jsx("div",{className:ie("max-w-[90%] px-7 py-6 rounded-3xl text-[11px] font-medium leading-relaxed whitespace-pre-wrap break-words shadow-xl",A.role==="user"?"bg-gradient-to-br from-amber-500 to-amber-600 text-white rounded-tr-none":"bg-slate-900/80 text-indigo-100/90 border border-white/5 rounded-tl-none backdrop-blur-xl"),style:{color:A.role==="user"?"white":void 0},children:A.role==="user"?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{children:A.content}),A.inputData&&e.jsx(Ht,{data:A.inputData,variant:A.variant})]}):e.jsx(Pe,{msg:A})}),e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest px-2",children:A.role==="user"?"Direct Input":`Eva ${A.variant||"Neural"}`})]},H)),C&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-6",children:[e.jsxs("div",{className:"relative w-24 h-24",children:[e.jsx(Ae.motion.div,{className:"absolute inset-0 rounded-full border-2 border-amber-500/10",animate:{scale:[1,1.4,1],opacity:[.1,.3,.1]},transition:{duration:3,repeat:1/0}}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"relative",children:[e.jsx(D.Cpu,{className:"text-amber-500/80",size:32}),e.jsx(Ae.motion.div,{className:"absolute inset-0 text-amber-500 blur-sm",animate:{opacity:[.2,.6,.2]},transition:{duration:2,repeat:1/0},children:e.jsx(D.Cpu,{size:32})})]})}),e.jsx(Ae.motion.div,{className:"absolute left-[-20%] right-[-20%] h-[1px] bg-gradient-to-r from-transparent via-amber-500 to-transparent shadow-[0_0_20px_rgba(245,158,11,0.6)] z-10",animate:{top:["10%","90%","10%"]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"}})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-black text-amber-500 uppercase tracking-[0.4em] animate-pulse",children:"Neural Synthesis in Progress"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40 animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40 animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40 animate-bounce",style:{animationDelay:"300ms"}})]})]})]}),e.jsx("div",{ref:m})]}):e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 space-y-4",children:[e.jsx(D.AlertCircle,{size:48,className:"text-rose-500/40 mb-2"}),e.jsx("h4",{className:"text-sm font-black text-white uppercase tracking-widest",children:"Neural Link Restricted"}),e.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest leading-relaxed max-w-[240px]",children:"Authentication failed. Please verify your API Key context to re-establish the neural link."})]})}),e.jsx(Ae.AnimatePresence,{children:a&&e.jsxs(Ae.motion.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},className:"absolute inset-0 bg-[#0a0a20]/95 backdrop-blur-3xl z-50 flex flex-col border-t border-white/10",children:[e.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("h4",{className:"text-xs font-black text-white uppercase tracking-widest flex items-center gap-2",children:[e.jsx(D.Database,{size:14,className:"text-amber-500"}),"Neural Configuration"]}),e.jsx("button",{onClick:()=>d(!1),className:"text-slate-400 hover:text-white",children:e.jsx(D.X,{size:16})})]}),e.jsxs("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto eva-agent-scrollbar",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Neural Persona (Workbench)"}),e.jsx("select",{value:z,onChange:A=>ce(A.target.value),className:"w-full bg-[#0a0a20] border border-white/10 rounded-xl p-3 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",style:{color:"white",backgroundColor:"#0a0a20"},children:["ARCHITECT","STRATEGIST","MAESTRO","ANALYST","PULSE","RECRUITER","SENTINEL","COMPLIANCE"].map(A=>e.jsx("option",{value:A,style:{color:"white",backgroundColor:"#0a0a20"},children:A},A))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Industry Vertical"}),e.jsx("select",{value:x.vertical,onChange:A=>E(H=>({...H,vertical:A.target.value})),className:"w-full bg-[#0a0a20] border border-white/10 rounded-xl p-3 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",style:{color:"white",backgroundColor:"#0a0a20"},children:ue.map(A=>e.jsx("option",{value:A.id,style:{color:"white",backgroundColor:"#0a0a20"},children:A.name},A.id))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Focus Mode"}),e.jsxs("select",{value:x.focus,onChange:A=>E(H=>({...H,focus:A.target.value})),className:"w-full bg-[#0a0a20] border border-white/10 rounded-xl p-3 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",style:{color:"white",backgroundColor:"#0a0a20"},children:[e.jsx("option",{value:"DISCOVERY",style:{color:"white",backgroundColor:"#0a0a20"},children:"Discovery"}),e.jsx("option",{value:"ROADMAP",style:{color:"white",backgroundColor:"#0a0a20"},children:"Roadmap"}),e.jsx("option",{value:"ORCHESTRATION",style:{color:"white",backgroundColor:"#0a0a20"},children:"Orchestration"}),e.jsx("option",{value:"ANOMALIES",style:{color:"white",backgroundColor:"#0a0a20"},children:"Anomalies"}),e.jsx("option",{value:"FORECAST",style:{color:"white",backgroundColor:"#0a0a20"},children:"Forecast"}),e.jsx("option",{value:"SCORING",style:{color:"white",backgroundColor:"#0a0a20"},children:"Scoring"}),e.jsx("option",{value:"AUDIT",style:{color:"white",backgroundColor:"#0a0a20"},children:"Audit"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Neural Template (Sample)"}),e.jsxs("select",{value:f,onChange:A=>{const H=A.target.value;re(H);const p=Ie.find(K=>K.id===H);if(p){let K=p.data;if(p.variant==="MAESTRO"&&p.team&&(p.tasks||p.data)){const se=p.tasks||(typeof p.data=="string"?JSON.parse(p.data):p.data);K={pendingTasks:Array.isArray(se)?se:[],resources:p.team}}E({vertical:p.vertical||"TECH_SaaS",focus:p.focus||"DISCOVERY",data:K}),p.prompt&&l(p.prompt)}},className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 h-11 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",children:[e.jsx("option",{value:"",style:{color:"#64748b",backgroundColor:"#0a0a20"},children:"Manual Input (No Template)"}),Ie.filter(A=>A.vertical===x.vertical&&A.variant===z).map(A=>e.jsxs("option",{value:A.id,style:{color:"white",backgroundColor:"#0a0a20"},children:[A.name,A.data?" [DATA]":" [PROMPT]"]},A.id))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D.Database,{size:12,className:"text-amber-500"}),e.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:"Neural Matrix (JSON)"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"file",accept:".csv",className:"hidden",ref:F,onChange:de}),e.jsxs("button",{onClick:()=>{var A;return(A=F.current)==null?void 0:A.click()},className:"flex items-center gap-1.5 px-2 py-1 rounded bg-white/5 border border-white/10 text-[8px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:border-amber-500/20 transition-all",children:[e.jsx(D.Upload,{size:10})," Ingest CSV"]}),z==="MAESTRO"&&e.jsxs("button",{onClick:O,className:"flex items-center gap-1.5 px-2 py-1 rounded bg-indigo-500/10 border border-indigo-500/20 text-[8px] font-black uppercase tracking-widest text-indigo-400 hover:bg-indigo-500/20 transition-all",children:[e.jsx(D.Zap,{size:10})," Optimize Maestro"]})]})]}),e.jsx("textarea",{value:x.data?typeof x.data=="string"?x.data:JSON.stringify(x.data,null,2):"",onChange:A=>{E(H=>({...H,data:A.target.value})),re("")},placeholder:'[{"key": "value"}]',className:ie("w-full bg-black/40 border rounded-xl p-4 text-[10px] font-mono text-indigo-200/60 outline-none h-32 resize-none transition-all",g.isValid?g.warning?"border-amber-500/40":"border-white/10 focus:border-amber-500/40":"border-red-500/40")}),e.jsxs("div",{className:"mt-2 flex items-center justify-between px-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[g.isValid?g.warning?e.jsx(D.AlertTriangle,{size:10,className:"text-amber-500"}):e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}):e.jsx(D.AlertCircle,{size:10,className:"text-red-500"}),e.jsx("span",{className:ie("text-[8px] font-bold uppercase tracking-widest",g.isValid?g.warning?"text-amber-500":"text-emerald-500":"text-red-500"),children:g.isValid?g.warning?"Validation Warning":"Neural Integrity Established":"Schema Disconnect"})]}),g.schemaDetails&&e.jsx("span",{className:"text-[7px] font-mono text-slate-600 uppercase tracking-tighter truncate max-w-[200px]",children:g.schemaDetails})]}),!g.isValid&&g.error&&e.jsxs("div",{className:"mt-3 p-3 rounded-xl bg-red-500/5 border border-red-500/10 flex items-start gap-2",children:[e.jsx(D.AlertCircle,{size:12,className:"text-red-500 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-[9px] text-red-400/80 leading-relaxed font-medium",children:g.error})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Current Neural Prompt (Preview)"}),e.jsx("div",{className:"w-full bg-amber-500/5 border border-amber-500/10 rounded-xl p-4 text-[10px] font-medium text-slate-300 min-h-[60px] max-h-[120px] overflow-y-auto italic leading-relaxed",children:b||(ae?"Neural template active. Ready for synthesis.":"Type in chat to preview prompt...")})]}),e.jsxs("div",{className:"pt-4 pb-8",children:[e.jsxs("button",{onClick:ge,disabled:je[z]==="MANDATORY"&&(!x.data||typeof x.data=="string"&&!x.data.trim()),className:ie("w-full py-4 rounded-xl text-white text-[10px] font-black uppercase tracking-[0.2em] shadow-lg transition-all flex items-center justify-center gap-2",je[z]==="MANDATORY"&&(!x.data||typeof x.data=="string"&&!x.data.trim())?"bg-white/5 text-white/20 border border-white/10 cursor-not-allowed shadow-none":"bg-amber-500 hover:scale-[1.02] active:scale-[0.98] shadow-amber-500/20"),children:[e.jsx(D.Shield,{size:14}),je[z]==="MANDATORY"&&(!x.data||typeof x.data=="string"&&!x.data.trim())?"Awaiting Grounding Data":"Confirm Neural Configuration"]}),e.jsx("p",{className:"text-[7px] text-slate-500 text-center mt-3 uppercase tracking-widest font-bold",children:"Settings will be committed to the synthesis engine"})]})]})]})}),e.jsxs("div",{className:"p-6 pb-8 bg-[#0a0a20] border-t border-white/5 relative z-40",children:[je[N]==="MANDATORY"&&(!G.data||typeof G.data=="string"&&!G.data.trim())&&!a&&e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-[#0a0a20]/80 backdrop-blur-sm px-6 pb-2 animate-in fade-in duration-300",children:e.jsxs("button",{onClick:()=>d(!0),className:"w-full h-12 rounded-xl bg-amber-500/10 border border-amber-500/20 text-amber-500 text-[10px] font-black uppercase tracking-[0.15em] hover:bg-amber-500 hover:text-black transition-all flex items-center justify-center gap-2 shadow-2xl shadow-amber-500/5 group",children:[e.jsx(D.Database,{size:14,className:"group-hover:animate-bounce"}),"Grounding Required: Open Neural Configuration"]})}),e.jsxs("form",{onSubmit:A=>{A.preventDefault(),k()},className:"relative flex items-center gap-3 p-2 rounded-2xl bg-white/5 border border-white/10 group focus-within:border-amber-500/40 focus-within:shadow-[0_0_30px_rgba(212,175,55,0.1)] transition-all duration-500",children:[e.jsx("textarea",{value:b,onChange:A=>l(A.target.value),onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),k())},placeholder:"Invoke neural command...",className:"flex-1 bg-transparent border-none text-white text-[11px] placeholder:text-slate-600 focus:ring-0 min-h-[44px] max-h-[120px] py-3 px-3 resize-none eva-agent-scrollbar outline-none font-medium",disabled:C||!B}),e.jsx("button",{type:"submit",disabled:!b.trim()||C||!B||je[N]==="MANDATORY"&&(!G.data||typeof G.data=="string"&&!G.data.trim()),className:"w-11 h-11 rounded-xl bg-amber-500 text-white flex items-center justify-center shrink-0 shadow-lg shadow-amber-500/20 disabled:opacity-30 disabled:grayscale transition-all hover:scale-105 active:scale-95",children:e.jsx(D.Send,{size:18,className:"text-white"})})]})]}),e.jsx(Xt,{isOpen:!!u,onClose:()=>T(null),input:(u==null?void 0:u.input)||null,prompt:(u==null?void 0:u.prompt)||"",output:(u==null?void 0:u.output)||null,variant:(u==null?void 0:u.variant)||""})]})]})},Ut={PROD:"https://evafusion-live.esteviatech.com",DEV:"https://api-dev.protrack.esteviatech.com",QA:"https://api-qa.protrack.esteviatech.com",LOCAL:"http://localhost:5001"},Vt=n=>{const{apiKey:r,baseUrl:i,environment:a="PROD",persist:d=!0,theme:m="dark"}=n,[v,b]=s.useState(!1),[l,C]=s.useState(!1),N=s.useMemo(()=>{if(!r)return null;const y=i||Ut[a];return new Ne.EvaFusionClient({apiKey:r,baseUrl:y,environment:a})},[r,i,a]);return e.jsx(Xe.Provider,{value:{client:N,isOpen:v,setIsOpen:b,isMinimized:l,setIsMinimized:C,config:n},children:e.jsxs("div",{className:"eva-fusion-agent-root",children:[e.jsx(It,{position:"top-center",richColors:!0}),e.jsx(Ae.AnimatePresence,{children:(!v||l)&&e.jsx(zt,{onClick:()=>{b(!0),C(!1)}})}),e.jsx(Ae.AnimatePresence,{children:v&&!l&&e.jsx(Yt,{onClose:()=>b(!1),onMinimize:()=>C(!0)})})]})})},Ca="";oe.EvaFusionAgent=Vt,oe.useEvaAgent=_e,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.mjs
CHANGED
|
@@ -2589,7 +2589,7 @@ const Le = ({ chart: n }) => {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
)
|
|
2591
2591
|
] });
|
|
2592
|
-
}, Sa = "@estevia/evafusion-agent", Ia = "1.9.
|
|
2592
|
+
}, Sa = "@estevia/evafusion-agent", Ia = "1.9.3", za = "Premium React-based ChatWizard Agent for EvaFusion Workbench Integration", La = "dist/index.js", Ha = "dist/index.mjs", Xa = "dist/index.d.ts", Ga = [
|
|
2593
2593
|
"dist"
|
|
2594
2594
|
], Qa = {
|
|
2595
2595
|
dev: "vite",
|
|
@@ -2602,9 +2602,9 @@ const Le = ({ chart: n }) => {
|
|
|
2602
2602
|
}, Ua = {
|
|
2603
2603
|
react: "^18.2.0",
|
|
2604
2604
|
"react-dom": "^18.2.0",
|
|
2605
|
-
"@estevia/evafusion-sdk": "^1.6.
|
|
2605
|
+
"@estevia/evafusion-sdk": "^1.6.9"
|
|
2606
2606
|
}, Va = {
|
|
2607
|
-
"@estevia/evafusion-sdk": "^1.6.
|
|
2607
|
+
"@estevia/evafusion-sdk": "^1.6.9",
|
|
2608
2608
|
"@types/react": "^18.0.28",
|
|
2609
2609
|
"@types/react-dom": "^18.0.11",
|
|
2610
2610
|
"@vitejs/plugin-react": "^4.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@estevia/evafusion-agent",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "Premium React-based ChatWizard Agent for EvaFusion Workbench Integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"react": "^18.2.0",
|
|
23
23
|
"react-dom": "^18.2.0",
|
|
24
|
-
"@estevia/evafusion-sdk": "^1.6.
|
|
24
|
+
"@estevia/evafusion-sdk": "^1.6.9"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@estevia/evafusion-sdk": "^1.6.
|
|
27
|
+
"@estevia/evafusion-sdk": "^1.6.9",
|
|
28
28
|
"@types/react": "^18.0.28",
|
|
29
29
|
"@types/react-dom": "^18.0.11",
|
|
30
30
|
"@vitejs/plugin-react": "^4.0.0",
|