1import{c as Le,u as Ie,r as g,j as e,$ as _e,w as B,K as z,N as A,G as K,H as M,J as F,x as R,O as be,s as oe,o as We}from"./index-MoAbC8_9.js";import{O as $e}from"./OwnersLayout-Cd0M3dw8.js";import{B as $}from"./badge-BHbYeRgi.js";import{T as Ge,a as He,c as je,b as ve}from"./tabs-5EVsfllK.js";import{D as Ze,a as Je,b as qe,c as Ue,d as Qe}from"./dialog-DrI7Oddz.js";import{S as Xe}from"./scroll-area-CoT3wSM0.js";import{S as ke}from"./separator-CQ84aZ0V.js";import{c as U,g as Ye}from"./useCategorySystem-D4jOQRmA.js";import{b as ea,u as aa,a as ta}from"./useReserveFundData-CaCbmV8U.js";import{B as sa}from"./breadcrumb-CmKLwRya.js";import{P as Ne}from"./piggy-bank-DP-A2O0m.js";import{A as we}from"./collapsible-BIxz44zB.js";import{E as na}from"./euro-Cc6O9qjZ.js";import{I as V}from"./info-CZr0REZX.js";import{W as ra}from"./wallet-e9E2tgeo.js";import{A as Ce}from"./arrow-up-right-CgIWjGgj.js";import{L as oa}from"./landmark-C0TkBs1l.js";import{C as ia}from"./credit-card-CGSfKXUy.js";import{T as X}from"./trending-down-EHPUNHPt.js";import{R as Y,C as ee,X as ae,Y as G,T as te,L as se,B as j,Q as De}from"./generateCategoricalChart-C2b_mvpD.js";import{C as ne}from"./ComposedChart-DcPErJ04.js";import{L as re}from"./Line-DFydwSLz.js";import{C as la}from"./circle-alert-CI-iPm0z.js";import{C as Be}from"./calendar-CnsXUgOr.js";import{A as ca}from"./arrow-down-right-TVCZaAHK.js";import{B as da}from"./building-crte1H4H.js";import{F as ma}from"./file-text-Bif0RP8Y.js";import{T as Re}from"./trending-up-Cg9WFJWB.js";import{M as Te}from"./minus-Dry52jGc.js";import"./Header-CnJGZ8vQ.js";import"./mountain-BHfTfCFy.js";import"./user-Cvsz7Lm_.js";import"./skeleton-ClxqB572.js";import"./switch-BHj3-8MN.js";import"./index-D9-GACGG.js";import"./house-DjS1WMqx.js";import"./receipt-DnGXta2k.js";import"./chart-column-Bo5i9GGE.js";import"./upload-BH1HltYO.js";import"./flame-wMx8KIS8.js";import"./users-xui-UtA1.js";import"./eye-DKrvAixa.js";import"./textarea-4z16PwID.js";import"./index-BdQq_4o_.js";import"./index-Dh4i1-J3.js";/** 2 * @license lucide-react v0.462.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 ua=Le("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]),pa=({houseCosts:k,onNavigate:L})=>{var ue,pe,xe,he,ge,fe;const{language:i}=Ie(),{data:m}=ea(),{data:p}=aa(),{data:S}=ta(),[I,H]=g.useState(0),[N,_]=g.useState(null),[Z,Pe]=g.useState(!0),[O,Se]=g.useState(!1),[b,Ee]=g.useState("stacked"),Q=[...new Set(k.map(a=>a.year))].sort(),E=Math.max(...Q),W=E-1;g.useEffect(()=>{(async()=>{const{data:n}=await oe.from("reserve_fund_settings").select("apartment_code").eq("excluded",!0),d=(n==null?void 0:n.map(r=>r.apartment_code))||[],{data:t}=await oe.from("apartments").select("code, sqm");if(t){const r=t.filter(o=>!d.includes(o.code)).reduce((o,l)=>o+(Number(l.sqm)||0),0);H(r)}})()},[]);const h=a=>new Intl.NumberFormat(i==="de"?"de-DE":"en-GB",{style:"currency",currency:"EUR",maximumFractionDigits:0}).format(a),ie=(a,n,d)=>{if(i==="de")return a;
6if(i==="en")return n||a;if(d)return d;const t={Mieterlöse:"PÅÃjmy z pronájmu",Miete:"Nájem",Mieteinnahmen:"PÅÃjmy z nájmu",Sonderumlage:"MimoÅádný pÅÃspÄvek",Zinsen:"Ãroky",Zinseinnahmen:"Ãrokové pÅÃjmy",Wäscherei:"Prádelna",Waschküche:"Prádelna",Eigentümerbeitrag:"PÅÃspÄvek vlastnÃka",Beitrag:"PÅÃspÄvek",Einnahmen:"PÅÃjmy",Rücklage:"Rezerva",Rücklagen:"Rezervy",Darlehen:"ÃvÄr",Kredit:"ÃvÄr",Tilgung:"Splátka",Rückzahlung:"Splátka",Sparkasse:"SpoÅitelna",Bank:"Banka",Instandhaltung:"Ãdržba",Instandsetzung:"Oprava",Reparatur:"Oprava",Reparaturen:"Opravy",Wartung:"Ãdržba",Sanierung:"Rekonstrukce",Renovierung:"Renovace",Erneuerung:"Obnova",Heizung:"TopenÃ",Heizungspumpe:"Äerpadlo topenÃ",Heizungsanlage:"Topný systém",Pumpe:"Äerpadlo",Kessel:"Kotel",Brenner:"HoÅák",Thermostat:"Termostat",Ventil:"Ventil",Rohr:"PotrubÃ",Rohre:"PotrubÃ",Leitung:"VedenÃ",Leitungen:"VedenÃ",Wände:"StÄny",Wand:"StÄna",Decke:"Strop",Decken:"Stropy",Boden:"Podlaha",Böden:"Podlahy",Fassade:"Fasáda",Fassaden:"Fasády",Dach:"StÅecha",Dächer:"StÅechy",Verkleiden:"ObloženÃ",Verkleidung:"ObloženÃ",Verspachteln:"TmelenÃ",Anstrich:"NátÄr",Malerarbeiten:"MalÃÅské práce",Fenster:"Okno",Tür:"DveÅe",Türen:"DveÅe",Eingangstür:"Vstupnà dveÅe",Haustür:"Domovnà dveÅe",Balkontür:"Balkonové dveÅe",Schiebetür:"Posuvné dveÅe",Schiebekipptür:"PosuvnÄ sklopné dveÅe",Garten:"Zahrada",Garage:"Garáž",Parkplatz:"ParkoviÅ¡tÄ",Zufahrt:"PÅÃjezdová cesta",Einfahrt:"Vjezd",Gehweg:"ChodnÃk",Terrasse:"Terasa",Balkon:"Balkón",Wasser:"Voda",Abwasser:"Odpadnà voda",Kanal:"Kanalizace",Kanalisation:"Kanalizace",Sanitär:"SanitárnÃ",Klempner:"Instalatér",Strom:"ElektÅina",Elektrik:"Elektrika",Elektriker:"ElektrikáÅ",Beleuchtung:"OsvÄtlenÃ",Lampe:"Lampa",Lampen:"Lampy",Energieausweis:"Energetický průkaz",Vermessungsarbeiten:"ZemÄmÄÅiÄské práce",Vermessung:"ZamÄÅenÃ",Gutachten:"Znalecký posudek","SV-Gutachten":"Znalecký posudek",Prüfung:"Kontrola",Inspektion:"Inspekce",Wartungsvertrag:"Servisnà smlouva",Versicherung:"PojiÅ¡tÄnÃ",Versicherungen:"PojiÅ¡tÄnÃ",Gebäudeversicherung:"PojiÅ¡tÄnà budovy",Haftpflicht:"OdpovÄdnost",Austausch:"VýmÄna",Ersatz:"Náhrada",Ablöse:"Odstupné",Investitionen:"Investice",Investition:"Investice",Nachrüsten:"DovybavenÃ",Nachrüstung:"DovybavenÃ",Einbau:"Instalace",Montage:"Montáž",Demontage:"Demontáž",Reinigung:"ÄiÅ¡tÄnÃ",Tropfblech:"OkapniÄka",Einlauf:"Vtok",Ablauf:"Odtok",Rinne:"Žlab",Dachrinne:"Okapový žlab",Fallrohr:"Svod","def.":"vadné",defekt:"vadný",defekte:"vadné",defekter:"vadný",beschädigt:"poÅ¡kozený",kaputt:"rozbitý",TOP:"BJ",Wohnung:"Byt",Haus:"Dům",Gebäude:"Budova",Keller:"Sklep",Lager:"Sklad",Hausverwaltung:"Správa domu",Verwaltung:"Správa",K
6osten:"Náklady",Rechnung:"Faktura",Zahlung:"Platba",jährlich:"roÄnÃ",monatlich:"mÄsÃÄnÃ"};let r=a;for(const[o,l]of Object.entries(t))r=r.replace(new RegExp(o,"gi"),l);return r},T=g.useMemo(()=>{const a=k.filter(u=>u.year===E),n=k.filter(u=>u.year===W),d=a.reduce((u,y)=>u+Number(y.amount),0),t=n.reduce((u,y)=>u+Number(y.amount),0),r=a.filter(u=>!u.is_repair_fund).reduce((u,y)=>u+Number(y.amount),0),o=n.filter(u=>!u.is_repair_fund).reduce((u,y)=>u+Number(y.amount),0),l=a.filter(u=>u.is_repair_fund).reduce((u,y)=>u+Number(y.amount),0),x=n.filter(u=>u.is_repair_fund).reduce((u,y)=>u+Number(y.amount),0),c=m==null?void 0:m.find(u=>u.year===E),f=(c==null?void 0:c.endBalance)||0,v=(c==null?void 0:c.contributions)||55e3;return{totalCosts:d,totalChange:U(d,t),operatingCosts:r,operatingChange:U(r,o),repairFundCosts:l,repairFundChange:U(l,x),fundBalance:f,fundContribution:v,costsPerSqm:I>0?d/I:0,currentYear:E,previousYear:W}},[k,E,W,m,I]),ze={facility:["Hallenbad","Aufzug","AuÃenanlagen","Schneeräumung"],management:["Hausverwaltung"],insurance:["Versicherung"],fees:["Müllabfuhr","Kanal","Grundsteuer","Bankspesen","Postspesen"],energy:["Strom","Telefon","Internet"],maintenance:["Instandhaltung","Material","Reparaturen","Diverses","Sonstige"]},w={facility:"#06b6d4",management:"#ffc658",insurance:"#8b5cf6",fees:"#8884d8",energy:"#f97316",maintenance:"#82ca9d"},Ae=g.useMemo(()=>Q.map(a=>{const n=k.filter(t=>t.year===a&&!t.is_repair_fund),d={year:a.toString(),facility:0,management:0,insurance:0,fees:0,energy:0,maintenance:0,total:0};return n.forEach(t=>{const r=t.subcategory||"";let o=!1;for(const[l,x]of Object.entries(ze))if(x.some(c=>r.includes(c))){d[l]+=Number(t.amount),o=!0;break}o||(d.maintenance+=Number(t.amount))}),d.total=Object.entries(d).filter(([t])=>t!=="year"&&t!=="total").reduce((t,[r,o])=>t+(typeof o=="number"?o:0),0),d}),[k,Q]),le=g.useMemo(()=>m?m.map((a,n)=>{const d=(p==null?void 0:p.filter(c=>c.year===a.year))||[],t=d.filter(c=>c.type==="sonderumlage").reduce((c,f)=>c+f.amount,0),r=d.filter(c=>c.type!=="sonderumlage").reduce((c,f)=>c+f.amount,0),o=n>0?m[n-1]:null,l=o?(p==null?void 0:p.filter(c=>c.year===o.year))||[]:[],x=l.filter(c=>c.type==="sonderumlage").reduce((c,f)=>c+f.amount,0);return l.filter(c=>c.type!=="sonderumlage").reduce((c,f)=>c+f.amount,0),{year:a.year.toString(),startBalance:a.startBalance,contributions:a.contributions,sonderumlage:t,otherExtraIncome:r,loanRepayments:-a.loanRepayments,maintenance:-(a.expenditures-a.loanRepayments),endBalance:a.endBalance,totalIncome:a.contributions+a.otherIncome,totalExpenses:a.expenditures+a.loanRepayments,contributionsYoy:o&&o.contributions>0?(a.contributions-o.contributions)/o.contributions*100:0,sonderumlageYoy:x>0?(t-x)/x*100:t>0?100:0,loanRepaymentsYoy:o&&o.loanRepayments>0?(a.loanRepayments-o.loanRepayments)/o.loanRepayments*100:0,maintenanceYoy:o&&o.expenditures-o.loanRepayments>0?(a.expenditures-a.loanRepayments-(o.expenditures-o.loanRepayments))/(o.expenditures-o.loanRepayments)*100:a.expenditures-a.loanRepayments>0?100:0,endBalanceYoy:o&&o.endBalance>0?(a.endBalance-o.endBalance)/o.endBalance*100:0,startBalanceYoy:o&&o.startBalance>0?(a.startBalance-o.startBalance)/o.startBalance*100:0}}):[],[m,p]);g.useMemo(()=>{if(!m)return[];const a=[];return m.forEach((n,d)=>{const r=((p==null?void 0:p.filter(l=>l.year===n.year))||[]).filter(l=>l.type==="sonderumlage").reduce((l,x)=>l+x.amount,0);a.push({name:`${n.year}`,value:n.startBalance,type:"start",fill:"hsl(var(--muted-foreground))"}),a.push({name:"+PÅÃspÄvky",value:n.contributions,type:"income",fill:"hsl(142 76% 36%)"}),n.otherIncome>0&&a.push({name:r>0?"+Sonderumlage":"+Extra",value:n.otherIncome,type:"income",fill:"hsl(217 91% 60%)"}),n.loanRepayments>0&&a.push({name:"-ÃvÄr",value:-n.loanRepayments,type:"expense",fill:"hsl(0 84% 60%)"});const o=n.expenditures-n.loanRepayments;o>0&&a.push({name:"-Ãdržba",value:-o,type:"expense",fill:"hsl(25 95% 53%)"}),a.push({name:`=${n.year}`,value:n.endBalance,type:"end",fill:"hsl(var(--primary))"}),d<m.length-1&&a.push({name:"",value:0,type:"separator",fill:"transparent"})}),a},[m,p]);const ce=g.useMemo(()=>p?p.filter(a=>a.type==="sonderumlage"||a.amount>1e4).map(a=>({year:a.year,type:a.type,description:i==="en"&&a.descriptionEn?a.descriptionEn:a.description,amount:a.amount,notes:a.notes})):[],[p,i]);g.useMemo(()=>{const a=k.filter(t=>t.year===E),n=k.filter(t=>t.year===W);return[{key:"operating",label:i==="de"?"Betriebskosten":i==="cs"?"Provoznà náklady":"Operating Costs",icon:sa,color:"hsl(var(--primary))",current:a.filter(t=>!t.is_repair_fund&&t.category!=="Voda_Cesty").reduce((t,r)=>t+Number(r.amount),0),previous:n.filter(t=>!t.is_repair_fund&&t.category!=="Voda_Cesty").reduce((t,r)=>t+Number(r.amount),0)},{key:"repairFund",label:i==="de"?"Reparaturfonds":i==="cs"?"Fond oprav":"Repair Fund",icon:Ne,color:"hsl(var(--alpine-sunset))",current:a.filter(t=>
6t.is_repair_fund).reduce((t,r)=>t+Number(r.amount),0),previous:n.filter(t=>t.is_repair_fund).reduce((t,r)=>t+Number(r.amount),0)},{key:"waterRoads",label:i==="de"?"Wasser & Wege":i==="cs"?"Voda a cesty":"Water & Roads",icon:we,color:"hsl(var(--accent))",current:a.filter(t=>t.category==="Voda_Cesty").reduce((t,r)=>t+Number(r.amount),0),previous:n.filter(t=>t.category==="Voda_Cesty").reduce((t,r)=>t+Number(r.amount),0)}].map(t=>({...t,change:U(t.current,t.previous)}))},[k,E,W,i]);const Oe=({change:a,invertedContext:n=!1})=>{const d=a.direction==="up"?Re:a.direction==="down"?X:Te,t=n?a.direction==="up"?"down":a.direction==="down"?"up":"neutral":a.direction,r=Ye(t);return e.jsxs("div",{className:`flex items-center gap-1 ${r}`,children:[e.jsx(d,{className:"h-4 w-4"}),e.jsxs("span",{className:"text-sm font-medium",children:[a.percentage>0?"+":"",a.percentage.toFixed(1),"%"]})]})},Ke=({change:a})=>{const n=a.direction==="up"?Re:a.direction==="down"?X:Te,t=a.direction==="down"?"text-green-600":a.direction==="up"?"text-red-600":"text-muted-foreground";return e.jsxs("div",{className:`flex items-center gap-1 ${t}`,children:[e.jsx(n,{className:"h-4 w-4"}),e.jsxs("span",{className:"text-sm font-medium",children:[a.percentage>0?"+":"",a.percentage.toFixed(1),"%"]})]})},C=g.useMemo(()=>{if(!N)return null;const a=m==null?void 0:m.find(t=>t.year===N),n=(p==null?void 0:p.filter(t=>t.year===N))||[],d=(S==null?void 0:S.filter(t=>t.year===N))||[];return{yearData:a,incomeItems:n,expenditureItems:d,totalIncome:n.reduce((t,r)=>t+r.amount,0),totalExpenditures:d.reduce((t,r)=>t+r.amount,0)}},[N,m,p,S]),de=a=>{if(a&&a.activePayload&&a.activePayload[0]){const n=parseInt(a.activePayload[0].payload.year);_(n)}},P=g.useMemo(()=>{const a=[{id:"514825",name:{cs:"Sanace domu",de:"Kredit Sanierung",en:"Building renovation"},principal:29e4,monthlyPayment:2640.71,numberOfPayments:120,firstPaymentDate:"2015-03-05",endDate:"2025-02-05",status:"completed"},{id:"760220",name:{cs:"VýmÄna topenÃ",de:"Kredit Heizung",en:"Heating system"},principal:7e4,monthlyPayment:656.02,numberOfPayments:116,firstPaymentDate:"2017-06-05",endDate:"2027-01-05",status:"active"}],n=new Date;let d=0,t=0,r=null;a.forEach(x=>{const c=new Date(x.endDate);if(c>n){t++;const f=new Date(x.firstPaymentDate),v=Math.floor((n.getTime()-f.getTime())/(1e3*60*60*24*30.44)),y=Math.max(0,x.numberOfPayments-v)*x.monthlyPayment;d+=y,(!r||c<r)&&(r=c)}});const o=a.reduce((x,c)=>x+c.principal,0),l=o>0?(o-d)/o*100:100;return{remaining:d,activeLoans:t,nextPayoffDate:r,percentPaid:Math.min(100,Math.max(0,l)),totalPrincipal:o}},[]),me={de:{title:"Hauskosten-Ãbersicht",subtitle:"Wichtige Kennzahlen und Trends",totalCosts:"Gesamtkosten",operatingCosts:"Betriebskosten",repairFund:"Reparaturfonds-Ausgaben",fundBalance:"Fondsstand",fundContribution:"Fondsbeitrag",costsPerSqm:"Kosten pro m²",yearOverYear:"ggü. Vorjahr",viewDetails:"Details anzeigen",costTrends:"Kostenentwicklung",costTrendsDesc:"Vergleich Betriebskosten und Reparaturfonds",categories:"Kategorienübersicht",categoriesDesc:"Klicken Sie für Details",costsIncreased:"Kosten gestiegen",costsDecreased:"Kosten gesunken",stable:"Stabil",totalCostsTooltip:"Summe aller Betriebs- und Reparaturfondskosten für das aktuelle Jahr",operatingCostsTooltip:"Laufende Betriebskosten (Verwaltung, Reinigung, Versicherung, etc.)",repairFundTooltip:"Ausgaben aus dem Reparaturfonds für Instandhaltung und Reparaturen. Ein Rückgang der Ausgaben ist positiv â es bedeutet weniger Fondsentnahme.",fundBalanceTooltip:"Aktueller Kontostand des Reparaturfonds",fundContributionTooltip:"Jährlicher Beitrag zum Reparaturfonds",perYear:"pro Jahr",operatingTab:"Betriebskosten",fundCashFlowTab:"Fonds Cashflow",extraordinaryEvents:"AuÃerordentliche Ereignisse",extraordinaryEventsDesc:"Wichtige finanzielle Ereignisse, die den Fondsverlauf beeinflusst haben",sonderumlage:"Sonderumlage",contributions:"Beiträge",extraIncome:"Zusätzliche Einnahmen",loanRepayments:"Darlehenstilgung",maintenance:"Instandhaltung",startBalance:"Anfangsstand",endBalance:"Endstand",yearDetail:"Jahresdetail",yearDetailDesc:"Detaillierter Ãberblick über Einnahmen und Ausgaben",income:"Einnahmen",expenditures:"Ausgaben",vendor:"Lieferant",date:"Datum",invoiceNumber:"Rechnungsnummer",category:"Kategorie",noItems:"Keine Einträge",clickOnChart:"Klicken Sie auf einen Balken für Details",rental:"Miete",interest:"Zinsen",laundry:"Wäscherei",other:"Sonstiges",repair:"Reparatur",insurance:"Versicherung",perMonth:"pro Monat",contributionPerSqmTooltip:"Monatlicher/jährlicher Beitrag pro Quadratmeter Wohnfläche. Klicken Sie, um zwischen monatlicher und jährlicher Ansicht zu wechseln.",loanBalance:"Darlehensstand",loanBalanceTooltip:"Restbetrag aller aktiven Darlehen",paidOff:"getilgt",payoffBy:"Tilgung bis",activeLoan:"aktives Darlehen",categoryFacility:"Facility",categoryManagement:"Verwaltung",categoryInsurance:"Versicherung",categoryFees:"Gebühren",categoryEnergy:"Energie",categoryMaintenance:"Wartung"},en:{title:"House Costs Overview",subtitle:"Key metrics and trends",totalCosts:"Total Costs",operatingCosts:"Operating Costs",repairFund:"Repair Fund Expenses",fundBalance:"Fund Balance",fundContribution:"Fund Contribution",costsPerSqm:"Costs per m²",yearOverYear:"year over year",viewDetails:"View Details",costTrends:"Cost Trends",costTrendsDesc:"Operating costs vs repair fund comparison",categories:"Categories Overview",categoriesDesc:"Click for category details",costsIncreased:"Costs increased",costsDecreased:"Costs decreased",stable:"Stable",totalCostsTooltip:"Sum of all operating and repair fund costs for the current year",operatingCostsTooltip:"Ongoing operating costs (management, cleaning, insurance, etc.)",repairFundTooltip:"Expenditures from the repair fund for maintenance and repairs. A decrease in spending is positive â it means less fund withdrawal.",fundBalanceTooltip:"
6Current account balance of the repair fund",fundContributionTooltip:"Annual contribution to the repair fund",perYear:"per year",operatingTab:"Operating Costs",fundCashFlowTab:"Fund Cash Flow",extraordinaryEvents:"Extraordinary Events",extraordinaryEventsDesc:"Important financial events that influenced the fund development",sonderumlage:"Special Assessment",contributions:"Contributions",extraIncome:"Extra Income",loanRepayments:"Loan Repayments",maintenance:"Maintenance",startBalance:"Start Balance",endBalance:"End Balance",yearDetail:"Year Detail",yearDetailDesc:"Detailed overview of income and expenditures",income:"Income",expenditures:"Expenditures",vendor:"Vendor",date:"Date",invoiceNumber:"Invoice Number",category:"Category",noItems:"No items",clickOnChart:"Click on a bar for details",rental:"Rental",interest:"Interest",laundry:"Laundry",other:"Other",repair:"Repair",insurance:"Insurance",perMonth:"per month",contributionPerSqmTooltip:"Monthly/yearly contribution per square meter of living space. Click to toggle between monthly and yearly view.",loanBalance:"Loan Balance",loanBalanceTooltip:"Remaining amount to be paid on all active loans",paidOff:"paid off",payoffBy:"Payoff by",activeLoan:"active loan",categoryFacility:"Facility",categoryManagement:"Management",categoryInsurance:"Insurance",categoryFees:"Fees",categoryEnergy:"Energy",categoryMaintenance:"Maintenance"},cs:{title:"PÅehled nákladů domu",subtitle:"KlÃÄové ukazatele a trendy",totalCosts:"Celkové náklady",operatingCosts:"Provoznà náklady",repairFund:"Výdaje z fondu oprav",fundBalance:"Stav fondu",fundContribution:"PÅÃspÄvek do fondu",costsPerSqm:"Náklady na m²",yearOverYear:"oproti loÅsku",viewDetails:"Zobrazit detail",costTrends:"Vývoj nákladů",costTrendsDesc:"Porovnánà provoznÃch nákladů a fondu oprav",categories:"PÅehled kategoriÃ",categoriesDesc:"KliknÄte pro detail",costsIncreased:"Náklady vzrostly",costsDecreased:"Náklady klesly",stable:"StabilnÃ",totalCostsTooltip:"SouÄet vÅ¡ech provoznÃch nákladů a výdajů z fondu oprav za aktuálnà rok",operatingCostsTooltip:"BÄžné provoznà náklady (správa, úklid, pojiÅ¡tÄnà apod.)",repairFundTooltip:"Výdaje z fondu oprav na údržbu a opravy domu. Pokles výdajů je pozitivnà â znamená menšà Äerpánà fondu.",fundBalanceTooltip:"Aktuálnà zůstatek na úÄtu fondu oprav",fundContributionTooltip:"RoÄnà pÅÃspÄvek do fondu oprav",perYear:"roÄnÄ",operatingTab:"Provoznà náklady",fundCashFlowTab:"Cash flow fondu",extraordinaryEvents:"MimoÅádné události",extraordinaryEventsDesc:"Důležité finanÄnà události, které ovlivnily vývoj fondu",sonderumlage:"MimoÅádný pÅÃspÄvek",contributions:"PÅÃspÄvky",extraIncome:"Extra pÅÃjmy",loanRepayments:"Splátky úvÄru",maintenance:"Ãdržba",startBalance:"PoÄáteÄnà stav",endBalance:"KoneÄný stav",yearDetail:"Detail roku",yearDetailDesc:"Podrobný pÅehled pÅÃjmů a výdajů",income:"PÅÃjmy",expenditures:"Výdaje",vendor:"Dodavatel",date:"Datum",invoiceNumber:"ÄÃslo faktury",category:"Kategorie",noItems:"Žádné položky",clickOnChart:"KliknÄte na sloupec pro detail",rental:"Pronájem",interest:"Ãroky",laundry:"Prádelna",other:"OstatnÃ",repair:"Oprava",insurance:"PojiÅ¡tÄnÃ",perMonth:"mÄsÃÄnÄ",contributionPerSqmTooltip:"MÄsÃÄnÃ/roÄnà pÅÃspÄvek na metr ÄtvereÄnà obytné plochy. KliknutÃm pÅepnete mezi mÄsÃÄnÃm a roÄnÃm zobrazenÃm.",loanBalance:"Zůstatek úvÄru",loanBalanceTooltip:"ZbývajÃcà Äástka k doplacenà na vÅ¡ech aktivnÃch úvÄrech",paidOff:"splaceno",payoffBy:"Splacenà do",activeLoan:"aktivnà úvÄr",categoryFacility:"Facility",categoryManagement:"Správa",categoryInsurance:"PojiÅ¡tÄnÃ",categoryFees:"Poplatky",categoryEnergy:"Energie",categoryMaintenance:"Ãdržba"}},s=me[i]||me.de,Me=({active:a,payload:n,label:d})=>{var f;if(!a||!(n!=null&&n.length))return null;const t=(f=n[0])==null?void 0:f.payload;if(!t)return null;const r=m==null?void 0:m.find(v=>v.year.toString()===t.year);if(!r)return null;const l=((p==null?void 0:p.filter(v=>v.year===r.year))||[]).filter(v=>v.type==="sonderumlage").reduce((v,u)=>v+u.amount,0),x=r.otherIncome-l,c=r.expenditures-r.loanRepayments;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg p-4 min-w-[200px]",children:[e.jsx("p",{className:"font-bold text-lg mb-3 border-b pb-2",children:t.year}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between text-muted-foreground",children:[e.jsxs("span",{children:[s.startBalance,":"]}),e.jsx("span",{className:"font-medium",children:h(r.startBalance)})]}),e.jsxs("div",{className:"flex justify-between text-green-600",children:[e.jsxs("span",{children:["+ ",s.contributions,":"]}),e.jsx("span",{className:"font-medium",children:h(r.contributions)})]}),l>0&&e.jsxs("div",{className:"flex justify-between text-blue-600",children:[e.jsxs("span",{children:["+ ",s.sonderumlage,":"]}
6),e.jsx("span",{className:"font-medium",children:h(l)})]}),x>0&&e.jsxs("div",{className:"flex justify-between text-blue-500",children:[e.jsxs("span",{children:["+ ",s.extraIncome,":"]}),e.jsx("span",{className:"font-medium",children:h(x)})]}),r.loanRepayments>0&&e.jsxs("div",{className:"flex justify-between text-red-600",children:[e.jsxs("span",{children:["- ",s.loanRepayments,":"]}),e.jsx("span",{className:"font-medium",children:h(r.loanRepayments)})]}),c>0&&e.jsxs("div",{className:"flex justify-between text-orange-600",children:[e.jsxs("span",{children:["- ",s.maintenance,":"]}),e.jsx("span",{className:"font-medium",children:h(c)})]}),e.jsxs("div",{className:"flex justify-between font-bold border-t pt-2 text-primary",children:[e.jsxs("span",{children:["= ",s.endBalance,":"]}),e.jsx("span",{children:h(r.endBalance)})]})]})]})},Fe=({active:a,payload:n,label:d})=>{var ye;if(!a||!(n!=null&&n.length))return null;const t=(ye=n[0])==null?void 0:ye.payload;if(!t)return null;const r=(m==null?void 0:m.findIndex(D=>D.year.toString()===t.year))??-1,o=m==null?void 0:m[r],l=r>0?m==null?void 0:m[r-1]:null;if(!o)return null;p!=null&&p.filter(D=>D.year===o.year),l&&p!=null&&p.filter(D=>D.year===l.year);const x=o.expenditures-o.loanRepayments,c=l?l.expenditures-l.loanRepayments:0,f=l?o.contributions-l.contributions:0,v=l?o.loanRepayments-l.loanRepayments:0,u=l?x-c:0,y=l?o.endBalance-l.endBalance:0,J=D=>`${D>=0?"+":""}${h(D)}`,q=D=>`${D>=0?"+":""}${D.toFixed(1)}%`;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg p-4 min-w-[280px]",children:[e.jsxs("p",{className:"font-bold text-lg mb-3 border-b pb-2",children:[t.year," vs ",l?l.year:"â"]}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-green-600",children:[s.contributions,":"]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`font-medium ${t.contributionsYoy>=0?"text-green-600":"text-red-600"}`,children:q(t.contributionsYoy)}),e.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",J(f),")"]})]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-red-600",children:[s.loanRepayments,":"]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`font-medium ${t.loanRepaymentsYoy<=0?"text-green-600":"text-red-600"}`,children:q(t.loanRepaymentsYoy)}),e.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",J(v),")"]})]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-orange-600",children:[s.maintenance,":"]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`font-medium ${t.maintenanceYoy<=0?"text-green-600":"text-red-600"}`,children:q(t.maintenanceYoy)}),e.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",J(u),")"]})]})]}),e.jsxs("div",{className:"flex justify-between items-center font-bold border-t pt-2",children:[e.jsxs("span",{className:"text-primary",children:[s.endBalance,":"]}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`${t.endBalanceYoy>=0?"text-green-600":"text-red-600"}`,children:q(t.endBalanceYoy)}),e.jsxs("span",{className:"text-muted-foreground ml-2 text-xs font-normal",children:["(",J(y),")"]})]})]})]})]})};return e.jsx(_e,{children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-5",children:[e.jsxs(B,{className:"border-2 border-primary/20",children:[e.jsx(z,{className:"pb-2",children:e.jsxs(A,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(na,{className:"h-4 w-4"}),s.totalCosts," ",T.currentYear,e.jsxs(K,{children:[e.jsx(M,{asChild:!0,children:e.jsx(V,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-help"})}),e.jsx(F,{side:"top",className:"max-w-xs",children:e.jsx("p",{children:s.totalCostsTooltip})})]})]})}),e.jsxs(R,{children:[e.jsx("div",{className:"text-2xl font-bold",children:h(T.totalCosts)}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsx(Oe,{change:T.totalChange}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s.yearOverYear})]})]})]}),e.jsxs(B,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs(A,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(Ne,{className:"h-4 w-4"}),s.repairFund,e.jsxs(K,{children:[e.jsx(M,{asChild:!0,children:e.jsx(V,{className:"h-3.5 w-3.5 text-muted-foreground
6/60 cursor-help"})}),e.jsx(F,{side:"top",className:"max-w-xs",children:e.jsx("p",{children:s.repairFundTooltip})})]})]})}),e.jsxs(R,{children:[e.jsx("div",{className:"text-xl font-bold text-[hsl(var(--alpine-sunset))]",children:h(T.repairFundCosts)}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsx(Ke,{change:T.repairFundChange}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s.yearOverYear})]})]})]}),e.jsxs(B,{className:"bg-green-50/50 dark:bg-green-950/20 border-green-200/50",children:[e.jsx(z,{className:"pb-2",children:e.jsxs(A,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(ra,{className:"h-4 w-4 text-green-600"}),s.fundContribution,e.jsxs(K,{children:[e.jsx(M,{asChild:!0,children:e.jsx(V,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-help"})}),e.jsx(F,{side:"top",className:"max-w-xs",children:e.jsx("p",{children:s.fundContributionTooltip})})]})]})}),e.jsxs(R,{children:[e.jsx("div",{className:"text-xl font-bold text-green-600",children:h(T.fundContribution)}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ce,{className:"h-4 w-4 text-green-600"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s.perYear})]}),e.jsxs(K,{children:[e.jsx(M,{asChild:!0,children:e.jsxs("button",{onClick:()=>Pe(!Z),className:"text-xs font-medium text-green-700 bg-green-100 dark:bg-green-900/30 hover:bg-green-200 dark:hover:bg-green-900/50 px-2 py-0.5 rounded cursor-pointer transition-colors flex items-center gap-1",children:["â¬",I>0?Z?(T.fundContribution/12/I).toFixed(2):(T.fundContribution/I).toFixed(2):Z?"2.13":"25.58","/m²/",Z?i==="cs"?"mÄs.":i==="de"?"Mon.":"mo.":i==="cs"?"rok":i==="de"?"Jahr":"yr."]})}),e.jsx(F,{side:"bottom",className:"max-w-xs",children:e.jsx("p",{className:"text-xs",children:s.contributionPerSqmTooltip})})]})]})]})]}),e.jsxs(B,{children:[e.jsx(z,{className:"pb-2",children:e.jsxs(A,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(oa,{className:"h-4 w-4"}),s.fundBalance,e.jsxs(K,{children:[e.jsx(M,{asChild:!0,children:e.jsx(V,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-help"})}),e.jsx(F,{side:"top",className:"max-w-xs",children:e.jsx("p",{children:s.fundBalanceTooltip})})]})]})}),e.jsxs(R,{children:[e.jsx("div",{className:"text-xl font-bold text-green-600",children:h(T.fundBalance)}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[i==="cs"?"Aktuálnà zůstatek":i==="de"?"Aktueller Stand":"Current balance"," ",T.currentYear]})]})]}),e.jsxs(B,{className:"bg-amber-50/50 dark:bg-amber-950/20 border-amber-200/50 cursor-pointer hover:shadow-lg transition-all hover:border-amber-400/50",onClick:()=>L==null?void 0:L("loans"),children:[e.jsx(z,{className:"pb-2",children:e.jsxs(A,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[e.jsx(ia,{className:"h-4 w-4 text-amber-600"}),s.loanBalance,e.jsxs(K,{children:[e.jsx(M,{asChild:!0,children:e.jsx(V,{className:"h-3.5 w-3.5 text-muted-foreground/60 cursor-help"})}),e.jsx(F,{side:"top",className:"max-w-xs",children:e.jsx("p",{children:s.loanBalanceTooltip})})]})]})}),e.jsxs(R,{children:[e.jsx("div",{className:"text-xl font-bold text-amber-600",children:P.remaining>0?h(P.remaining):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-green-600",children:"â"}),e.jsx("span",{className:"text-green-600",children:s.paidOff})]})}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:P.activeLoans>0?e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"h-4 w-4 text-amber-600"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[P.activeLoans," ",s.activeLoan]})]}):e.jsxs("span",{className:"text-xs text-green-600 font-medium",children:["100% ",s.paidOff]})}),P.nextPayoffDate&&e.jsxs("span",{className:"text-xs font-medium text-amber-700 bg-amber-100 dar
6k:bg-amber-900/30 px-2 py-0.5 rounded",children:[s.payoffBy," ",P.nextPayoffDate.getFullYear()]})]}),P.remaining>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:e.jsxs("span",{children:[P.percentPaid.toFixed(0),"% ",s.paidOff]})}),e.jsx("div",{className:"h-1.5 bg-amber-200/50 dark:bg-amber-800/30 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-amber-500 rounded-full transition-all",style:{width:`${P.percentPaid}%`}})})]})]})]})]}),e.jsxs(B,{children:[e.jsxs(z,{children:[e.jsxs(A,{className:"font-serif flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-primary"}),s.costTrends]}),e.jsx(be,{children:s.costTrendsDesc})]}),e.jsx(R,{children:e.jsxs(Ge,{defaultValue:"cashflow",className:"w-full",children:[e.jsxs(He,{className:"grid w-full max-w-md grid-cols-2 mb-4",children:[e.jsx(je,{value:"operating",children:s.operatingTab}),e.jsx(je,{value:"cashflow",children:s.fundCashFlowTab})]}),e.jsxs(ve,{value:"operating",children:[e.jsx("div",{className:"flex items-center justify-end mb-2",children:e.jsx("button",{onClick:()=>Ee(b==="stacked"?"grouped":"stacked"),className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${b==="grouped"?"bg-primary text-primary-foreground border-primary":"bg-muted hover:bg-muted/80 border-border"}`,children:b==="stacked"?i==="cs"?"SlouÄené":i==="de"?"Gestapelt":"Stacked":i==="cs"?"Vedle sebe":i==="de"?"Gruppiert":"Grouped"})}),e.jsx(Y,{width:"100%",height:300,children:e.jsxs(ne,{data:Ae,children:[e.jsx(ee,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(ae,{dataKey:"year"}),e.jsx(G,{tickFormatter:a=>`â¬${(a/1e3).toFixed(0)}k`}),e.jsx(te,{content:({active:a,payload:n,label:d})=>{var o;if(!a||!(n!=null&&n.length))return null;const t=(o=n[0])==null?void 0:o.payload;if(!t)return null;const r=t.total;return e.jsxs("div",{className:"bg-background border rounded-lg shadow-lg p-3 min-w-[180px]",children:[e.jsx("p",{className:"font-bold text-base mb-2 border-b pb-1",children:d}),e.jsxs("div",{className:"space-y-1 text-sm",children:[[{key:"facility",label:s.categoryFacility,color:w.facility},{key:"management",label:s.categoryManagement,color:w.management},{key:"insurance",label:s.categoryInsurance,color:w.insurance},{key:"fees",label:s.categoryFees,color:w.fees},{key:"energy",label:s.categoryEnergy,color:w.energy},{key:"maintenance",label:s.categoryMaintenance,color:w.maintenance}].map(l=>{const x=t[l.key],c=r>0?(x/r*100).toFixed(0):"0";return e.jsxs("div",{className:"flex justify-between items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:l.color}}),e.jsxs("span",{children:[l.label,":"]})]}),e.jsxs("span",{className:"font-medium",children:[h(x)," (",c,"%)"]})]},l.key)}),e.jsxs("div",{className:"flex justify-between font-bold border-t pt-1 mt-1",children:[e.jsxs("span",{children:[i==="cs"?"Celkem":i==="de"?"Gesamt":"Total",":"]}),e.jsx("span",{children:h(r)})]})]})]})}}),e.jsx(se,{}),e.jsx(j,{dataKey:"facility",name:s.categoryFacility,stackId:b==="stacked"?"costs":void 0,fill:w.facility,radius:b==="grouped"?[4,4,0,0]:void 0}),e.jsx(j,{dataKey:"management",name:s.categoryManagement,stackId:b==="stacked"?"costs":void 0,fill:w.management,radius:b==="grouped"?[4,4,0,0]:void 0}),e.jsx(j,{dataKey:"insurance",name:s.categoryInsurance,stackId:b==="stacked"?"costs":void 0,fill:w.insurance,radius:b==="grouped"?[4,4,0,0]:void 0}),e.jsx(j,{dataKey:"fees",name:s.categoryFees,stackId:b==="stacked"?"costs":void 0,fill:w.fees,radius:b==="grouped"?[4,4,0,0]:void 0}),e.jsx(j,{dataKey:"energy",name:s.categoryEnergy,stackId:b==="stacked"?"costs":void 0,fill:w.energy,radius:b==="grouped"?[4,4,0,0]:void 0}),e.jsx(j,{dataKey:"maintenance",name:s.categoryMaintenance,stackId:b==="stacked"?"costs":void 0,fill:w.maintenance,radiu
6s:[4,4,0,0]})]})})]}),e.jsxs(ve,{value:"cashflow",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.clickOnChart}),e.jsx("button",{onClick:()=>Se(!O),className:`text-xs px-3 py-1.5 rounded-full border transition-colors ${O?"bg-primary text-primary-foreground border-primary":"bg-muted hover:bg-muted/80 border-border"}`,children:O?i==="cs"?"% ZmÄny":i==="de"?"% Ãnderungen":"% Changes":i==="cs"?"Absolutnà â¬":"Absolute â¬"})]}),O?e.jsx(Y,{width:"100%",height:350,children:e.jsxs(ne,{data:le,onClick:de,className:"cursor-pointer",children:[e.jsx(ee,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(ae,{dataKey:"year"}),e.jsx(G,{yAxisId:"left",tickFormatter:a=>`${a.toFixed(0)}%`,domain:["auto","auto"]}),e.jsx(G,{yAxisId:"right",orientation:"right",tickFormatter:a=>`${a.toFixed(0)}%`,domain:["auto","auto"]}),e.jsx(te,{content:e.jsx(Fe,{})}),e.jsx(se,{}),e.jsx(De,{yAxisId:"left",y:0,stroke:"hsl(var(--muted-foreground))",strokeWidth:2}),e.jsx(j,{yAxisId:"left",dataKey:"contributionsYoy",name:`${s.contributions} %`,fill:"hsl(142 76% 36%)",radius:[4,4,0,0]}),e.jsx(j,{yAxisId:"left",dataKey:"loanRepaymentsYoy",name:`${s.loanRepayments} %`,fill:"hsl(0 84% 60%)",radius:[4,4,0,0]}),e.jsx(j,{yAxisId:"left",dataKey:"maintenanceYoy",name:`${s.maintenance} %`,fill:"hsl(25 95% 53%)",radius:[4,4,0,0]}),e.jsx(re,{yAxisId:"right",type:"monotone",dataKey:"endBalanceYoy",name:`${s.endBalance} %`,stroke:"hsl(var(--primary))",strokeWidth:3,dot:{fill:"hsl(var(--primary))",strokeWidth:2,r:5}})]})}):e.jsx(Y,{width:"100%",height:350,children:e.jsxs(ne,{data:le,onClick:de,className:"cursor-pointer",children:[e.jsx(ee,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(ae,{dataKey:"year"}),e.jsx(G,{yAxisId:"left",tickFormatter:a=>`â¬${(a/1e3).toFixed(0)}k`}),e.jsx(G,{yAxisId:"right",orientation:"right",tickFormatter:a=>`â¬${(a/1e3).toFixed(0)}k`,domain:[0,"auto"]}),e.jsx(te,{content:e.jsx(Me,{})}),e.jsx(se,{}),e.jsx(De,{yAxisId:"left",y:0,stroke:"hsl(var(--muted-foreground))",strokeDasharray:"3 3"}),e.jsx(j,{yAxisId:"left",dataKey:"contributions",name:s.contributions,stackId:"income",fill:"hsl(142 76% 36%)",radius:[0,0,0,0]}),e.jsx(j,{yAxisId:"left",dataKey:"sonderumlage",name:s.sonderumlage,stackId:"income",fill:"hsl(217 91% 60%)",radius:[0,0,0,0]}),e.jsx(j,{yAxisId:"left",dataKey:"otherExtraIncome",name:s.extraIncome,stackId:"income",fill:"hsl(217 91% 75%)",radius:[4,4,0,0]}),e.jsx(j,{yAxisId:"left",dataKey:"loanRepayments",name:s.loanRepayments,stackId:"expenses",fill:"hsl(0 84% 60%)",radius:[0,0,0,0]}),e.jsx(j,{yAxisId:"left",dataKey:"maintenance",name:s.maintenance,stackId:"expenses",fill:"hsl(25 95% 53%)",radius:[0,0,4,4]}),e.jsx(re,{yAxisId:"right",type:"monotone",dataKey:"startBalance",name:s.startBalance,stroke:"hsl(var(--muted-foreground))",strokeWidth:2,strokeDasharray:"5 5",dot:{fill:"hsl(var(--muted-foreground))",strokeWidth:2,r:4}}),e.jsx(re,{yAxisId:"right",type:"monotone",dataKey:"endBalance",name:s.endBalance,stroke:"hsl(var(--primary))",strokeWidth:3,dot:{fill:"hsl(var(--primary))",strokeWidth:2,r:5}})]})}),!O&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap gap-4 mt-4 text-sm justify-center",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(142 76% 36%)"}}),e.jsx("span",{className:"text-muted-foreground",children:s.contributions})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(217 91% 60%)"}}),e.jsx("span",{className:"text-muted-foreground",children:s.sonderumlage})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(0 84% 60%)"}}),e.jsx("span",{className:"text-muted-foreground",children:s.loanRepayments})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(25 95% 53%)"}}),e.jsx("span",{className:"text-muted-foreground",children:s.maintenance})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-6 mt-3 text-sm justify-center border-t pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-0.5 border-t-2 border-dashed",style:{borderColor:"hsl(var(--muted-foreground))"}}),e.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"hsl(var(--muted-foreground))"}}),e.jsx("span",{className:"text-muted-foreground",children:s.startBalance})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-0.5",style:{backgroundColor:"hsl(var(--primary))"}}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:"hsl(var(--primary))"}}),e.jsx("span",{className:"text-muted-foreground",children:s.endBalance})]})]})]}),O&&e.jsx("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(V,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsx("p",{className:"font-medium",children:i==="cs"?"Jak ÄÃst tento graf?":i==="de"?"Wie liest man dieses Diagramm?":"How to read this chart?"}),e.jsx("p",{className:"text-muted-foreground",children:i==="cs"?"Graf porovnává každý rok s pÅedchozÃm rokem a ukazuje, o kolik procent se hodnoty zmÄnily:":i==="de"?"Das Diagramm vergleicht jedes Jahr mit dem Vorjahr und zeigt, um wie viel Prozent sich die Werte geändert haben:":"The chart compares each year with the previous year and shows how much the values changed in percent:"}),e.jsxs("ul",{className:"text-muted-foreground space-y-1 ml-4",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(142 76% 36%)"}}),e.jsx("span",{children:i==="cs"?"PÅÃspÄvky: +10% = vlastnÃci pÅispÄli o 10% vÃce než loni":i==="de"?"Beiträge: +10% = Eigentümer haben 10% mehr als letztes Jahr beigetragen":"Contributions: +10% = owners contributed 10% more than last year"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(0 84% 60%)"}}),e.jsx("span",{children:i==="cs"?"Splátky úvÄru: +10% = letos jsme zaplatili o 10% vÃce na splátky než loni":i==="de"?"Darlehenstilgung: +10% = wir haben dieses Jahr 10% mehr für Rückzahlungen gezahlt als letztes Jahr":"Loan repayments: +10% = we paid 10% more in repayments this year than last year"})]}
6),e.jsx("li",{className:"text-xs italic text-muted-foreground/80 ml-5 -mt-1",children:i==="cs"?"(Poznámka: U vÄtÅ¡iny úvÄrů jsou roÄnà splátky relativnÄ konstantnÃ, i když zůstatek klesá)":i==="de"?"(Hinweis: Bei den meisten Darlehen bleiben die Raten relativ konstant, auch wenn der Saldo sinkt)":"(Note: For most loans, annual repayments stay relatively constant even as the balance decreases)"}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-3 h-3 rounded",style:{backgroundColor:"hsl(25 95% 53%)"}}),e.jsx("span",{children:i==="cs"?"Ãdržba: +30% = výdaje na opravy vzrostly o 30%":i==="de"?"Instandhaltung: +30% = Reparaturausgaben sind um 30% gestiegen":"Maintenance: +30% = repair expenses increased by 30%"})]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-0.5",style:{backgroundColor:"hsl(var(--primary))"}}),e.jsx("span",{children:i==="cs"?"KoneÄný stav: Jak se zmÄnil zůstatek fondu oproti konci minulého roku":i==="de"?"Endstand: Wie sich der Fondsstand im Vergleich zum Ende des letzten Jahres geändert hat":"End balance: How the fund balance changed compared to end of last year"})]})]})]})]})})]})]})})]}),ce.length>0&&e.jsxs(B,{className:"border-blue-200/50 bg-blue-50/30 dark:bg-blue-950/10",children:[e.jsxs(z,{children:[e.jsxs(A,{className:"font-serif flex items-center gap-2 text-blue-800 dark:text-blue-300",children:[e.jsx(la,{className:"h-5 w-5"}),s.extraordinaryEvents]}),e.jsx(be,{children:s.extraordinaryEventsDesc})]}),e.jsx(R,{children:e.jsx("div",{className:"space-y-3",children:ce.map((a,n)=>e.jsxs("div",{className:"flex items-start gap-4 p-3 rounded-lg bg-background border",children:[e.jsx("div",{className:"flex-shrink-0 p-2 rounded-full bg-blue-100 dark:bg-blue-900/30",children:e.jsx(ua,{className:"h-5 w-5 text-blue-600"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx($,{variant:"outline",className:"text-xs",children:a.year}),e.jsx($,{className:"bg-blue-100 text-blue-800 dark:bg-blue-900/50 dark:text-blue-300",children:a.type==="sonderumlage"?s.sonderumlage:a.type})]}),e.jsx("p",{className:"font-medium text-sm",children:a.description}),a.notes&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.notes})]}),e.jsx("div",{className:"flex-shrink-0 text-right",children:e.jsx("span",{className:"font-bold text-green-600",children:h(a.amount)})})]},n))})})]}),e.jsx(Ze,{open:N!==null,onOpenChange:a=>!a&&_(null),children:e.jsxs(Je,{className:"max-w-3xl max-h-[85vh]",children:[e.jsxs(qe,{children:[e.jsxs(Ue,{className:"flex items-center gap-2 text-xl",children:[e.jsx(Be,{className:"h-5 w-5 text-primary"}),s.yearDetail," ",N]}),e.jsx(Qe,{children:s.yearDetailDesc})]}),C&&e.jsx(Xe,{className:"max-h-[60vh] pr-4",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(B,{className:"bg-green-50/50 dark:bg-green-950/20",children:e.jsxs(R,{className:"p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s.startBalance}),e.jsx("p",{className:"text-lg font-bold text-green-600",children:h(((ue=C.yearData)==null?void 0:ue.startBalance)||0)})]})}),e.jsx(B,{className:"bg-blue-50/50 dark:bg-blue-950/20",children:e.jsxs(R,{className:"p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s.income}),e.jsxs("p",{className:"text-lg font-bold text-blue-600",children:["+",h((((pe=C.yearData)==null?void 0:pe.contributions)||0)+(((xe=C.yearData)==null?void 0:xe.otherIncome)||0))]})]})}),e.jsx(B,{className:"bg-red-50/50 dark:bg-red-950/20",children:e.jsxs(R,{className:"p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s.expenditures}),e.jsxs("p",{className:"text-lg font-bold text-red-600",children:["-",h(((he=C.yearData)==null?void 0:he.expenditures)||0)]})]})})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-green-700 dark:text-green-400 flex items-center gap-2 mb-3",children:[e.jsx(Ce,{className:"h-4 w-4"}),s.income]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-green-50/30 dark:bg-green-950/10 border border-green-200/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx($,{variant:"outline",className:"bg-green-100 text-green-700",children:s.contributions}
6),e.jsx("span",{children:i==="cs"?"RoÄnà pÅÃspÄvek vlastnÃků":i==="de"?"Jährlicher Eigentümerbeitrag":"Annual owner contribution"})]}),e.jsx("span",{className:"font-bold text-green-600",children:h(((ge=C.yearData)==null?void 0:ge.contributions)||0)})]}),C.incomeItems.length>0?C.incomeItems.map(a=>e.jsxs("div",{className:"flex items-start justify-between p-3 rounded-lg bg-background border hover:bg-muted/30 transition-colors",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx($,{variant:"outline",className:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",children:a.type==="sonderumlage"?s.sonderumlage:a.type==="rental"?s.rental:a.type==="interest"?s.interest:a.type==="laundry"?s.laundry:a.type==="other"?s.other:a.type})}),e.jsx("p",{className:"font-medium text-sm",children:ie(a.description,a.descriptionEn,a.descriptionCs)}),a.notes&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.notes})]}),e.jsx("span",{className:"font-bold text-green-600 ml-4",children:h(a.amount)})]},a.id)):null]})]}),e.jsx(ke,{}),e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold text-red-700 dark:text-red-400 flex items-center gap-2 mb-3",children:[e.jsx(ca,{className:"h-4 w-4"}),s.expenditures]}),e.jsx("div",{className:"space-y-2",children:C.expenditureItems.length>0?C.expenditureItems.map(a=>e.jsxs("div",{className:"flex items-start justify-between p-3 rounded-lg bg-background border hover:bg-muted/30 transition-colors",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx($,{variant:"outline",className:a.category==="loan_repayment"?"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300":"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",children:a.category==="loan_repayment"?s.loanRepayments:a.category==="maintenance"?s.maintenance:a.category==="repair"?s.repair:a.category==="insurance"?s.insurance:a.category==="other"?s.other:a.category}),a.vendor&&e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(da,{className:"h-3 w-3"})," ",a.vendor]}),a.itemDate&&e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(Be,{className:"h-3 w-3"})," ",new Date(a.itemDate).toLocaleDateString(i==="de"?"de-DE":i==="cs"?"cs-CZ":"en-GB")]}),a.invoiceNumber&&e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(ma,{className:"h-3 w-3"})," ",a.invoiceNumber]})]}),e.jsx("p",{className:"font-medium text-sm",children:ie(a.description,a.descriptionEn,a.descriptionCs)}),a.notes&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.notes})]}),e.jsx("span",{className:"font-bold text-red-600 ml-4",children:h(a.amount)})]},a.id)):e.jsx("p",{className:"text-sm text-muted-foreground py-2",children:s.noItems})})]}),e.jsx(ke,{}),e.jsx(B,{className:"bg-primary/5 border-primary/20",children:e.jsxs(R,{className:"p-4 flex items-center justify-between",children:[e.jsx("p",{className:"font-semibold",children:s.endBalance}),e.jsx("p",{className:"text-xl font-bold text-primary",children:h(((fe=C.yearData)==null?void 0:fe.endBalance)||0)})]})})]})})]})})]})})},rt=()=>{const{user:k}=We(),{language:L}=Ie(),[i,m]=g.useState([]),[p,S]=g.useState(!0);g.useEffect(()=>{k&&I()},[k]);const I=async()=>{S(!0);const{data:_}=await oe.from("house_costs").select("*").order("year",{ascending:!0});_&&m(_),S(!1)},H={de:{title:"Kostenübersicht",description:"Gesamtübersicht aller Haus- und Betriebskosten",costs:"Kosten"},en:{title:"Cost Dashboard",description:"Complete overview of all house and operating costs",costs:"Costs"},cs:{title:"PÅehled nákladů",description:"Kompletnà pÅehled vÅ¡ech nákladů domu a provozu",costs:"Náklady"}},N=H[L]||H.cs;return e.jsx($e,{title:N.title,description:N.description,breadcrumbs:[{label:N.costs,href:"/owners/costs"},{label:N.title}],isLoading:p,onDataRefresh:I,children:e.jsx(pa,{houseCosts:i})})};export{rt 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.