PageSourceSearch

https://socialselling.ai/_next/static/chunks/64333.75a77bf51687b9af.js

js socialselling.ai collected 2026-10-05 14:51:53 UTC 32,027 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[64333],{64333:function(e,a,t){t.r(a),t.d(a,{default:function(){return O}});var s=t(57437),l=t(2265),r=t(87242),d=t(99376),n=t(17580),i=t(69430),o=t(98617),c=t(66142),m=t(49474),x=t(46221),u=t(15863),h=t(63639),g=t(98420),b=t(95805),v=t(82431),p=t(92735),f=t(58896),j=t(95252),y=t(13041),N=t(76399),w=t(70525),k=t(10407),_=t(11239),C=t(49663),Z=t(12194),T=t(31047),S=t(53417),L=t(82023),M=t(93448),R=t(84881),E=t(96246),V=t(15291),A=t(71837);let Q={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.05,delayChildren:.1}}},D={hidden:{opacity:0,y:15},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:120,damping:20}}},F=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:0,maximumFractionDigits:0}).format(e),z=e=>{let{children:a,className:t,gradient:l="emerald",onClick:d}=e;return(0,s.jsxs)(r.E.div,{variants:D,onClick:d,className:(0,M.cn)("relative overflow-hidden rounded-2xl",d&&"cursor-pointer hover:scale-[1.02] transition-transform",t),children:[(0,s.jsx)("div",{className:(0,M.cn)("absolute inset-0 bg-gradient-to-br",{emerald:"from-emerald-500/10 via-teal-500/5 to-cyan-500/10",purple:"from-purple-500/10 via-violet-500/5 to-indigo-500/10",amber:"from-amber-500/10 via-orange-500/5 to-yellow-500/10",blue:"from-blue-500/10 via-cyan-500/5 to-sky-500/10",rose:"from-rose-500/10 via-pink-500/5 to-red-500/10",cyan:"from-cyan-500/10 via-sky-500/5 to-blue-500/10",indigo:"from-indigo-500/10 via-blue-500/5 to-violet-500/10"}[l])}),(0,s.jsx)("div",{className:"relative backdrop-blur-sm bg-white/90 dark:bg-slate-900/90 border border-gray-100 dark:border-slate-800 rounded-2xl p-4 shadow-lg h-full",children:a})]})},P=e=>{let{title:a,value:t,subValue:l,icon:d,trend:o,trendValue:c,color:m,onClick:x}=e,u={emerald:{bg:"bg-emerald-500",icon:"text-white",text:"text-emerald-600"},blue:{bg:"bg-blue-500",icon:"text-white",text:"text-blue-600"},amber:{bg:"bg-amber-500",icon:"text-white",text:"text-amber-600"},rose:{bg:"bg-rose-500",icon:"text-white",text:"text-rose-600"},purple:{bg:"bg-purple-500",icon:"text-white",text:"text-purple-600"},indigo:{bg:"bg-indigo-500",icon:"text-white",text:"text-indigo-600"}},h=u[m]||u.emerald;return(0,s.jsxs)(r.E.div,{variants:D,onClick:x,className:(0,M.cn)("relative overflow-hidden rounded-xl p-4 min-h-[110px]",h.bg,x&&"cursor-pointer hover:opacity-90 transition-opacity"),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-white/80",children:a}),(0,s.jsx)("p",{className:"text-2xl font-bold text-white mt-1",children:t}),l&&(0,s.jsx)("p",{className:"text-xs text-white/70 mt-1",children:l})]}),(0,s.jsx)("div",{className:"w-10 h-10 rounded-xl bg-white/20 flex items-center justify-center",children:(0,s.jsx)(d,{className:"w-5 h-5 text-white"})})]}),o&&c&&(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-2",children:["up"===o?(0,s.jsx)(n.Z,{className:"w-3 h-3 text-white"}):"down"===o?(0,s.jsx)(i.Z,{className:"w-3 h-3 text-white"}):null,(0,s.jsx)("span",{className:"text-xs text-white/90",children:c})]})]})},q=e=>{let{member:a,onClick:t}=e,l={1:o.Z,2:c.Z,3:m.Z},d=a.rank<=3?l[a.rank]:null,x=a.metrics.target>0?Math.round(a.metrics.achieved/a.metrics.target*100):0;return(0,s.jsx)(r.E.div,{variants:D,onClick:t,className:(0,M.cn)("bg-white dark:bg-slate-900 rounded-xl p-4 border border-gray-100 dark:border-slate-800","hover:border-emerald-200 dark:hover:border-emerald-800 transition-all",t&&"cursor-pointer"),children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)(E.qE,{className:"w-12 h-12",children:[(0,s.jsx)(E.F$,{src:a.avatar}),(0,s.jsx)(E.Q5,{className:"bg-gradient-to-br from-emerald-400 to-teal-500 text-white font-semibold",children:a.name.split(" ").map(e=>e[0]).join("")})]}),(0,s.jsx)("div",{className:(0,M.cn)("absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 rounded-full border-2 border-white dark:border-slate-900",{online:"bg-emerald-500",busy:"bg-amber-500",offline:"bg-gray-400"}[a.status])}),d&&(0,s.jsx)("div",{className:"absolute -top-1 -left-1 w-5 h-5 rounded-full bg-amber-100 flex items-center justify-center",children:(0,s.jsx)(d,{className:"w-3 h-3 text-amber-600"})})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-gray-900 dark:text-white text-sm truncate",children:a.name}),(0,s.jsx)("p",{className:"text-xs text-gray-500",children:a.role})]}),(0,s.jsxs)("div",{className:(0,M.cn)("flex items-center gap-1 text-xs font-medium","up"===a.trend?"text-emerald-600":"down"===a.trend?"text-red-500":"text-gray-500"),children:["up"===a.trend?(0,s.jsx)(n.Z,{className:"w-3 h-3"}):"down"===a.trend?(0,s.jsx)(i.Z,{className:"w-3 h-3"}):null,F(a.metrics.revenue)]})]}),(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Target Progress"}),(0,s.jsxs)("span",{className:(0,M.cn)("font-medium",x>=100?"text-emerald-600":x>=75?"text-amber-600":"text-red-500"),children:[x,"%"]})]}),(0,s.jsx)("div",{className:"h-1.5 bg-gray-100 dark:bg-slate-800 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:(0,M.cn)("h-full rounded-full transition-all",x>=100?"bg-emerald-500":x>=75?"bg-amber-500":"bg-red-500"),style:{width:"".concat(Math.min(x,100),"%")}})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-2 mt-3",children:[(0,s.jsxs)("div",{className:"text-center p-1.5 bg-gray-50 dark:bg-slate-800 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-900 dark:text-white",children:a.metrics.leads}),(0,s.jsx)("p",{className:"text-[10px] text-gray-500",children:"Leads"})]}),(0,s.jsxs)("div",{className:"text-center p-1.5 bg-gray-50 dark:bg-slate-800 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-900 dark:text-white",children:a.metrics.calls}),(0,s.jsx)("p",{className:"text-[10px] text-gray-500",children:"Calls"})]}),(0,s.jsxs)("div",{className:"text-center p-1.5 bg-gray-50 dark:bg-slate-800 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-900 dark:text-white",children:a.metrics.conversions}),(0,s.jsx)("p",{className:"text-[10px] text-gray-500",children:"Deals"})]})]})]})]})})},I=e=>{let{stages:a}=e,t=Math.max(...a.map(e=>e.value));return(0,s.jsxs)(z,{gradient:"purple",className:"h-full",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-purple-100 dar
1k:bg-purple-900/30 flex items-center justify-center",children:(0,s.jsx)(x.Z,{className:"w-4 h-4 text-purple-600"})}),(0,s.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Sales Pipeline"})]}),(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:["Total: ",F(a.reduce((e,a)=>e+a.value,0))]})]}),(0,s.jsx)("div",{className:"space-y-3",children:a.map((e,a)=>(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:[e.count," leads"]}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:F(e.value)})]})]}),(0,s.jsx)("div",{className:"h-2 bg-gray-100 dark:bg-slate-800 rounded-full overflow-hidden",children:(0,s.jsx)(r.E.div,{initial:{width:0},animate:{width:"".concat(e.value/t*100,"%")},transition:{delay:.2+.1*a,duration:.6},className:(0,M.cn)("h-full rounded-full",e.color)})})]},e.name))})]})},B=e=>{let{members:a}=e,t=[...a].sort((e,a)=>a.metrics.revenue-e.metrics.revenue);return(0,s.jsxs)(z,{gradient:"amber",className:"h-full",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center",children:(0,s.jsx)(m.Z,{className:"w-4 h-4 text-amber-600"})}),(0,s.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Top Performers"})]}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"This Month"})]}),(0,s.jsx)("div",{className:"space-y-2",children:t.slice(0,5).map((e,a)=>(0,s.jsxs)("div",{className:(0,M.cn)("flex items-center gap-3 p-2 rounded-lg transition-colors",0===a?"bg-amber-50 dark:bg-amber-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800/50"),children:[(0,s.jsx)("span",{className:(0,M.cn)("w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",0===a?"bg-amber-500 text-white":1===a?"bg-gray-300 text-gray-700":2===a?"bg-amber-700 text-white":"bg-gray-100 text-gray-600"),children:a+1}),(0,s.jsxs)(E.qE,{className:"w-8 h-8",children:[(0,s.jsx)(E.F$,{src:e.avatar}),(0,s.jsx)(E.Q5,{className:"bg-gradient-to-br from-emerald-400 to-teal-500 text-white text-xs",children:e.name.split(" ").map(e=>e[0]).join("")})]}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:e.name})}),(0,s.jsxs)("div",{className:"text-right",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-emerald-600",children:F(e.metrics.revenue)}),(0,s.jsxs)("p",{className:"text-[10px] text-gray-500",children:[e.metrics.conversions," deals"]})]})]},e.id))})]})};function O(){var e,a,t,n,i;let o=(0,d.useRouter)(),{user:c}=(0,R.a)(),m=(null==c?void 0:c.workspace_id)||"",[E,O]=(0,l.useState)(!1),[Y,G]=(0,l.useState)("last_30_days"),[$,H]=(0,l.useState)(!1),[J,U]=(0,l.useState)("all"),[W,K]=(0,l.useState)(!0),[X,ee]=(0,l.useState)(null),[ea,et]=(0,l.useState)(null),[es,el]=(0,l.useState)(null),[er,ed]=(0,l.useState)(null),en=(null==m?void 0:m.id)||(null==c?void 0:c.workspace_id),ei=(0,l.useCallback)(async()=>{if(en){K(!0),ee(null);try{var e,a;let[t,s,l]=await Promise.all([A.api.get("/agent-status/team").catch(()=>({data:null})),A.api.get("/dashboards/team-performance?workspace_id=".concat(en,"&date_range=").concat(Y)).catch(()=>({data:null})),A.api.get("/dashboards/sales-manager?workspace_id=".concat(en,"&date_range=").concat(Y)).catch(()=>({data:null}))]);t.data&&et(t.data),(null===(e=s.data)||void 0===e?void 0:e.success)&&el(s.data),(null===(a=l.data)||void 0===a?void 0:a.success)&&ed(l.data)}catch(e){console.error("Error fetching dashboard data:",e),ee(e.message||"Failed to load dashboard data")}finally{K(!1)}}},[en,Y]);(0,l.useEffect)(()=>{O(!0)},[]),(0,l.useEffect)(()=>{E&&en&&ei()},[E,en,Y,ei]);let eo=new Date().getHours(),ec=(null==c?void 0:null===(e=c.full_name)||void 0===e?void 0:e.split(" ")[0])||(null==c?void 0:null===(a=c.name)||void 0===a?void 0:a.split(" ")[0])||"Manager",em=(0,l.useMemo)(()=>{var e;let a=null==es?void 0:es.team_totals,t=null==es?void 0:es.team_kpis,s=(null==es?void 0:null===(e=es.leaderboard)||void 0===e?void 0:e.reduce((e,a)=>e+(a.revenue_generated||0),0))||0,l=(null==er?void 0:er.kpis)||[],r=l.find(e=>{var a;return null===(a=e.label)||void 0===a?void 0:a.toLowerCase().includes("revenue")}),d=l.find(e=>{var a;return null===(a=e.label)||void 0===a?void 0:a.toLowerCase().includes("lead")}),n=l.find(e=>{var a;return null===(a=e.label)||void 0===a?void 0:a.toLowerCase().includes("call")});return{totalRevenue:(null==r?void 0:r.value)||s||0,revenueTarget:5e6,totalLeads:(null==t?void 0:t.total_leads)||(null==d?void 0:d.value)||0,newLeadsToday:(null==t?void 0:t.leads_change)||0,totalCalls:(null==a?void 0:a.total_calls)||(null==n?void 0:n.value)||0,callsToday:0,hotLeads:(null==t?void 0:t.qualified_leads)||0,conversions:(null==a?void 0:a.total_converted)||0,conversionRate:(null==t?void 0:t.conversion_rate)||(null==a?void 0:a.avg_conversion_rate)||0,avgDealSize:s&&(null==a?void 0:a.total_converted)?Math.round(s/a.total_converted):0,teamSize:(null==ea?void 0:ea.total_agents)||(null==a?void 0:a.agent_c
1ount)||0,onlineNow:(null==ea?void 0:ea.online_count)||0}},[es,ea,er]),ex=(0,l.useMemo)(()=>(null==es?void 0:es.leaderboard)?es.leaderboard.map((e,a)=>{var t;let s=null==ea?void 0:null===(t=ea.agents)||void 0===t?void 0:t.find(a=>a.user_id===e.agent_id),l=(null==s?void 0:s.status)||"offline",r="stable";e.conversion_rate>10?r="up":e.conversion_rate<5&&(r="down");let d=es.leaderboard.reduce((e,a)=>e+a.revenue_generated,0)/es.leaderboard.length;return{id:e.agent_id,name:e.agent_name||e.email||"Unknown Agent",role:(null==s?void 0:s.dashboard_role)||"Sales Agent",status:"online"===l||"busy"===l||"offline"===l?l:"offline",metrics:{revenue:e.revenue_generated||0,leads:e.leads_handled||0,calls:e.calls_made||0,conversions:e.leads_converted||0,target:Math.round(1.1*d),achieved:e.revenue_generated||0},trend:r,rank:e.rank||a+1}}):[],[es,ea]),eu=(0,l.useMemo)(()=>{var e;let a=(null==es?void 0:null===(e=es.team_kpis)||void 0===e?void 0:e.leads_by_status)||{};return[{name:"New Leads",key:"new",color:"bg-blue-500"},{name:"Contacted",key:"contacted",color:"bg-cyan-500"},{name:"Qualified",key:"qualified",color:"bg-purple-500"},{name:"Proposal",key:"proposal",color:"bg-amber-500"},{name:"Negotiation",key:"negotiation",color:"bg-orange-500"},{name:"Converted",key:"converted",color:"bg-emerald-500"}].map(e=>({name:e.name,count:a[e.key]||0,value:5e4*(a[e.key]||0),color:e.color})).filter(e=>e.count>0||"New Leads"===e.name||"Converted"===e.name)},[es]);(0,l.useMemo)(()=>{var e;if(!(null==es?void 0:null===(e=es.leaderboard)||void 0===e?void 0:e.length))return[{id:"1",type:"lead",message:"No recent activity",time:"Just now",user:"System"}];let a=[];return es.leaderboard.slice(0,6).forEach((e,t)=>{var s;let l=(null===(s=e.agent_name)||void 0===s?void 0:s.split(" ")[0])||"Agent";e.leads_converted>0&&a.push({id:"deal-".concat(t),type:"deal",message:"converted ".concat(e.leads_converted," lead").concat(e.leads_converted>1?"s":""),time:"This period",user:l}),e.calls_made>0&&a.push({id:"call-".concat(t),type:"call",message:"made ".concat(e.calls_made," call").concat(e.calls_made>1?"s":""),time:"This period",user:l}),e.leads_handled>0&&a.push({id:"lead-".concat(t),type:"lead",message:"handled ".concat(e.leads_handled," lead").concat(e.leads_handled>1?"s":""),time:"This period",user:l})}),a.slice(0,8)},[es]);let eh=async()=>{H(!0),await ei(),H(!1)};if(!E||W)return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50 dark:bg-slate-950 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,s.jsx)(u.Z,{className:"w-10 h-10 text-emerald-500 animate-spin"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Loading dashboard..."})]})});if(X)return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50 dark:bg-slate-950 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3 p-6 bg-white dark:bg-slate-900 rounded-xl shadow-lg",children:[(0,s.jsx)(h.Z,{className:"w-10 h-10 text-amber-500"}),(0,s.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:X}),(0,s.jsx)("button",{onClick:ei,className:"px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-white text-sm font-medium rounded-lg",children:"Retry"})]})});let eg="number"==typeof em.totalRevenue?em.totalRevenue:0,eb="number"==typeof em.revenueTarget?em.revenueTarget:1,ev=Math.round(eg/eb*100);return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50 dark:bg-slate-950",children:(0,s.jsxs)(r.E.div,{variants:Q,initial:"hidden",animate:"visible",className:"p-3 md:p-4 lg:p-6 space-y-4 max-w-[1800px] mx-auto",children:[(0,s.jsx)("div",{className:"bg-gradient-to-r from-indigo-600 via-purple-600 to-violet-600 rounded-2xl shadow-lg p-4 md:p-5",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white/20 flex items-center justify-center",children:(0,s.jsx)(g.Z,{className:"w-6 h-6 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("h1",{className:"text-xl md:text-2xl font-bold text-white",children:[eo<12?"Good Morning":eo<17?"Good Afternoon":"Good Evening",", ",ec]}),(0,s.jsx)("p",{className:"text-purple-100 text-sm",children:"Sales Manager Dashboard"})]})]}),(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-3 px-4 py-2 bg-white/10 backdrop-blur-sm rounded-xl",children:[(0,s.jsx)(b.Z,{className:"w-5 h-5 text-white"}),(0,s.jsxs)("div",{className:"text-white text-sm",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[em.onlineNow,"/",em.teamSize]})," Team Online"]}),(0,s.jsx)("div",{className:"w-2 h-2 bg-emerald-400 rounded-full animate-pulse"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)(V.Ph,{value:J,onValueChange:U,children:[(0,s.jsx)(V.i4,{className:"w-28 h-8 text-xs bg-white/20 border-white/30 text-white rounded-lg",children:(0,s.jsx)(V.ki,{})}),(0,s.jsxs)(V.Bw,{children:[(0,s.jsx)(V.Ql,{value:"all",children:"All Teams"}),(0,s.jsx)(V.Ql,{value:"sales_a",children:"Sales Team A"}),(0,s.jsx)(V.Ql,{value:"sales_b",children:"Sales Team B"})]})]}),(0,s.jsxs)(V.Ph,{value:Y,onValueChange:G,children:[(0,s.jsx)(V.i4,{className:"w-28 h-8 text-xs bg-white/20 border-white/30 text-white rounded-lg",children:(0,s.jsx)(V.ki,{})}),(0,s.jsxs)(V.Bw,{children:[(0,s.jsx)(V.Ql,{value:"today",children:"Today"}),(0,s.jsx)(V.Ql,{value:"last_7_days",children:"7 Days"}),(0,s.jsx)(V.Ql,{value:"last_30_days",children:"30 Days"}),(0,s.jsx)(V.Ql,{value:"this_quarter",children:"This Quarter"})]})]}),(0,s.jsx)("button",{onClick:eh,className:"p-2 rounded-lg text-white/80 hover:text-white hover:bg-white/20 transition-colors",children:(0,s.jsx)(v.Z,{className:(0,M.cn)("w-4 h-4",$&&"animate-spin")})}),(0,s.jsx)("button",{className:"p-2 rounded-lg text-white/80 hover:text-white hover:bg-white/20 transition-colors",children:(0,s.jsx)(p.Z,{className:"w-4 h-4"})})]})]})}),(0,s.jsx)(r.E.div,{variants:D,className:"bg-white dark:bg-slate-900 rounded-xl p-4 border border-gray-100 dark:border-slate-800",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-emerald-100 dark:bg-emerald-900/30 flex items-center justify-center",children:(0,s.jsx)(f.Z,{className:"w-6 h-6 text-emerald-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Monthly Revenue Target"}),(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:F(eg)}),(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:["/ ",F(eb)]})]})]})]}),(0,s.jsxs)("div",{className:"flex-1 max-w-md",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:[ev,"% achieved"]}),(0,s.jsx)("span",{className:(0,M.cn)("text-xs font-medium px-2 py-0.5 rounded-full",ev>=100?"bg-emerald-100 text-emerald-700":ev>=75?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"),children:ev>=100?"Target Met!":"".concat(F(eb-eg)," remaining")})]}),(0,s.jsx)("div",{className:"h-3 bg-gray-100 dark:bg-slate-800 rounded-full overflow-hidden",children:(0,s.jsx)(r.E.div,{initial:{width:0},animate:{width:"".concat(Math.min(ev,100),"%")},transition:{duration:1,ease:"easeOut"},className:(0,M.cn)("h-full rounded-full",ev>=100?"bg-gradient-to-r from-emerald-500 to-teal-500":ev>=75?"bg-gradient-to-r from-amber-500 to-orange-500":"bg-gradient-to-r from-red-500 to-rose-500")})})]})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:[(0,s.jsx)(P,{title:"Total Revenue",value:F(eg),subValue:"".concat(em.conversions," deals"),icon:j.Z,trend:"up",trendValue:"+12% vs last month",color:"emerald",onClick:()=>o.push("/dashboard/crm")}),(0,s.jsx)(P,{title:"Total Leads",value:em.totalLeads.toString(),subValue:em.newLeadsToday>
10?"+".concat(em.newLeadsToday," vs last period"):"No change",icon:b.Z,trend:em.newLeadsToday>0?"up":em.newLeadsToday<0?"down":"stable",trendValue:"+8% this week",color:"blue",onClick:()=>o.push("/dashboard/leads")}),(0,s.jsx)(P,{title:"Total Calls",value:em.totalCalls.toString(),subValue:"".concat(em.callsToday," today"),icon:y.Z,trend:"up",trendValue:"+15% vs avg",color:"purple",onClick:()=>o.push("/dashboard/ai-calls")}),(0,s.jsx)(P,{title:"Hot Leads",value:em.hotLeads.toString(),subValue:"Ready to convert",icon:N.Z,trend:"up",trendValue:"+23 this week",color:"rose",onClick:()=>o.push("/dashboard/leads?status=hot")}),(0,s.jsx)(P,{title:"Conversion Rate",value:"".concat(em.conversionRate,"%"),subValue:"Lead to Deal",icon:w.Z,trend:"up",trendValue:"+1.2% improvement",color:"amber"}),(0,s.jsx)(P,{title:"Avg Deal Size",value:F(em.avgDealSize),subValue:"Per conversion",icon:x.Z,trend:"stable",trendValue:"On target",color:"indigo"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-4",children:[(0,s.jsxs)("div",{className:"lg:col-span-3 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Team Performance"}),(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/staff"),className:"text-sm text-emerald-600 hover:text-emerald-700 flex items-center gap-1",children:["View All ",(0,s.jsx)(k.Z,{className:"w-4 h-4"})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:ex.length>0?ex.map(e=>(0,s.jsx)(q,{member:e,onClick:()=>o.push("/dashboard/staff?member=".concat(e.id))},e.id)):(0,s.jsxs)("div",{className:"col-span-full p-8 bg-white dark:bg-slate-900 rounded-xl border border-gray-100 dark:border-slate-800 text-center",children:[(0,s.jsx)(b.Z,{className:"w-12 h-12 mx-auto text-gray-300 dark:text-slate-700 mb-3"}),(0,s.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No team members with activity data yet"}),(0,s.jsx)("button",{onClick:()=>o.push("/dashboard/staff"),className:"mt-3 text-sm text-emerald-600 hover:text-emerald-700",children:"Manage Team"})]})})]}),(0,s.jsx)("div",{className:"lg:col-span-1",children:(0,s.jsx)(B,{members:ex})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,s.jsx)(I,{stages:eu}),(0,s.jsxs)(z,{gradient:"indigo",className:"h-full",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-indigo-100 dark:bg-indigo-900/30 flex items-center justify-center",children:(0,s.jsx)(_.Z,{className:"w-4 h-4 text-indigo-600"})}),(0,s.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-white",children:"Quick Actions"})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/leads"),className:"p-4 bg-gray-50 dark:bg-slate-800 rounded-xl hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-left",children:[(0,s.jsx)(b.Z,{className:"w-6 h-6 text-blue-500 mb-2"}),(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"View All Leads"}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[em.totalLeads," total"]})]}),(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/staff"),className:"p-4 bg-gray-50 dark:bg-slate-800 rounded-xl hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-left",children:[(0,s.jsx)(C.Z,{className:"w-6 h-6 text-emerald-500 mb-2"}),(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Manage Team"}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[em.teamSize," members"]})]}),(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/ai-calls"),className:"p-4 bg-gray-50 dark:bg-slate-800 rounded-xl hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-left",children:[(0,s.jsx)(Z.Z,{className:"w-6 h-6 text-purple-500 mb-2"}),(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Call Analytics"}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[em.totalCalls," calls"]})]}),(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/analytics"),className:"p-4 bg-gray-50 dark:bg-slate-800 rounded-xl hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-left",children:[(0,s.jsx)(x.Z,{className:"w-6 h-6 text-amber-500 mb-2"}),(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"View Reports"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Performance data"})]}),(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/follow-ups"),className:"p-4 bg-gray-50 dark:bg-slate-800 rounded-xl hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-left",children:[(0,s.jsx)(T.Z,{className:"w-6 h-6 text-rose-500 mb-2"}),(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Team Tasks"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Follow-ups & meetings"})]}),(0,s.jsxs)("button",{onClick:()=>o.push("/dashboard/conversations"),className:"p-4 bg-gray-50 dark:bg-slate-800 rounded-xl hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors text-left",children:[(0,s.jsx)(S.Z,{className:"w-6 h-6 text-cyan-500 mb-2"}),(0,s.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Conversations"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Active chats"})]})]})]})]}),(0,s.jsx)(r.E.div,{variants:D,className:"rounded-xl p-4 border border-purple-200 dark:border-purple-800 bg-gradient-to-r from-purple-50 to-indigo-50 dark:from-purple-950/50 dark:to-indigo-950/50",children:(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-purple-500 to-indigo-500 flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(L.Z,{className:"w-6 h-6 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-purple-700 dark:text-purple-400",children:"AI Manager Insights"}),(0,s.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:ex.length>0?(0,s.jsxs)(s.Fragment,{children:[ex[0]&&ex[0].metrics.achieved>ex[0].metrics.target&&(0,s.jsxs)(s.Fragment,{children:[ex[0].name.split(" ")[0]," is on track to exceed target by ",Math.round((ex[0].metrics.achieved/ex[0].metrics.target-1)*100),"%. "]}),ex.length>1&&(()=>{let e=[...ex].sort((e,a)=>e.metrics.leads-a.metrics.leads)[0],a=ex[0];return e&&a&&e.id!==a.id?(0,s.jsxs)(s.Fragment,{children:["Consider assigning more leads to ",e.name.split(" ")[0]," who has capacity. "]}):null})(),((null==eu?void 0:null===(t=eu.find(e=>"Negotiation"===e.name))||void 0===t?void 0:t.count)||0)>0&&(0,s.jsxs)(s.Fragment,{children:[null==eu?void 0:null===(n=eu.find(e=>"Negotiation"===e.name))||void 0===n?void 0:n.count," deals in negotiation stage need attention - total value ",F((null==eu?void 0:null===(i=eu.find(e=>"Negotiation"===e.name))||void 0===i?void 0:i.value)||0)," at risk."]})]}
1):"No team data available yet. Add team members to see insights."})]}),(0,s.jsx)("button",{onClick:()=>o.push("/dashboard/analytics"),className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white text-sm font-medium rounded-lg flex-shrink-0 transition-colors",children:"View Details"})]})})]})})}},96246:function(e,a,t){t.d(a,{F$:function(){return i},Q5:function(){return o},qE:function(){return n}});var s=t(57437),l=t(2265),r=t(61146),d=t(93448);let n=l.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,s.jsx)(r.fC,{ref:a,className:(0,d.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...l})});n.displayName=r.fC.displayName;let i=l.forwardRef((e,a)=>{let{className:t,alt:l="Avatar",...n}=e;return(0,s.jsx)(r.Ee,{ref:a,alt:l,className:(0,d.cn)("aspect-square h-full w-full",t),...n})});i.displayName=r.Ee.displayName;let o=l.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,s.jsx)(r.NY,{ref:a,className:(0,d.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...l})});o.displayName=r.NY.displayName},15291:function(e,a,t){t.d(a,{Bw:function(){return u},DI:function(){return c},Ph:function(){return o},Ql:function(){return g},i4:function(){return x},ki:function(){return m},n5:function(){return h}});var s=t(57437),l=t(2265),r=t(56873),d=t(40875),n=t(30401),i=t(93448);let o=r.fC,c=r.ZA,m=r.B4,x=l.forwardRef((e,a)=>{let{className:t,children:l,...n}=e;return(0,s.jsxs)(r.xz,{ref:a,className:(0,i.cn)("flex h-10 w-full items-center justify-between rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 dark:text-gray-100 px-3 py-2 text-sm r
1ing-offset-white dark:ring-offset-gray-950 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-950 dark:focus:ring-gray-300 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[l,(0,s.jsx)(r.JO,{asChild:!0,children:(0,s.jsx)(d.Z,{className:"h-4 w-4 opacity-50"})})]})});x.displayName=r.xz.displayName;let u=l.forwardRef((e,a)=>{let{className:t,children:l,position:d="popper",...n}=e;return(0,s.jsx)(r.h_,{children:(0,s.jsx)(r.VY,{ref:a,className:(0,i.cn)("relative z-50 min-w-[8rem] overflow-hidden rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-950 dark:text-gray-100 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===d&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:d,...n,children:(0,s.jsx)(r.l_,{className:(0,i.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===d&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})})});u.displayName=r.VY.displayName;let h=l.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,s.jsx)(r.__,{ref:a,className:(0,i.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...l})});h.displayName=r.__.displayName;let g=l.forwardRef((e,a)=>{let{className:t,children:l,...d}=e;return(0,s.jsxs)(r.ck,{ref:a,className:(0,i.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 dark:focus:bg-gray-700 focus:text-gray-900 dark:focus:text-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...d,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(r.wU,{children:(0,s.jsx)(n.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(r.eT,{children:l})]})});g.displayName=r.ck.displayName,l.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,s.jsx)(r.Z0,{ref:a,className:(0,i.cn)("-mx-1 my-1 h-px bg-gray-100 dark:bg-gray-700",t),...l})}).displayName=r.Z0.displayName},93448:function(e,a,t){t.d(a,{cn:function(){return r}});var s=t(61994),l=t(53335);function r(){for(var e=arguments.length,a=Array(e),t=0;t<e;t++)a[t]=arguments[t];return(0,l.m6)((0,s.W)(a))}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.