(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[950],{1827:(e,t,r)=>{Promise.resolve().then(r.bind(r,3610))},3610:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var a=r(9621),n=r(8929),o=r(5405);let l="rounded-lg border border-gray-300 px-3 py-2 outline-none focus:border-kura focus:ring-2 focus:ring-kura/30";function s(){let[e,t]=(0,n.useState)(800),[r,s]=(0,n.useState)("USD"),u=(0,n.useMemo)(()=>(0,o.si)(Number(e)||0,r),[e,r]);return(0,a.jsxs)("section",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"Zimbabwe PAYE calculator"}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Monthly PAYE with the 3% AIDS levy. Separate USD and ZiG tables. Due the 10th."})]}),(0,a.jsx)("div",{className:"flex flex-col gap-4 rounded-2xl bg-white p-6 shadow-sm ring-1 ring-gray-100",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("label",{className:"flex flex-col gap-1 text-sm font-medium",children:["Gross monthly pay",(0,a.jsx)("input",{type:"number",min:0,step:"0.01",value:e,onChange:e=>t(Number(e.target.value)),className:l})]}),(0,a.jsxs)("label",{className:"flex flex-col gap-1 text-sm font-medium",children:["Currency",(0,a.jsxs)("select",{value:r,onChange:e=>s(e.target.value),className:l,children:[(0,a.jsx)("option",{value:"USD",children:"USD"}),(0,a.jsx)("option",{value:"ZiG",children:"ZiG"})]})]})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-center sm:grid-cols-4",children:[(0,a.jsx)(i,{label:"Income tax",value:u.tax}),(0,a.jsx)(i,{label:"AIDS levy",value:u.aidsLevy}),(0,a.jsx)(i,{label:"Total PAYE",value:u.totalPaye,accent:!0}),(0,a.jsx)(i,{label:"Effective rate",value:100*u.effectiveRate,suffix:"%"})]}),"ZiG"===r?(0,a.jsx)("p",{className:"text-xs text-amber-600",children:"ZiG bands are indicative. Confirm against the current ZIMRA ZiG tax table."}):null]})}function i(e){let{label:t,value:r,accent:n,suffix:o}=e;return(0,a.jsxs)("div",{className:"rounded-xl bg-white p-4 shadow-sm ring-1 ring-gray-100",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-wide text-gray-400",children:t}),(0,a.jsxs)("p",{className:"mt-1 text-lg font-bold ".concat(n?"text-kura-dark":"text-ink"),children:[r.toFixed(2),null!=o?o:""]})]})}},5405:(e,t,r)=>{"use strict";r.d(t,{bg:()=>n,TI:()=>a,si:()=>f,KX:()=>d,tN:()=>m,cR:()=>x,X4:()=>i});let a=.155,n=25,o=[{quarter:1,cumulativePct:.1,portionPct:.1,dueMonth:3,dueDay:25},{quarter:2,cumulativePct:.35,portionPct:.25,dueMonth:6,dueDay:25},{quarter:3,cumulativePct:.65,portionPct:.3,dueMonth:9,dueDay:25},{quarter:4,cumulativePct:1,portionPct:.35,dueMonth:12,dueDay:20}],l=[{from:0,to:100,rate:0},{from:100,to:300,rate:.2},{from:300,to:1e3,rate:.25},{from:1e3,to:2e3,rate:.3},{from:2e3,to:3e3,rate:.35},{from:3e3,to:null,rate:.4}],s=[{from:0,to:2600,rate:0},{from:2600,to:7800,rate:.2},{from:7800,to:26e3,rate:.25},{from:26e3,to:52e3,rate:.3},{from:52e3,to:78e3,rate:.35},{from:78e3,to:null,rate:.4}];function i(e){return Math.round((e+Number.EPSILON)*100)/100}function u(e,t){if(!Number.isFinite(e)||e<0)throw RangeError("".concat(t," must be a non-negative finite number, got ").concat(e))}let c={standard:.155,zero:0,exempt:0};function d(e,t){u(e,"netAmount");let r=c[t],a=i(e),n=i(a*r);return{net:a,vat:n,gross:i(a+n),rate:r,code:t}}function m(e,t){u(e,"grossAmount");let r=c[t],a=i(e),n=i(a/(1+r));return{net:n,vat:i(a-n),gross:a,rate:r,code:t}}function f(e,t){u(e,"grossMonthly");let r=i(e),a=i(function(e,t){let r=0;for(let a of t){if(e<=a.from)break;r+=((null===a.to?e:Math.min(e,a.to))-a.from)*a.rate}return r}(r,"USD"===t?l:s)),n=i(.03*a),o=i(a+n);return{gross:r,currency:t,tax:a,aidsLevy:n,totalPaye:o,effectiveRate:0===r?0:i(o/r)}}function x(e){return[1,2,3,4].map(t=>(function(e,t){u(e,"annualEstimate");let r=o.find(e=>e.quarter===t);if(!r)throw RangeError("quarter must be 1, 2, 3 or 4, got ".concat(t));let a=i(e*r.cumulativePct),n=i(e*r.portionPct);return{quarter:t,annualEstimate:i(e),cumulativeDue:a,paymentDue:n,dueMonth:r.dueMonth,dueDay:r.dueDay}})(e,t))}}},e=>{e.O(0,[976,785,358],()=>e(e.s=1827)),_N_E=e.O()}]);