PageSourceSearch

https://spenditwiser.netlify.app/assets/MonthlyReportModal-a6f_p_dv.js

js spenditwiser.netlify.app collected 2026-10-03 11:26:33 UTC 39,739 bytes, 6 lines download raw bytes

1import{e as $e,x as I,r as k,j as t,A as ge,m as w,a as Ee,B as Me,l as Ae,G as ze,I as Ie,X as Be,J as Pe,K as A,i as Re,M as Le,P as Oe,f as Ue,N as ne,O as We,Q as Ge,V as oe,Y as ie,Z as me,_ as he,$ as ye,a0 as pe,a1 as ue,a2 as Ye,u as He,L as Ke,a3 as Ve,a4 as _e}from"./index-BLshS733.js";/**
2 * @license lucide-react v0.344.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const qe=$e("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);function Xe(h,g){return h.filter(i=>I.normalizeDate(i.date).substring(0,7)===g)}function Ze(h){const g=h.filter(m=>m.type==="income"),i=h.filter(m=>m.type==="expense"),x=g.reduce((m,p)=>m+Math.abs(p.amount),0),l=i.reduce((m,p)=>m+Math.abs(p.amount),0),c=x-l,r=x>0?c/x*100:0;return{totalIncome:x,totalExpenses:l,netSavings:c,savingsRate:r,incomeCount:g.length,expenseCount:i.length}}function be(h,g="expense"){const i=h.filter(c=>c.type===g),x=i.reduce((c,r)=>c+Math.abs(r.amount),0),l=new Map;return i.forEach(c=>{const r=l.get(c.category)||{amount:0,count:0};l.set(c.category,{amount:r.amount+Math.abs(c.amount),count:r.count+1})}),Array.from(l.entries()).map(([c,r])=>({category:c,amount:r.amount,percentage:x>0?r.amount/x*100:0,count:r.count,type:g})).sort((c,r)=>r.amount-c.amount)}function Je(h,g){return g.filter(x=>x.type==="Credit Card").map(x=>{const l=h.filter(p=>p.accountId===x.id&&p.type==="expense"),c=l.reduce((p,f)=>p+Math.abs(f.amount),0),r=x.limit||0,m=r>0?c/r*100:0;return{cardId:x.id,cardName:x.name,spending:c,limit:r,utilization:m,transactionCount:l.length,last4Digits:x.last4Digits}}).sort((x,l)=>l.spending-x.spending)}function Qe(h,g){return g.map(i=>{const x=h.filter(c=>c.loanId===i.id),l=x.reduce((c,r)=>c+Math.abs(r.amount),0);return{loanId:i.id,loanName:i.name,emi:i.emi,paymentsMade:x.length,totalPaid:l,loanType:i.type}}).filter(i=>i.paymentsMade>0||!0)}function et(h,g){return g.map(i=>{const l=h.filter(p=>p.category===i.category&&p.type==="expense").reduce((p,f)=>p+Math.abs(f.amount),0),c=i.limit-l,r=i.limit>0?l/i.limit*100:0;let m;return r>=100?m="over":r>=80?m="near":m="under",{category:i.category,limit:i.limit,spent:l,remaining:c,percentage:r,status:m}}).sort((i,x)=>x.percentage-i.percentage)}function tt(h,g){const i=h.filter(n=>n.type==="expense"),x=h.filter(n=>n.type==="income"),l=new Map;i.forEach(n=>{const j=I.normalizeDate(n.date),L=l.get(j)||{amount:0,count:0};l.set(j,{amount:L.amount+Math.abs(n.amount),count:L.count+1})});let c=null;l.forEach((n,j)=>{(!c||n.amount>c.amount)&&(c={date:j,amount:n.amount,transactionCount:n.count})});const r=new Map;i.forEach(n=>{const j=r.get(n.category)||{count:0,amount:0};r.set(n.category,{count:j.count+1,amount:j.amount+Math.abs(n.amount)})});let m=null;r.forEach((n,j)=>{(!m||n.count>m.count)&&(m={category:j,count:n.count,amount:n.amount})});const p=i.reduce((n,j)=>!n||Math.abs(j.amount)>Math.abs(n.amount)?j:n,null),f=p?{name:p.name,amount:Math.abs(p.amount),category:p.category,date:p.date}:null,B=x.reduce((n,j)=>!n||Math.abs(j.amount)>Math.abs(n.amount)?j:n,null),q=B?{name:B.name,amount:Math.abs(B.amount),category:B.category,date:B.date}:null,G=i.reduce((n,j)=>n+Math.abs(j.amount),0),P=i.length>0?G/i.length:0,[Y,H]=g.split("-").map(Number),K=new Date(Y,H,0).getDate(),b=G/K,y=h.length/K,T=new Set(h.map(n=>n.category)).size;let V=0,U=0,_=0,R=0;return i.forEach(n=>{const L=new Date(I.normalizeDate(n.date)).getDay();L===0||L===6?(U+=Math.abs(n.amount),R++):(V+=Math.abs(n.amount),_++)}),{highestSpendingDay:c,mostUsedCategory:m,largestExpense:f,largestIncome:q,averageTransaction:P,averageDailySpending:b,transactionsPerDay:y,uniqueCategories:T,weekdayVsWeekend:{weekdaySpending:V,weekendSpending:U,weekdayCount:_,weekendCount:R}}}function at(){const h=[],g=I.today();for(let i=0;i<13;i++){const x=new Date(g.getFullYear(),g.getMonth()-i,1),l=`${x.getFullYear()}-${String(x.getMonth()+1).padStart(2,"0")}
6`,c=x.toLocaleString("default",{month:"long",year:"numeric"});h.push({value:l,label:c})}return h}function u(h,g){const i=Math.abs(h);if(g==="₹"){if(i>=1e7)return`${g}${(i/1e7).toFixed(2)} Cr`;if(i>=1e5)return`${g}${(i/1e5).toFixed(2)} L`}return`${g}${i.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}const je=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#6366F1","#14B8A6","#A855F7"];function z(h){return je[h%je.length]}function st(h){const g=new Map;h.forEach(l=>{const c=I.normalizeDate(l.date),r=g.get(c)||[];r.push(l),g.set(c,r)});const i=Array.from(g.keys()).sort((l,c)=>c.localeCompare(l)),x=new Map;return i.forEach(l=>{x.set(l,g.get(l))}),x}function rt(h){const g=new Map;h.forEach(l=>{const c=g.get(l.category)||[];c.push(l),g.set(l.category,c)});const i=Array.from(g.keys()).sort((l,c)=>{const r=g.get(l).reduce((p,f)=>p+Math.abs(f.amount),0);return g.get(c).reduce((p,f)=>p+Math.abs(f.amount),0)-r}),x=new Map;return i.forEach(l=>{x.set(l,g.get(l))}),x}const it=({isOpen:h,onClose:g,transactions:i,accounts:x,budgets:l,loans:c,currency:r,darkMode:m})=>{var le;const p=k.useMemo(()=>at(),[]),[f,B]=k.useState(p[0].value),[q,G]=k.useState(!1),[P,Y]=k.useState("date"),[H,K]=k.useState(!1),b=k.useMemo(()=>Xe(i,f),[i,f]),y=k.useMemo(()=>Ze(b),[b]),T=k.useMemo(()=>be(b,"expense"),[b]),V=k.useMemo(()=>be(b,"income"),[b]),U=k.useMemo(()=>Je(b,x),[b,x]),_=k.useMemo(()=>Qe(b,c),[b,c]),R=k.useMemo(()=>et(b,l),[b,l]),n=k.useMemo(()=>tt(b,f),[b,f]),j=k.useMemo(()=>st(b),[b]),L=k.useMemo(()=>rt(b),[b]),X=T.slice(0,5),ee=T.slice(-5).reverse(),te=T.slice(0,8).map((e,d)=>({name:e.category,value:e.amount,color:z(d)})),Z=((le=p.find(e=>e.value===f))==null?void 0:le.label)||"",F=e=>Math.abs(e).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}),fe=async()=>{K(!0);try{const e=new _e({orientation:"portrait",unit:"mm",format:"a4"}),d=e.internal.pageSize.getWidth(),v=e.internal.pageSize.getHeight(),s=15,C=d-s*2;let a=s;const Ne=[0,123,255],D=[33,37,41],N=[108,117,125],W=[40,167,69],M=[220,53,69],ae=[222,226,230],$=o=>a+o>v-20?(e.addPage(),a=s,!0):!1,E=(o,S=ae)=>{e.setDrawColor(...S),e.setLineWidth(.3),e.line(s,o,d-s,o)};e.setFillColor(...Ne),e.rect(0,0,d,35,"F"),e.setTextColor(255,255,255),e.setFontSize(24),e.setFont("helvetica","bold"),e.text("SpendWiser",s,18),e.setFontSize(10),e.setFont("helvetica","normal"),e.text("Monthly Financial Statement",s,26),e.setFontSize(12),e.setFont("helvetica","bold"),e.text(Z,d-s,18,{align:"right"}),e.setFontSize(9),e.setFont("helvetica","normal");const Fe=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});e.text(`Generated: ${Fe}`,d-s,26,{align:"right"}),a=45,e.setFillColor(248,249,250),e.rect(s,a,C,35,"F"),e.setDrawColor(...ae),e.rect(s,a,C,35,"S"),e.setTextColor(...D),e.setFontSize(11),e.setFont("helvetica","bold"),e.text("ACCOUNT SUMMARY",s+5,a+8);const J=C/3;e.setFontSize(9),e.setTextColor(...N),e.setFont("helvetica","normal"),e.text("Total Income",s+5,a+18),e.setFontSize(14),e.setTextColor(...W),e.setFont("helvetica","bold"),e.text(`${r}${F(y.totalIncome)}`,s+5,a+28),e.setFontSize(9),e.setTextColor(...N),e.setFont("helvetica","normal"),e.text("Total Expenses",s+J+5,a+18),e.setFontSize(14),e.setTextColor(...M),e.setFont("helvetica","bold"),e.text(`${r}${F(y.totalExpenses)}`,s+J+5,a+28),e.setFontSize(9),e.setTextColor(...N),e.setFont("helvetica","normal"),e.text("Net Savings",s+J*2+5,a+18),e.setFontSize(14),e.setTextColor(...y.netSavings>=0?W:M),e.setFont("helvetica","bold"),e.text(`${y.netSavings>=0?"":"-"}${r}${F(y.netSavings)}`,s+J*2+5,a+28),a+=45,$(60),e.setTextColor(...D),e.setFontSize(11),e.setFont("helvetica","bold"),e.text("SPENDING BY CATEGORY",s,a),a+=8,E(a),a+=5,e.setFillColor(248,249,250),e.rect(s,a,C,7,"F"),e.setFontSize(8),e.setTextColor(...N),e.setFont("helvetica","bold"),e.text("CATEGORY",s+3,a+5),e.text("TRANSACTIONS",s+80,a+5),e.text("AMOUNT",d-s-3,a+5,{align:"right"}),e.text("%",d-s-30,a+5,{align:"right"}),a+=10,e.setFont("helvetica","normal"),e.setFontSize(9),T.slice(0,10).forEac
6h((o,S)=>{$(8),S%2===1&&(e.setFillColor(252,252,252),e.rect(s,a-3,C,7,"F")),e.setTextColor(...D),e.text(o.category.substring(0,25),s+3,a+2),e.setTextColor(...N),e.text(o.count.toString(),s+80,a+2),e.text(`${o.percentage.toFixed(1)}%`,d-s-30,a+2,{align:"right"}),e.setTextColor(...M),e.text(`${r}${F(o.amount)}`,d-s-3,a+2,{align:"right"}),a+=7}),T.length>10&&(e.setTextColor(...N),e.setFontSize(8),e.text(`... and ${T.length-10} more categories`,s+3,a+2),a+=7),E(a),a+=10,$(50),e.setTextColor(...D),e.setFontSize(11),e.setFont("helvetica","bold"),e.text("TRANSACTION HISTORY",s,a),e.setFontSize(9),e.setFont("helvetica","normal"),e.setTextColor(...N),e.text(`(${b.length} transactions)`,s+55,a),a+=8,E(a),a+=5,e.setFillColor(248,249,250),e.rect(s,a,C,7,"F"),e.setFontSize(8),e.setTextColor(...N),e.setFont("helvetica","bold"),e.text("DATE",s+3,a+5),e.text("DESCRIPTION",s+28,a+5),e.text("CATEGORY",s+95,a+5),e.text("AMOUNT",d-s-3,a+5,{align:"right"}),a+=10;const ve=[...b].sort((o,S)=>I.compareDates(S.date,o.date));e.setFont("helvetica","normal"),e.setFontSize(8);let ke=0;ve.forEach((o,S)=>{$(7),S%2===1&&(e.setFillColor(252,252,252),e.rect(s,a-3,C,6,"F"));const se=new Date(I.normalizeDate(o.date)).toLocaleDateString("en-US",{month:"short",day:"2-digit"});e.setTextColor(...N),e.text(se,s+3,a+1),e.setTextColor(...D);const Se=o.name.length>30?o.name.substring(0,27)+"...":o.name;e.text(Se,s+28,a+1),e.setTextColor(...N);const Te=o.category.length>15?o.category.substring(0,12)+"...":o.category;e.text(Te,s+95,a+1);const re=Math.abs(o.amount),De=`${o.type==="income"?"+":"-"}${r}${F(re)}`;e.setTextColor(...o.type==="income"?W:M),e.text(De,d-s-3,a+1,{align:"right"}),ke+=o.type==="income"?re:-re,a+=6}),E(a),a+=5,e.setFillColor(248,249,250),e.rect(s,a,C,14,"F"),e.setFontSize(9),e.setFont("helvetica","bold"),e.setTextColor(...D),e.text("PERIOD TOTALS",s+3,a+5),e.setTextColor(...W),e.text(`Income: ${r}${F(y.totalIncome)}`,s+60,a+5),e.setTextColor(...M),e.text(`Expenses: ${r}${F(y.totalExpenses)}`,s+60,a+11),e.setTextColor(...y.netSavings>=0?W:M),e.text(`Net: ${y.netSavings>=0?"+":""}${r}${F(y.netSavings)}`,d-s-3,a+8,{align:"right"}),a+=20;const de=U.filter(o=>o.spending>0);de.length>0&&($(40),e.setTextColor(...D),e.setFontSize(11),e.setFont("helvetica","bold"),e.text("CREDIT CARD SUMMARY",s,a),a+=8,E(a),a+=5,e.setFillColor(248,249,250),e.rect(s,a,C,7,"F"),e.setFontSize(8),e.setTextColor(...N),e.setFont("helvetica","bold"),e.text("CARD",s+3,a+5),e.text("TRANSACTIONS",s+70,a+5),e.text("UTILIZATION",s+100,a+5),e.text("SPENT",d-s-3,a+5,{align:"right"}),a+=10,e.setFont("helvetica","normal"),e.setFontSize(9),de.forEach((o,S)=>{$(7),S%2===1&&(e.setFillColor(252,252,252),e.rect(s,a-3,C,7,"F")),e.setTextColor(...D);const Q=o.last4Digits?`${o.cardName} ****${o.last4Digits}`:o.cardName;e.text(Q.substring(0,30),s+3,a+2),e.setTextColor(...N),e.text(o.transactionCount.toString(),s+70,a+2),e.text(o.limit>0?`${o.utilization.toFixed(1)}%`:"N/A",s+100,a+2),e.setTextColor(...M),e.text(`${r}${F(o.spending)}`,d-s-3,a+2,{align:"right"}),a+=7}),E(a),a+=10),R.length>0&&($(40),e.setTextColor(...D),e.setFontSize(11),e.setFont("helvetica","bold"),e.text("BUDGET PERFORMANCE",s,a),a+=8,E(a),a+=5,e.setFillColor(248,249,250),e.rect(s,a,C,7,"F"),e.setFontSize(8),e.setTextColor(...N),e.setFont("helvetica","bold"),e.text("CATEGORY",s+3,a+5),e.text("BUDGET",s+70,a+5),e.text("SPENT",s+100,a+5),e.text("STATUS",d-s-3,a+5,{align:"right"}),a+=10,e.setFont("helvetica","normal"),e.setFontSize(9),R.forEach((o,S)=>{$(7),S%2===1&&(e.setFillColor(252,252,252),e.rect(s,a-3,C,7,"F")),e.setTextColor(...D),e.text(o.category.substring(0,25),s+3,a+2),e.setTextColor(...N),e.text(`${r}${F(o.limit)}`,s+70,a+2),e.text(`${r}${F(o.spent)}`,s+100,a+2);const Q=o.status==="over"?M:o.status==="near"?[255,193,7]:W,se=o.status==="over"?"OVER BUDGET":o.status==="near"?"NEAR LIMIT":"ON TRACK";e.setTextColor(...Q),e.text(se,d-s-3,a+2,{align:"right"}),a+=7}),E(a),a+=10),$(45),e.setTextColor(...D),e.setFontSize(11),e.setFont("helvetica","bold"),e.text("MONTHLY INSIGHTS",s,a),a+=8,E(a),a+=8,e.setFontSize(9),e.setFont("helvetica","normal");const O=[];if(n.highestSpendingDay){const o=new Date(n.highestSpendingDay.date).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"});O.push(["Highest Spending Day",`${o} (${r}${F(n.highestSpendingDay.amount)})`])}n.mostUsedCategory&&O.push(["Most Frequent Category",`${n.mostUsedCategory.category} (${n.mostUsedCategory.count} transactions)`]),n.largestExpense&&O.push(["Largest Expense",`${n.largestExpense.name} (${r}${F(n.largestExpense.amount)})`]),O.push(["Average Daily Spending",`${r}${F(n.averageDailySpending)}`]),O.push(["Average Transaction",`${r}${F(n.averageTransaction)}`]),O.push(["Savings Rate",`${y.savingsRate.toFixed(1)}%`]),O.forEach(([o,S])=>
6{$(7),e.setTextColor(...N),e.text(o+":",s+3,a),e.setTextColor(...D),e.text(S,s+60,a),a+=6});const ce=e.getNumberOfPages();for(let o=1;o<=ce;o++)e.setPage(o),e.setDrawColor(...ae),e.setLineWidth(.3),e.line(s,v-15,d-s,v-15),e.setFontSize(8),e.setTextColor(...N),e.setFont("helvetica","normal"),e.text("This statement is for informational purposes only.",s,v-10),e.text(`Page ${o} of ${ce}`,d-s,v-10,{align:"right"}),e.setFontSize(7),e.text("Generated by SpendWiser | www.spendwiser.app",d/2,v-6,{align:"center"});e.setProperties({title:`SpendWiser Statement - ${Z}`,author:"SpendWiser",subject:"Monthly Financial Statement",keywords:"finance, budget, expenses, income, statement",creator:"SpendWiser Financial App"});const[xe,we]=f.split("-"),Ce=new Date(parseInt(xe),parseInt(we)-1,1).toLocaleString("default",{month:"short"});e.save(`SpendWiser_Statement_${Ce}_${xe}.pdf`)}catch(e){console.error("Error generating PDF:",e)}finally{K(!1)}};return h?t.jsx(ge,{children:h&&t.jsx(w.div,{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-2 md:p-4",initial:{opacity:0}
6,animate:{opacity:1},exit:{opacity:0},onClick:g,children:t.jsxs(w.div,{className:"bg-white dark:bg-[#1A1A1A] rounded-xl border border-gray-200 dark:border-gray-700 w-full max-w-6xl max-h-[95vh] overflow-hidden shadow-2xl flex flex-col",variants:Ee,initial:"initial",animate:"animate",exit:"exit",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between p-4 md:p-6 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-[#242424] sticky top-0 z-10",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"p-2 bg-blue-500 rounded-lg",children:t.jsx(Me,{className:"h-5 w-5 text-white"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl md:text-2xl font-bold text-gray-900 dark:text-[#F5F5F5]",children:"Monthly Report"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 hidden md:block",children:"Comprehensive financial summary"})]})]}),t.jsxs("div",{className:"flex items-center space-x-2 md:space-x-4",children:[t.jsxs("div",{className:"relative",children:[t.jsxs(w.button,{onClick:()=>G(!q),className:"flex items-center space-x-2 px-3 py-2 bg-gray-100 dark:bg-gray-800 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",whileTap:{scale:.98},children:[t.jsx(Ae,{className:"h-4 w-4 text-gray-600 dark:text-gray-300"}),t.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 hidden sm:inline",children:Z}),t.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 sm:hidden",children:Z.split(" ")[0].slice(0,3)}),t.jsx(ze,{className:"h-4 w-4 text-gray-600 dark:text-gray-300"})]}),t.jsx(ge,{children:q&&t.jsx(w.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute right-0 mt-2 w-48 bg-white dark:bg-[#242424] rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 z-50 max-h-60 overflow-y-auto","data-lenis-prevent":!0,children:p.map(e=>t.jsx("button",{onClick:()=>{B(e.value),G(!1)},className:`w-full px-4 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${f===e.value?"bg-blue-50 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-200"}`,children:e.label},e.value))})})]}),t.jsxs(w.button,{onClick:fe,disabled:H,className:"flex items-center space-x-2 px-3 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors disabled:opacity-50",whileHover:{scale:1.02},whileTap:{scale:.98},children:[H?t.jsx("div",{className:"h-4 w-4 border-2 border-white border-t-transparent rounded-full animate-spin"}):t.jsx(Ie,{className:"h-4 w-4"}),t.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:H?"Generating...":"Download PDF"})]}),t.jsx(w.button,{onClick:g,className:"p-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition-colors",whileHover:{scale:1.1},whileTap:{scale:.9},children:t.jsx(Be,{className:"h-6 w-6"})})]})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 space-y-6 bg-gray-50 dark:bg-[#1A1A1A]","data-lenis-prevent":!0,children:t.jsxs(w.div,{variants:Pe,initial:"initial",animate:"animate",className:"space-y-6",children:[t.jsxs(w.div,{variants:A,className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs("div",{className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("div",{className:"p-2 bg-green-100 dark:bg-green-900/30 rounded-lg",children:t.jsx(Re,{className:"h-5 w-5 text-green-600 dark:text-green-400"})}),t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[y.incomeCount," transactions"]})]}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Total Income"}),t.jsx("p",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:u(y.totalIncome,r)})]}),t.jsxs("div",{className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("div",{className:"p-2 bg-red-100 dark:bg-red-900/30 rounded-lg",children:t.jsx(Le,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[y.expenseCount," transactions"]})]}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Total Expenses"}),t.jsx("p",{className:"text-2xl font-bold text-red-600 dark:text-red-400",children:u(y.totalExpenses,r)})]}),t.jsxs("div",{className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("div",{className:"p-2 bg-blue-100 dar
6k:bg-blue-900/30 rounded-lg",children:t.jsx(Oe,{className:"h-5 w-5 text-blue-600 dark:text-blue-400"})}),t.jsxs("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${y.savingsRate>=20?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":y.savingsRate>=0?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"}`,children:[y.savingsRate.toFixed(1),"% saved"]})]}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Net Savings"}),t.jsxs("p",{className:`text-2xl font-bold ${y.netSavings>=0?"text-blue-600 dark:text-blue-400":"text-red-600 dark:text-red-400"}`,children:[y.netSavings>=0?"":"-",u(y.netSavings,r)]})]})]}),t.jsxs(w.div,{variants:A,className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[t.jsx(Ue,{className:"h-5 w-5 text-blue-500"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Expense Breakdown"})]}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[t.jsx("div",{className:"h-64",children:te.length>0?t.jsx(ne,{width:"100%",height:"100%",children:t.jsxs(We,{children:[t.jsx(Ge,{data:te,cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,paddingAngle:2,dataKey:"value",children:te.map((e,d)=>t.jsx(oe,{fill:e.color},`cell-${d}`))}),t.jsx(ie,{formatter:e=>u(e,r),contentStyle:{backgroundColor:m?"#242424":"#FFFFFF",border:`1px solid ${m?"#374151":"#E5E7EB"}`,borderRadius:"8px"},labelStyle:{color:m?"#F5F5F5":"#111827"},itemStyle:{color:m?"#F5F5F5":"#111827"}})]})}):t.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-gray-400",children:"No expense data for this month"})}),t.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto","data-lenis-prevent":!0,children:[T.map((e,d)=>t.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:z(d)}}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-[#F5F5F5]",children:e.category}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.count," transaction",e.count!==1?"s":""]})]})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(e.amount,r)}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.percentage.toFixed(1),"%"]})]})]},e.category)),T.length===0&&t.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400 py-4",children:"No expenses recorded"})]})]})]}),t.jsxs(w.div,{variants:A,className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs("div",{className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5] mb-4",children:"Top Spending Categories"}),t.jsx("div",{className:"h-48",children:X.length>0?t.jsx(ne,{width:"100%",height:"100%",children:t.jsxs(me,{data:X.map((e,d)=>({name:e.category.length>10?e.category.slice(0,10)+"...":e.category,amount:e.amount,fill:z(d)})),layout:"vertical",margin:{left:0,right:20},children:[t.jsx(he,{strokeDasharray:"3 3",stroke:m?"#374151":"#E5E7EB"}),t.jsx(ye,{type:"number",hide:!0}),t.jsx(pe,{type:"category",dataKey:"name",width:80,tick:{fontSize:12,fill:m?"#9CA3AF":"#6B7280"}}),t.jsx(ie,{formatter:e=>u(e,r),contentStyle:{backgroundColor:m?"#242424":"#FFFFFF",border:`1px solid ${m?"#374151":"#E5E7EB"}`,borderRadius:"8px"},labelStyle:{color:m?"#F5F5F5":"#111827"},itemStyle:{color:m?"#F5F5F5":"#111827"}}),t.jsx(ue,{dataKey:"amount",radius:[0,4,4,0],children:X.map((e,d)=>t.jsx(oe,{fill:z(d)},`cell-${d}`))})]})}):t.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-gray-400",children:"No data available"})})]}),t.jsxs("div",{className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5] mb-4",children:"Lowest Spending Categories"}),t.jsx("div",{className:"h-48",children:ee.length>0?t.jsx(ne,{width:"100%",height:"100%",children:t.jsxs(me,{data:ee.map((e,d)=>({name:e.category.length>10?e.category.slice(0,10)+"...":e.category,amount:e.amount,fill:z(d+5)})),layout:"vertical",margin:{left:0,right:20},children:[t.jsx(he,{strokeDasharray:"3 3",stroke:m?"#374151":"#E5E7EB"}),t.jsx(ye,{type:"number",hide:!0}),t.jsx(pe,{type:"category",dataKey:"name",width:80,tick:{fontSize:12,fill:m?"#9CA3AF":"#6B7280"}}),t.jsx(ie,{formatter:e=>u(e,r),contentStyle:{backgroundColor:m?"#242424":"#FFFFFF",border:`1px solid ${m?"#374151":"#E5E7EB"}`,borderRadius:"8px"},labelStyle:{color:m?"#F5F5F5":"#111827"},itemStyle:{color:m?"#F5F5F5":"#111827"}}),t.jsx(ue,{dataKey:"amount",radius:[0,4,4,0],children:ee.map((e,d)=>t.jsx(oe,{fill:z(d+5)},`cell-${d}`))})]})}):t.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-gray-400",children:"No data available"})})]})]}),t.jsxs(w.div,{variants:A,className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Ye,{className:"h-5 w-5 text-blue-500"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"All Transactions"}),t.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:["(",b.length,")"]})]}),t.jsxs("div",{className:"flex bg-gray-100 dark:bg-gray-800 p-0.5 sm:p-1 rounded-lg",children:[t.jsxs("button",{onClick:()=>Y("date"),className:`px-2 sm:px-3 py-1 text-xs sm:text-sm rounded-md transition-colors ${P==="date"?"bg-white dark:bg-gray-700 text-blue-600 dar
6k:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-400"}`,children:[t.jsx("span",{className:"hidden sm:inline",children:"By "}),"Date"]}),t.jsxs("button",{onClick:()=>Y("category"),className:`px-2 sm:px-3 py-1 text-xs sm:text-sm rounded-md transition-colors ${P==="category"?"bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-400"}`,children:[t.jsx("span",{className:"hidden sm:inline",children:"By "}),"Category"]}),t.jsx("button",{onClick:()=>Y("summary"),className:`px-2 sm:px-3 py-1 text-xs sm:text-sm rounded-md transition-colors ${P==="summary"?"bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-400"}`,children:"Summary"})]})]}),t.jsxs("div",{className:"max-h-96 overflow-y-auto space-y-4","data-lenis-prevent":!0,children:[P==="date"?Array.from(j.entries()).map(([e,d])=>t.jsxs("div",{children:[t.jsx("div",{className:"sticky top-0 bg-white dark:bg-[#242424] py-2",children:t.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:new Date(e).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"})})}),t.jsx("div",{className:"space-y-2",children:d.map(v=>t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-[#F5F5F5]",children:v.name}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:v.category})]}),t.jsxs("p",{className:`text-sm font-semibold ${v.type==="income"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[v.type==="income"?"+":"-",u(v.amount,r)]})]},v.id))})]},e)):P==="category"?Array.from(L.entries()).map(([e,d])=>{const v=d.reduce((s,C)=>s+Math.abs(C.amount),0);return t.jsxs("div",{children:[t.jsxs("div",{className:"sticky top-0 bg-white dark:bg-[#242424] py-2 flex items-center justify-between",children:[t.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:e}),t.jsx("p",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:u(v,r)})]}),t.jsx("div",{className:"space-y-2",children:d.map(s=>t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-[#F5F5F5]",children:s.name}),t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(I.normalizeDate(s.date)).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]}),t.jsxs("p",{className:`text-sm font-semibold ${s.type==="income"?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[s.type==="income"?"+":"-",u(s.amount,r)]})]},s.id))})]},e)}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-200 dark:border-gray-700",children:[t.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Expenses by Category"}),t.jsx("span",{className:"text-sm font-bold text-red-600 dark:text-red-400",children:u(y.totalExpenses,r)})]}),t.jsxs("div",{className:"mt-2 space-y-1",children:[T.map((e,d)=>t.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:z(d)}}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-[#F5F5F5]",children:e.category}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.count," transaction",e.count!==1?"s":""]})]})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("p",{className:"text-sm font-semibold text-red-600 dark:text-red-400",children:u(e.amount,r)}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.percentage.toFixed(1),"%"]})]})]},e.category)),T.length===0&&t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 py-2 text-center",children:"No expenses this month"})]})]}),t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-4"}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-200 dark:border-gray-700",children:[t.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Income by Category"}),t.jsx("span",{className:"text-sm font-bold text-green-600 dark:text-green-400",children:u(y.totalIncome,r)})]}),t.jsxs("div",{className:"mt-2 space-y-1",children:[V.map((e,d)=>t.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:z(d+6)}}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-[#F5F5F5]",children:e.category}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.count," transaction",e.count!==1?"s":""]})]})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("p",{className:"text-sm font-semibold text-green-600 dark:text-green-400",children:u(e.amount,r)}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.percentage.toFixed(1),"%"]})]})]},e.category)),V.length===0&&t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 py-2 text-center",children:"No income this month"})]})]}),t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4 mt-4",children:t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-100 dark:bg-gray-800 rounded-lg",children:[t.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Net Balance"}),t.jsxs("span",{className:`text-lg font-bold ${y.netSavings>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[y.netSavings>=0?"+":"",u(y.netSavings,r)]})]})})]}),b.length===0&&t.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400 py-8",children:"No transactions for this month"})]})]}),U.length>0&&t.jsxs(w.div,{variants:A,className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[t.jsx(He,{className:"h-5 w-5 text-purple-500"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Credit Card Spending"})]}),t.jsx("div",{className:"space-y-4",children:U.map(e=>t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900 dark:text-[#F5F5F5]",children:e.cardName}),e.last4Digits&&t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["**** ",e.last4Digits]})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(e.spending,r)}),t.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.transactionCount," transactions"]})]})]}),e.limit>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1",children:[t.jsx("span",{children:"Utilization"}),t.jsxs("span",{children:[e.utilization.toFixed(1),"%"]})]}),t.jsx("div",{className:"h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:t.jsx("div",{className:`h-full rounded-full transition-all ${e.utilization>=80?"bg-red-500":e.utilization>=50?"bg-yellow-500":"bg-green-500"}`,style:{width:`${Math.min(e.utilization,100)}%`}})})]})]},e.cardId))})]}),_.some(e=>e.paymentsMade>0)&&t.jsxs(w.div,{variants:A,className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[t.jsx(Ke,{className:"h-5 w-5 text-orange-500"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Loan Payments"})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"text-left text-xs text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",children:[t.jsx("th",{className:"pb-2 font-medium",children:"Loan"}),t.jsx("th",{className:"pb-2 font-medium text-right",children:"EMI"}),t.jsx("th",{className:"pb-2 font-medium text-right",children:"Payments"}),t.jsx("th",{className:"pb-2 font-medium text-right",children:"Total Paid"})]})}),t.jsx("tbody",{className:"text-sm",children:_.filter(e=>e.paymentsMade>0).map(e=>t.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-800",children:[t.jsx("td",{className:"py-3 text-gray-900 dark:text-[#F5F5F5]",children:e.loanName}),t.jsx("td",{className:"py-3 text-right text-gray-600 dark:text-gray-300",children:u(e.emi,r)}),t.jsx("td",{className:"py-3 text-right text-gray-600 dark:text-gray-300",children:e.paymentsMade}),t.jsx("td",{className:"py-3 text-right font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(e.totalPaid,r)})]},e.loanId))})]})})]}),R.length>0&&t.jsxs(w.div,{variants:A,className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[t.jsx(Ve,{className:"h-5 w-5 text-indigo-500"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Budget Performance"})]}),t.jsx("div",{className:"space-y-4",children:R.map(e=>t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-[#F5F5F5]",children:e.category}),t.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${e.status==="over"?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":e.status==="near"?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"}`,children:e.status==="over"?"Over budget":e.status==="near"?"Near limit":"On track"})]}),t.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1",children:[t.jsxs("span",{children:[u(e.spent,r)," of ",u(e.limit,r)]}),t.jsxs("span",{children:[e.percentage.toFixed(0),"%"]})]}),t.jsx("div",{className:"h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:t.jsx("div",{className:`h-full rounded-full transition-all ${e.status==="over"?"bg-red-500":e.status==="near"?"bg-yellow-500":"bg-green-500"}`,style:{width:`${Math.min(e.percentage,100)}%`}})})]},e.category))})]}),t.jsxs(w.div,{variants:A,className:"bg-white dark:bg-[#242424] rounded-xl p-5 border border-gray-200 dark:border-gray-700 shadow-sm",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[t.jsx(qe,{className:"h-5 w-5 text-yellow-500"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-[#F5F5F5]",children:"Insights"})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[n.highestSpendingDay&&t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"Highe
6st Spending Day"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:new Date(n.highestSpendingDay.date).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}),t.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u(n.highestSpendingDay.amount,r)})]}),n.mostUsedCategory&&t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"Most Used Category"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:n.mostUsedCategory.category}),t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[n.mostUsedCategory.count," transactions"]})]}),n.largestExpense&&t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"Largest Expense"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5] truncate",children:n.largestExpense.name}),t.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:u(n.largestExpense.amount,r)})]}),t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"Average Daily Spending"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(n.averageDailySpending,r)}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"per day"})]}),t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"Average Transaction"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(n.averageTransaction,r)}),t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"per expense"})]}),t.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800/50 rounded-lg",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:"Weekday vs Weekend"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Weekdays"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(n.weekdayVsWeekend.weekdaySpending,r)})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Weekends"}),t.jsx("p",{className:"font-semibold text-gray-900 dark:text-[#F5F5F5]",children:u(n.weekdayVsWeekend.weekendSpending,r)})]})]})]})]})]})]})})]})})}):null};export{it as default};

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.