PageSourceSearch

https://taxease360.ai/assets/TaxRefundEstimate-BlBaGq6E.js

js taxease360.ai collected 2026-10-05 14:25:29 UTC 28,224 bytes, 1 lines download raw bytes

1import{j as e,T as B,S as te,d as se,r as y,p as N,q as O,U as re,a5 as le,a1 as ne,aU as oe,y as ie}from"./index-CfXbMZ_V.js";import{P as de}from"./PortalHeader-BREe-gcq.js";import{T as ce}from"./trending-up-BFx2g5_7.js";import{T as me}from"./trending-down-_wkW26nB.js";import{I as xe}from"./info-CA90EpkY.js";import{S as ue}from"./send-D6RIih1c.js";import{c as F,f as pe}from"./financialYear-CDAMHgs5.js";import{C as ye}from"./chevron-left-BFeklwt6.js";const W="This is a preliminary estimate based on the information provided and is not a tax return, tax advice or a guaranteed refund. Your actual result may change after all income, deductions, offsets, Medicare information and other tax circumstances are reviewed.";function U({compact:s=!1,acknowledged:j,onAcknowledge:c}){return s?e.jsxs("div",{className:"flex items-start gap-2 bg-amber-50 border border-amber-200 rounded-xl p-3 text-amber-800",children:[e.jsx(B,{size:16,className:"shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[11px] leading-relaxed",children:W})]}):e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-2xl p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(B,{size:18,className:"text-amber-600 shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-amber-900 leading-relaxed font-medium",children:W})]}),e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:!!j,onChange:n=>c==null?void 0:c(n.target.checked),className:"mt-0.5 w-5 h-5 rounded border-amber-400 text-amber-600 focus:ring-amber-400 shrink-0"}),e.jsx("span",{className:"text-sm text-amber-900",children:"I understand this is an estimate only and not a guaranteed refund or tax advice."})]})]})}const p=s=>s==null||isNaN(s)?"$0":"$"+Math.round(s).toLocaleString("en-AU"),Q={High:"bg-emerald-50 text-emerald-700 border-emerald-200",Medium:"bg-amber-50 text-amber-700 border-amber-200",Low:"bg-rose-50 text-rose-700 border-rose-200"};function k({label:s,value:j,sub:c,strong:n}){return e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 last:border-0",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-700",children:s}),c&&e.jsx("p",{className:"text-[11px] text-gray-400",children:c})]}),e.jsx("p",{className:`text-sm ${n?"font-bold text-gray-900":"font-medium text-gray-800"}`,children:j})]})}function be({estimate:s,onSendToAccountant:j,sending:c}){var P,r,x,M,E,h,C,v,D,Y,$,T,z;const n=s.tax_result||{},_=n.refund!=null&&n.refund>0,g=n.payable!=null&&n.payable>0,w=s.confidence||{level:"—",reasons:[]};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:`rounded-2xl p-5 text-white ${_?"bg-gradient-to-br from-emerald-500 to-emerald-700":g?"bg-gradient-to-br from-rose-500 to-rose-700":"bg-gradient-to-br from-gray-500 to-gray-700"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_?e.jsx(ce,{size:20}):g?e.jsx(me,{size:20}):e.jsx(te,{size:20}),e.jsx("p",{className:"text-sm font-medium opacity-90",children:_?"Estimated refund":"Estimated tax payable"})]}),e.jsx("p",{className:"text-4xl font-extrabold",children:_?`approximately ${p(n.refund)}`:g?`approximately ${p(n.payable)}`:"Approximately nil"}),n.range_low!=null&&n.range_high!=null&&e.jsxs("p",{className:"text-xs opacity-90 mt-2",children:["Likely range: ",p(Math.abs(n.range_low))," – ",p(Math.abs(n.range_high))," ",g?"payable":"refund"]}),e.jsxs("p",{className:"text-[11px] opacity-80 mt-1",children:["Estimate for ",s.fy_label," · Tax rules v",s.rule_version]})]}),e.jsxs("div",{className:`rounded-xl border p-3 ${Q[w.level]||Q.Medium}`,children:[e.jsxs("p",{className:"text-xs font-semibold flex items-center gap-1.5",children:[e.jsx(xe,{size:13})," ",w.level," confidence"]}),((P=w.reasons)==null?void 0:P.length)>0&&e.jsx("ul",{className:"mt-1.5 space-y-0.5",children:w.reasons.map((S,A)=>e.jsxs("li",{className:"text-[11px] opacity-90",children:["• ",S]},A))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb
1-1",children:"Projected position"}),e.jsx(k,{label:"Projected annual employment income",value:p((r=s.projection)==null?void 0:r.projected_gross)}),e.jsx(k,{label:"Other estimated income",value:p(s.total_other_income)}),e.jsx(k,{label:"Total estimated deductions (included)",value:p(s.total_deductions_included)}),e.jsx(k,{label:"Estimated taxable income",value:p(s.taxable_income),strong:!0}),e.jsx(k,{label:"Estimated tax liability",value:p(n.total_tax_liability),sub:`Income tax ${p(n.income_tax)} − LITO ${p(n.lito)} + Medicare ${p(n.medicare_levy)}${n.mls?` + MLS ${p(n.mls)}`:""}`}),e.jsx(k,{label:"Projected PAYG tax withheld",value:p(s.payg_withheld)}),n.help_repayment>0&&e.jsx(k,{label:"HELP / study loan repayment",value:p(n.help_repayment)}),e.jsx(k,{label:"Effective tax rate",value:`${(n.effective_rate*100).toFixed(1)}%`}),e.jsx(k,{label:_?"Estimated refund":"Estimated tax payable",value:p(_?n.refund:n.payable),strong:!0})]}),((x=s.projection)==null?void 0:x.basis)&&e.jsx("div",{className:"bg-blue-50 border border-blue-100 rounded-xl p-3",children:e.jsx("p",{className:"text-xs text-blue-900 leading-relaxed",children:s.projection.basis})}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-2",children:"Scenario comparison"}),e.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-100",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50 text-left text-[11px] uppercase text-gray-500",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-2 px-3 font-semibold",children:"Scenario"}),e.jsx("th",{className:"py-2 px-3 font-semibold text-right",children:"Estimated result"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-t border-gray-100",children:[e.jsx("td",{className:"py-2 px-3 text-gray-700",children:"Conservative"}),e.jsx("td",{className:"py-2 px-3 text-right font-semibold text-gray-900",children:((E=(M=s.scenarios)==null?void 0:M.conservative)==null?void 0:E.refund)!=null?`Refund ${p(s.scenarios.conservative.refund)}`:`Payable ${p(((h=s.scenarios.conservative)==null?void 0:h.payable)||0)}`})]}),e.jsxs("tr",{className:"border-t border-gray-100",children:[e.jsxs("td",{className:"py-2 px-3 text-gray-700",children:["Including potential deductions ",e.jsx("span",{className:"text-[10px] text-amber-600",children:"(needs review)"})]}),e.jsx("td",{className:"py-2 px-3 text-right font-semibold text-gray-900",children:((v=(C=s.scenarios)==null?void 0:C.with_potential)==null?void 0:v.refund)!=null?`Refund ${p(s.scenarios.with_potential.refund)}`:`Payable ${p(((D=s.scenarios.with_potential)==null?void 0:D.payable)||0)}`})]})]})]})}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-2",children:"The second result is conditional and subject to accountant review."})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4 space-y-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:"Deductions"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 bg-emerald-50 rounded-lg p-2.5",children:[e.jsxs("p",{className:"text-[11px] text-emerald-700 font-semibold",children:["Included (",((Y=s.deductions_included)==null?void 0:Y.length)||0,")"]}),e.jsx("p",{className:"text-lg font-bold text-emerald-800",children:p(s.total_deductions_included)})]}),e.jsxs("div",{className:"flex-1 bg-amber-50 rounded-lg p-2.5",children:[e.jsxs("p",{className:"text-[11px] text-amber-700 font-semibold",children:["Potential (",(($=s.deductions_potential)==null?void 0:$.length)||0,")"]}),e.jsx("p",{className:"text-lg font-bold text-amber-800",children:p(s.total_deductions_potential)})]}),e.jsxs("div",{className:"flex-1 bg-gray-50 rounded-lg p-2.5",children:[e.jsxs("p",{className:"text-[11px] text-gray-500 font-semibold",children:["Excluded (",((T=s.deductions_excluded)==null?void 0:T.length)||0,")"]}),e.jsx("p",{className:"text-lg font-bold text-gray-500",children:p(0)})]})]})]}),((z=s.finley_notes)==null?void 0:z.length)>0&&e.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-cyan-50 border border-blue-100 rounded-2xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(se,{size:16,className:"text-blue-600"}),e.jsx("p",{className:"text-sm font-semibold text-blue-900",children:"Finley explains"})]}),e.jsx("ul",{className:"space-y-1.5",children:s.finley_notes.map((S,A)=>e.jsxs("li",{className:"text-xs text-blue-800 leading-relaxed",children:["• ",S]},A))})]}
1),e.jsxs("button",{onClick:j,disabled:c,className:"w-full flex items-center justify-center gap-2 bg-blue-600 text-white rounded-2xl py-3.5 font-semibold active:scale-95 transition-transform disabled:opacity-50",children:[e.jsx(ue,{size:18})," ",c?"Sending…":"Send Estimate to My Accountant"]})]})}const he=[{value:"weekly",label:"Weekly"},{value:"fortnightly",label:"Fortnightly"},{value:"monthly",label:"Monthly"}],ge=["Second job","Centrelink","Interest","Dividends","Rental","Sole trader","Capital gains","Other taxable income"],fe=["Payslip","Income","Deductions","Other Tax Details","Your Estimate"],je=[{key:"only_employer",label:"Is this your only employer?"},{key:"income_stable",label:"Do you expect your income to remain similar for the rest of the year?"},{key:"second_job",label:"Do you have a second job?"},{key:"centrelink",label:"Do you receive Centrelink or other taxable government income?"},{key:"private_health",label:"Do you have private hospital cover?"},{key:"spouse",label:"Do you have a spouse?"},{key:"resident",label:"Are you an Australian resident for tax purposes?"},{key:"help_loan",label:"Do you have a HELP, VSL or other study loan?"},{key:"other_investment_income",label:"Do you have investment, rental, business or capital gains income?"},{key:"all_deductions_uploaded",label:"Have all relevant deductions been uploaded?"}];function _e(s,j){const c=s.frequency||"fortnightly",n={weekly:52,fortnightly:26,monthly:12}[c]||26,_={weekly:7,fortnightly:14,monthly:30.44}[c]||14,g=new Date(j,6,1),w=s.payment_date?new Date(s.payment_date):new Date,P=Math.max(0,(w-g)/864e5),r=Math.min(n,Math.floor(P/_)),x=Math.max(0,n-r);return Number(s.ytd_gross)>0?{gross:Number(s.ytd_gross)+x*(Number(s.gross_period)||0),useYtd:!0,rem:x}:{gross:(Number(s.gross_period)||0)*n,useYtd:!1,rem:x}}const H=s=>s==null||isNaN(s)?"$0":"$"+Math.round(s).toLocaleString("en-AU");function b({label:s,value:j,onChange:c,type:n="number",placeholder:_}){return e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-500",children:s}),e.jsx("input",{type:n,value:j??"",onChange:g=>c(n==="number"?g.target.value===""?"":Number(g.target.value):g.target.value),placeholder:_,className:"mt-0.5 w-full rounded-lg border border-gray-200 px-3 py-2 text-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500"})]})}function De(){const[s,j]=y.useState(F()),[c,n]=y.useState(0),[_,g]=y.useState(null),[w,P]=y.useState([]),[r,x]=y.useState({employer_name:"",employee_name:"",pay_period_start:"",pay_period_end:"",payment_date:"",gross_period:"",taxable_gross:"",ytd_gross:"",tax_period:"",ytd_tax:"",allowances:"",bonuses:"",overtime:"",salary_sacrifice:"",reportable_fringe_benefits:"",super:"",frequency:"fortnightly",source_file_url:""}),[M,E]=y.useState(!1),[h,C]=y.useState([]),[v,D]=y.useState([]),[Y,$]=y.useState(!1),[T,z]=y.useState({only_employer:!0,income_stable:!0,resident:!0}),[S,A]=y.useState(!1),[L,q]=y.useState(!1),[f,R]=y.useState(null),[V,G]=y.useState(!1);y.useEffect(()=>{(async()=>{try{const a=await N.auth.me(),o=await N.entities.Client.filter({user_id:a.id});if(o[0]){g(o[0]);const l=await N.entities.Document.filter({client_id:o[0].id},"-upload_date",100);P(l.filter(t=>t.file_url))}}catch{}})()},[]);const J=async()=>{var a;$(!0);try{const o=await N.functions.invoke("loadDeductions",{}),l=((a=o==null?void 0:o.data)==null?void 0:a.items)||[],t=await N.functions.invoke("taxEstimator",{action:"classify_deductions",items:l}),d=[...(t.data.included||[]).map(m=>({...m,decision:"include"})),...(t.data.potential||[]).map(m=>({...m,decision:"potential"})),...(t.data.excluded||[]).map(m=>({...m,decision:"exclude"}))];D(d)}finally{$(!1)}};y.useEffect(()=>{c===2&&v.length===0&&J()},[c]);const K=async a=>{var o,l;E(!0);try{const t=await N.integrations.Core.UploadFile({file:a}),d=(t==null?void 0:t.file_url)||((o=t==null?void 0:t.data)==null?void 0:o.file_url),m=await N.functions.invoke("taxEstimator",{action:"extract_payslip",file_url:d}),i=((l=m==null?void 0:m.data)==null?void 0:l.extracted)||{};x(u=>({...u,employer_name:i.employer_name||u.employer_name,employee_name:i.employee_name||u.employee_name,pay_period_start:i.pay_period_start||u.pay_period_start,pay_period_end:i.pay_period_end||u.pay_period_end,payment_date:i.payment_date||u.payment_date,gross_period:i.gross_pay??u.gross_period,taxable_gross:i.taxable_gross??u.taxable_gross,ytd_gross:i.ytd_gross??u.ytd_gross,tax_period:i.payg_withheld??u.tax_period,ytd_tax:i.ytd_tax_with
1held??u.ytd_tax,allowances:i.allowances??u.allowances,bonuses:i.bonuses??u.bonuses,overtime:i.overtime??u.overtime,salary_sacrifice:i.salary_sacrifice??u.salary_sacrifice,reportable_fringe_benefits:i.reportable_fringe_benefits??u.reportable_fringe_benefits,super:i.superannuation??u.super,source_file_url:d}))}catch(t){alert("Could not read payslip: "+((t==null?void 0:t.message)||"unknown error"))}finally{E(!1)}},X=async a=>{var o;E(!0);try{const l=await N.functions.invoke("taxEstimator",{action:"extract_payslip",document_id:a}),t=((o=l==null?void 0:l.data)==null?void 0:o.extracted)||{};x(d=>{var m;return{...d,employer_name:t.employer_name||"",employee_name:t.employee_name||"",pay_period_start:t.pay_period_start||"",pay_period_end:t.pay_period_end||"",payment_date:t.payment_date||"",gross_period:t.gross_pay??"",taxable_gross:t.taxable_gross??"",ytd_gross:t.ytd_gross??"",tax_period:t.payg_withheld??"",ytd_tax:t.ytd_tax_withheld??"",allowances:t.allowances??"",bonuses:t.bonuses??"",overtime:t.overtime??"",salary_sacrifice:t.salary_sacrifice??"",reportable_fringe_benefits:t.reportable_fringe_benefits??"",super:t.superannuation??"",source_file_url:((m=l==null?void 0:l.data)==null?void 0:m.file_url)||""}})}catch(l){alert("Could not read document: "+((l==null?void 0:l.message)||"unknown error"))}finally{E(!1)}},I=y.useMemo(()=>_e(r,s),[r,s]),Z=async()=>{var a,o,l,t,d;if(!S){alert("Please acknowledge the disclaimer to continue.");return}q(!0);try{const m=await N.functions.invoke("taxEstimator",{action:"compute",fy_start_year:s,payslip:r,other_income:h,deduction_items:v.map(i=>({id:i.id,source:i.source,date:i.date,description:i.description,category:i.category,amount:i.amount,mixed_use:i.mixed_use,decision:i.decision,work_pct:i.work_pct,adjusted_amount:i.adjusted_amount})),answers:T,disclaimer_acknowledged:!0});R({...(a=m==null?void 0:m.data)==null?void 0:a.estimate,estimate_id:(o=m==null?void 0:m.data)==null?void 0:o.estimate_id,id:(l=m==null?void 0:m.data)==null?void 0:l.estimate_id}),n(4)}catch(m){alert("Calculation failed: "+(((d=(t=m==null?void 0:m.response)==null?void 0:t.data)==null?void 0:d.error)||(m==null?void 0:m.message)||"unknown error"))}finally{q(!1)}},ee=async()=>{var a,o,l;if(!(!(f!=null&&f.estimate_id)&&!(f!=null&&f.id))){G(!0);try{const t=await N.functions.invoke("taxEstimator",{action:"send_to_accountant",estimate_id:f.estimate_id||f.id});alert("Estimate sent to your accountant. They'll review it and get back to you."),R(((a=t==null?void 0:t.data)==null?void 0:a.estimate)||f)}catch(t){alert("Could not send: "+(((l=(o=t==null?void 0:t.response)==null?void 0:o.data)==null?void 0:l.error)||(t==null?void 0:t.message)||"unknown error"))}finally{G(!1)}}},ae=r.gross_period&&r.payment_date;return e.jsxs("div",{className:"space-y-4 pb-10",children:[e.jsx(de,{title:"Tax Refund Estimate",subtitle:"Estimate your likely refund or tax payable",backTo:"/portal"}),e.jsx("div",{className:"flex items-center gap-1",children:fe.map((a,o)=>e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:`h-1.5 rounded-full ${o<=c?"bg-blue-600":"bg-gray-200"}`}),e.jsx("p",{className:`text-[10px] mt-1 ${o===c?"text-blue-600 font-semibold":"text-gray-400"}`,children:a})]},a))}),e.jsx(U,{compact:!0}),c===0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-800",children:"1. Your payslip"}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs font-medium text-gray-600",children:"Upload your latest payslip (PDF or image)"}),e.jsxs("div",{className:"mt-1 flex items-center justify-center w-full h-24 border-2 border-dashed border-gray-200 rounded-xl cursor-pointer hover:border-blue-400 bg-gray-50",children:[M?e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[e.jsx(O,{size:16,className:"animate-spin"})," Reading payslip…"]}):e.jsxs("div",{className:"flex flex-col items-center text-gray-500",children:[e.jsx(re,{size:20}),e.jsx("span",{className:"text-xs mt-1",children:"Tap to upload"})]}),e.jsx("input",{type:"file",accept:"image/*,application/pdf",className:"hidden",onChange:a=>a.target.files[0]&&K(a.target.files[0])})]})]}),w.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Or select a payslip already stored in Documents:"}),e.jsxs("select",{onChange:a=>a.target.value&&X(a.target.value),value:"",className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"Choose a document…"}),w.map(a=>e.jsx("option",{value:a.id,children:a.file_name||a.category},a.id))]})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-gray-500",children:"Review and correct every figure below before continuing."}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(b,{label:"Employer name",type:"text",value:r.employer_name,onChange:a=>x({...r,employer_name:a})}),e.jsx(b,{label:"Employee name",type:"text",value:r.employee_name,onChange:a=>x({...r,employee_name:a})}),e.jsx(b,{label:"Pay period start",type:"text",value:r.pay_period_start,placeholder:"2026-01-01",onChange:a=>x({...r,pay_period_start:a})}),e.jsx(b,{label:"Pay period end",type:"text",value:r.pay_period_end,placeholder:"2026-01-14",onChange:a=>x({...r,pay_period_end:a})}),e.jsx(b,{label:"Payment date",type:"text",value:r.payment_date,placeholder:"2026-01-15",onChange:a=>x({...r,payment_date:a})}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-[11px] font-medium text-gray-500",children:"Payment frequency"}),e.jsx("select",{value:r.frequency,onChange:a=>x({...r,frequency:a.target.value}),className:"mt-0.5 w-full rounded-lg border border-gray-200 px-3 py-2 text-sm",children:he.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]}),e.jsx(b,{label:"Gross pay (this period)",value:r.gross_period,onChange:a=>x({...r,gross_period:a})}),e.jsx(b,{label:"Taxable gross",value:r.taxable_gross,onChange:a=>x({...r,taxable_gross:a})}),e.jsx(b,{label:"Year-to-date gross",value:r.ytd_gross,onChange:a=>x({...r,ytd_gross:a})}),e.jsx(b,{label:"PAYG withheld (this period)",value:r.tax_period,onChange:a=>x({...r,tax_period:a})}),e.jsx(b,{label:"Year-to-date PAYG withheld",value:r.ytd_tax,onChange:a=>x({...r,ytd_tax:a})}),e.jsx(b,{label:"Allowances",value:r.allowances,onChange:a=>x({...r,allowances:a})}),e.jsx(b,{label:"Bonuses",value:r.bonuses,onChange:a=>x({...r,bonuses:a})}),e.jsx(b,{label:"Overtime",value:r.overtime,onChange:a=>x({...r,overtime:a})}),e.jsx(b,{label:"Salary sacrifice",value:r.salary_sacrifice,onChange:a=>x({...r,salary_sacrifice:a})}),e.jsx(b,{label:"Reportable fringe benefits",value:r.reportable_fringe_benefits,onChange:a=>x({...r,reportable_fringe_benefits:a})}),e.jsx(b,{label:"Superannuation (shown separately)",value:r.super,onChange:a=>x({...r,super:a})})]})]})]}),c===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-blue-50 border border-blue-100 rounded-2xl p-4",children:[e.jsx("p",{className:"text-xs text-blue-900 font-medium",children:"Projected annual employment income"}),e.jsx("p",{className:"text-2xl font-bold text-blue-900 mt-1",children:H(I.gross)}),e.jsx("p",{className:"text-[11px] text-blue-700 mt-1",children:I.useYtd?`Based on year-to-date earnings and ${I.rem} remaining pay periods.`:`Annualised from a single payslip (${I.rem} periods/year) — may be less accurate.`})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-800",children:"Other income sources"}),e.jsxs("button",{onClick:()=>
1C([...h,{type:"Other taxable income",amount:"",tax_withheld:""}]),className:"text-xs text-blue-600 font-medium flex items-center gap-1",children:[e.jsx(le,{size:14})," Add"]})]}),h.length===0&&e.jsx("p",{className:"text-xs text-gray-400",children:"Don't assume the payslip is your only income. Add second jobs, Centrelink, interest, dividends, rental, etc."}),h.map((a,o)=>e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("select",{value:a.type,onChange:l=>C(h.map((t,d)=>d===o?{...t,type:l.target.value}:t)),className:"flex-1 rounded-lg border border-gray-200 px-2 py-2 text-sm",children:ge.map(l=>e.jsx("option",{value:l,children:l},l))}),e.jsx("input",{type:"number",placeholder:"Amount",value:a.amount,onChange:l=>C(h.map((t,d)=>d===o?{...t,amount:l.target.value===""?"":Number(l.target.value)}:t)),className:"w-24 rounded-lg border border-gray-200 px-2 py-2 text-sm"}),e.jsx("input",{type:"number",placeholder:"Tax withheld",value:a.tax_withheld,onChange:l=>C(h.map((t,d)=>d===o?{...t,tax_withheld:l.target.value===""?"":Number(l.target.value)}:t)),className:"w-28 rounded-lg border border-gray-200 px-2 py-2 text-sm"}),e.jsx("button",{onClick:()=>C(h.filter((l,t)=>t!==o)),className:"text-gray-400 p-2",children:e.jsx(ne,{size:15})})]},o)),h.length<=0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-2.5",children:e.jsx("p",{className:"text-[11px] text-amber-800",children:"This estimate currently includes only your payslip income. Other income may reduce your refund or create tax payable."})})]})]}),c===2&&e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-800 mb-1",children:"3. Your recorded deductions"}),e.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"We've classified your uploaded records conservatively. Adjust each item — mixed-use expenses need a work-use %."}),Y?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(O,{className:"w-6 h-6 text-blue-500 animate-spin"})}):e.jsxs("div",{className:"space-y-4",children:[["include","potential","exclude"].map(a=>{const o=v.filter(d=>d.decision===a);if(!o.length)return null;const l={include:"Included in estimate",potential:"Potential (needs review)",exclude:"Excluded"}[a],t={include:"text-emerald-700",potential:"text-amber-700",exclude:"text-gray-400"}[a];return e.jsxs("div",{children:[e.jsx("p",{className:`text-xs font-semibold ${t} mb-1.5`,children:l}),e.jsx("div",{className:"space-y-2",children:o.map((d,m)=>e.jsxs("div",{className:"bg-gray-50 rounded-xl p-3",children:[e.jsx("div",{className:"flex items-start justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-800 truncate",children:d.description}),e.jsxs("p",{className:"text-[11px] text-gray-400",children:[d.category," · ",d.source," · ",H(d.amount),d.date?` · ${d.date}`:""]}),d.reason&&e.jsx("p",{className:"text-[10px] text-gray-400 mt-0.5",children:d.reason})]})}),e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[["include","potential","exclude"].map(i=>e.jsx("button",{onClick:()=>D(v.map(u=>u.id===d.id?{...u,decision:i}:u)),className:`text-[11px] px-2.5 py-1 rounded-md font-medium ${d.decision===i?"bg-blue-600 text-white":"bg-white border border-gray-200 text-gray-500"}`,children:i==="include"?"Include":i==="potential"?"Potential":"Exclude"},i)),d.mixed_use&&d.decision==="include"&&e.jsx("input",{type:"number",placeholder:"Work %",value:d.work_pct??"",onChange:i=>D(v.map(u=>u.id===d.id?{...u,work_pct:i.target.value===""?"":Number(i.target.value)/100}:u)),className:"ml-auto w-20 rounded-md border border-gray-200 px-2 py-1 text-xs"})]})]},d.id||m))})]},a)}),v.length===0&&e.jsx("p",{className:"text-xs text-gray-400 text-center py-4",children:"No deduction records found yet. Upload receipts or logbook trips first."})]})]})}),c===3&&e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-800",children:"4. A few questions"}),e.jsx("p",{className:"text-xs text-gray-400",children:"These help make your estimate more accurate."}),je.map(a=>e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-50 last:border-0",children:[e.jsx("p",{className:"text-sm text-gray-700 pr-3",children:a.label}),e.jsx("div",{className:"flex gap-1 shrink-0",children:[!0,!1].map(o=>e.jsx("button",{onClick:()=>z({...T,[a.key]:o}),className:`text-xs px-3 py-1.5 rounded-md font-medium ${T[a.key]===o?"bg-blue-600 text-white":"bg-gray-100 text-gray-500"}`,children:o?"Yes":"No"},String(o)))})]},a.key))]}),c===4&&!f&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(U,{acknowledged:S,onAcknowledge:A}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-100 p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-gray-600",children:"Financial year"}),e.jsx("select",{value:s,onChange:a=>j(Number(a.target.value)),className:"rounded-lg border border-gray-200 px-2 py-1 text-sm",children:[F(),F()-1].map(a=>e.jsx("option",{value:a,children:pe(a)},a))})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-gray-600",children:"Projected annual income"}),e.jsx("span",{className:"text-sm font-semibold",children:H(I.gross)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-gray-600",children:"Other income sources"}),e.jsx("span",{className:"text-sm font-semibold",children:h.length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-gray-600",children:"Deduction items"}),e.jsx("span",{className:"text-sm font-semibold",children:v.length})]})]}),e.jsxs("button",{onClick:Z,disabled:!S||L,className:"w-full flex items-center justify-center gap-2 bg-blue-600 text-white rounded-2xl py-3.5 font-semibold active:scale-95 transition-transform disabled:opacity-50",children:[L?e.jsx(O,{size:18,className:"animate-spin"}):e.jsx(oe,{size:18})," ",L?"Calculating…":"Calculate Estimate"]})]}),c===4&&f&&e.jsxs(e.Fragment,{children:[e.jsx(be,{estimate:f,onSendToAccountant:ee,sending:V}),e.jsx("button",{onClick:()=>{R(null),n(3)},className:"w-full text-center text-xs text-blue-600 font-medium py-2",children:"Adjust my answers"}),e.jsx(U,{compact:!0})]}),c<4&&e.jsxs("div",{className:"flex items-center justify-between pt-1",children:[e.jsxs("button",{onClick:()=>c>0&&n(c-1),disabled:c===0,className:`flex items-center gap-1 text-sm font-medium ${c===0?"text-gray-300":"text-gray-600"}`,children:[e.jsx(ye,{size:16})," Back"]}),e.jsxs("button",{onClick:()=>
1{if(c===0&&!ae){alert("Add the gross pay and payment date from your payslip first.");return}n(c+1)},className:"flex items-center gap-1 text-sm font-medium text-blue-600",children:["Next ",e.jsx(ie,{size:16})]})]})]})}export{De 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.