PageSourceSearch

https://www.nib-bahamas.com/assets/BenefitsCalculator-CvXbq_IT.js

js nib-bahamas.com collected 2026-10-02 11:26:39 UTC 24,325 bytes, 1 lines download raw bytes

1import{j as e,A as D,m as y,c as U,u as z,a as J,b as K}from"./animation-DMef301g.js";import{r as u}from"./react-vendor-iGF98SQ3.js";import{P as O}from"./PageHeader-CZyBDIP3.js";import{u as Q}from"./usePageTitle-DFuectcb.js";import{u as F}from"./index-DNanuPVF.js";import"./ui-vendor-D3J3lGbY.js";import"./calendar-QmLTJ9XO.js";const L="/calc-api/api/benefit-calculator/benefit-calculator",x={SICKNESS:"sickness",MATERNITY:"maternity",INJURY:"injury",FUNERAL:"funeral",UNEMPLOYMENT:"unemployment",RETIREMENT:"retirement"},T={HOSPITALITY:"hospitality",NON_HOSPITALITY:"non_hospitality"},k={[x.SICKNESS]:"Sickness Benefit",[x.MATERNITY]:"Maternity Benefit",[x.INJURY]:"Injury Benefit",[x.FUNERAL]:"Funeral Benefit",[x.UNEMPLOYMENT]:"Unemployment Benefit",[x.RETIREMENT]:"Retirement Benefit"},C={[T.HOSPITALITY]:"Hospitality",[T.NON_HOSPITALITY]:"Non-Hospitality"},V={[x.SICKNESS]:"Calculate weekly benefits for temporary illness or disability",[x.MATERNITY]:"Calculate maternity benefits for eligible contributors",[x.INJURY]:"Calculate benefits for work-related injuries",[x.FUNERAL]:"Calculate funeral benefit for deceased contributors",[x.UNEMPLOYMENT]:"Calculate unemployment benefits for job seekers",[x.RETIREMENT]:"Calculate retirement benefit amount"};function X(){return!0}async function Z({weeklyWages:t,benefitType:i,employmentType:s,age:c}){if(!t||t<=0)throw new Error("Weekly wages must be greater than zero");if(!Object.values(x).includes(i))throw new Error("Invalid benefit type");try{const r={weekly_wages:parseFloat(t),benefit_type:i};s&&(r.employment_type=s),i===x.RETIREMENT&&(r.age=parseInt(c,10),r.months=0);const o=await fetch(`${L}/calculate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({benefit_data:r})});if(!o.ok){const g=await o.json().catch(()=>({}));throw new Error(g.description||g.message||`API request failed with status ${o.status}`)}const p=await o.json();return{weeklyAmount:p.weekly_amount,biweeklyAmount:p.biweekly_amount,monthlyAmount:p.monthly_amount,totalAmount:p.total_amount,maximumWeeks:p.maximum_weeks,reason:p.reason,success:!0}}catch(r){throw console.error("Benefit calculation error:",r),r.message.includes("Failed to fetch")?new Error("Unable to connect to the calculator service. Please check your internet connection and try again."):r}}const ee={[T.HOSPITALITY]:{min:0,max:null,description:"For hotel and hospitality industry workers"},[T.NON_HOSPITALITY]:{min:0,max:null,description:"For all other employment sectors"}},P=810;async function te(){try{const t=await fetch(`${L}/employment-types`);if(!t.ok)throw new Error(`Failed to fetch employment types: ${t.status}`);return await t.json()}catch(t){return console.error("Error fetching employment types:",t),Object.values(T)}}async function ae(){try{const t=await fetch(`${L}/benefit-types`);if(!t.ok)throw new Error(`Failed to fetch benefit types: ${t.status}`);return await t.json()}catch(t){return console.error("Error fetching benefit types:",t),Object.values(x)}}const se=[{id:"calc-1",q:"Is this estimate guaranteed?",a:"No. The calculator provides an estimate based on your inputs. Final eligibility and amounts are determined by NIB after document verification and review of your contribution history."},{id:"calc-2",q:"What are the different employment categories?",a:"There are two employment categories: Hospitality (for hotel and hospitality industry workers) and Non-Hospitality (for all other employment sectors)."},{id:"calc-3",q:"Will you store my information?",a:"No. All calculations are performed in real-time and your information is not saved or stored in any database."},{id:"calc-4",q:"What if my wages are at the wage ceiling?",a:"If your weekly wages are $810 or more, the calculator automatically applies the wage ceiling calculation. You will see an alert notifying you that special calculation rules apply."}];function le({form:t,showHint:i=!0}){const{t:s}=F(),[c,r]=u.useState(0);u.useEffect(()=>{const h=parseFloat(t.weeklyWages)||0;if(h>0){const b=Math.round(h*.6);r(b)}else r(0)},[t.weeklyWages]);const o=1e3,p=Math.max(0,Math.min(100,c/o*100)),g=z(0),j=J(g,h=>Math.round(h));return u.useEffect(()=>{const h=K(g,c,{duration:.4,ease:"easeOut"});return()=>h.stop()},[c,g]),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-white/85 shadow ring-1 ring-nibBlue/10",children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-nibGold to-nibBlue"}
1),e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -right-10 -top-8 h-20 w-36 rotate-12 bg-gradient-to-r from-nibBlue/10 to-nibGold/10"}),e.jsxs("div",{className:"relative p-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-nibBlue",children:s("calculatorPage.livePreview")}),i&&e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-nibGold",children:s("calculatorPage.estimateLabel")})]}),e.jsx("p",{className:"mt-2 text-xs text-slate-600",children:"This preview updates as you enter information. Final calculation will be more accurate."}),e.jsxs("div",{className:"mt-4 rounded-lg bg-nibBlue/5 p-3 ring-1 ring-nibBlue/10",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-sm text-slate-600",children:s("calculatorPage.estimatedWeeklyBenefit")}),e.jsxs(y.span,{className:"text-2xl font-extrabold text-nibBlue",children:["$",e.jsx(y.span,{style:{display:"inline-block"},children:j})]})]}),e.jsx("div",{className:"mt-3 h-3 w-full overflow-hidden rounded-full bg-nibBlue/10",children:e.jsx(y.div,{initial:!1,animate:{width:`${p}%`},transition:{type:"spring",stiffness:120,damping:20},className:"h-full rounded-full bg-gradient-to-r from-nibGold to-nibBlue"})}),e.jsxs("div",{className:"mt-1 flex justify-between text-[11px] text-slate-500",children:[e.jsx("span",{children:"$0"}),e.jsxs("span",{children:["~$",o.toLocaleString()]})]})]}),e.jsxs("div",{className:"mt-4 space-y-1 text-[13px] text-slate-700",children:[t.benefitType&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-nibGold",children:"•"}),e.jsxs("span",{children:["Benefit: ",k[t.benefitType]]})]}),t.weeklyWages>0&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-nibGold",children:"•"}),e.jsxs("span",{children:["Weekly wages: $",parseFloat(t.weeklyWages).toFixed(2)]})]}),t.employmentType&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-nibGold",children:"•"}),e.jsx("span",{children:C[t.employmentType]})]})]})]})]})}function fe(){Q("Benefits Calculator");const{t}=F(),[i]=u.useState(se),[s,c]=u.useState(null),[r,o]=u.useState(!0),[p,g]=u.useState([]),[j,h]=u.useState([]),[b,l]=u.useState({}),[d,f]=u.useState(0),[v,M]=u.useState(!1),[N,S]=u.useState(null),[R,B]=u.useState("");u.useEffect(()=>{async function a(){try{o(!0);const[n,m]=await Promise.all([ae(),te()]);g(n),h(m)}catch(n){console.error("Error loading calculator types:",n)}finally{o(!1)}}a()},[]);const $=b.benefitType==="retirement",E=u.useMemo(()=>{const a=[{key:"benefitType",title:"Select Benefit Type",description:"Choose the type of benefit you want to calculate.",fields:[{name:"benefitType",label:"Benefit Type",type:"benefit-cards",required:!0,options:p.filter(n=>k[n]).map(n=>({value:n,label:k[n],description:V[n]}))}]},{key:"weeklyWages",title:"Enter Your Weekly Wages",description:"Provide your average weekly wages to calculate your benefit amount.",fields:[{name:"weeklyWages",label:"Weekly Wages ($)",type:"currency",required:!0,min:1,max:99999,placeholder:"500.00"}]}];return $&&a.push({key:"retirementAge",title:"Your Age",description:"Enter your current age to calculate your retirement benefit.",fields:[{name:"age",label:"Age (years)",type:"number",required:!0,min:1,max:120,placeholder:"65"}]}),a.push({key:"employmentType",title:"Employment Category",description:"Select the category that best describes your employment situation.",fields:[{name:"employmentType",label:"Employment Type",type:"employment-cards",required:!0,options:j.filter(n=>C[n]).map(n=>{var m;return{value:n,label:C[n],description:((m=ee[n])==null?void 0:m.description)||"",available:X()}})}]}),{title:"Benefits Calculator",steps:a}},[p,j,$]).steps,w=E[d],I=E.length;function W(a){if(!a)return!1;const n=(a.fields||[]).filter(m=>m.required);for(const m of n){const A=b[m.name];if(A==null||A===""||typeof A=="string"&&A.trim()==="")return!1}return!0}const Y=d===I-1&&W(w)?100:(d+1)/I*100;function q(a,n){l(m=>({...m,[a]:n})),B("")}async function G(){if(B(""),!W(w)){B("Please complete all required fields before continuing.");return}if(d<I-1){f(a=>a+1);return}try{M(!0);const a=await Z({weeklyWages:b.weeklyWages,benefitType:b.benefitType,employmentType:b.employmentType,age:b.age});console.log("Calculation Result Received:",a),console.log("Weekly Amount:",a.weeklyAmount),S(a),U({particleCount:120,spread:70,origin:{y:.3},ticks:200,scalar:1,colors:["#fcb762","#0A2F5C","#ffffff"]})}catch(a){console.error("Calculation error:",a),B(a.message||"Unable to calculate your benefit. Please try again.")}finally{M(!1)}}function H(){if(N!=null){S(null);return}f(a=>Math.max(0,a-1)),B("")}function _(){l({}),f(0),S(null),B("")}return r?e.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[e.jsx(O,{breadcrumbs:[{label:"Home",to:"/"},{label:"Benefits",to:"/benefits/overview"},{label:"Calculator"}],title:"Benefits Calculator",description:"Calculate your estimated benefit amounts based on your wages and employment type."}),e.jsx("main",{className:"flex-1 bg-gradient-to-b from-white to-[#DDF6F0]",children:e.jsx("div",{className:"container-max mx-auto px-4 py-12",children:e.jsxs("div",{className:"mx-auto max-w-3xl rounded-2xl bg-white/80 p-6 shadow ring-1 ring-nibBlue/10",children:[e.jsx("div",{className:"h-4 w-40 animate-pulse rounded bg-nibBlue/10"}),e.jsx("div",{className:"mt-4 h-4 w-64 animate-pulse rounded bg-nibBlue/10"}),e.jsx("div",{className:"mt-6 h-10 w-full animate-pulse rounded bg-nibBlue/10"})]})})})]}):e.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[e.jsx(O,{breadcrumbs:[{label:"Home",to:"/"},{label:"Benefits",to:"/benefits/overview"},{label:"Calculator"}],title:"Benefits Calculator",description:"Calculate your estimated benefit amounts based on your wages and employment type."}),e.jsx("main",{className:"flex-1 bg-gradient-to-b from-white to-[#DDF6F0]",children:e.jsxs("div",{className:"container-max mx-auto px-4 pt-6 pb-12",children:[e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_360px]",children:[e.jsxs("section",{className:"relative mx-auto w-full overflow-hidden rounded-2xl bg-white/80 shadow ring-1 ring-nibBlue/10","data-tour":"calculator-inputs",children:[e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-nibGold to-nibBlue"}),e.jsx("div",{className:"pointer-events-none absolute -right-10 -top-8 h-24 w-40 rotate-12 bg-gradient-to-r from-nibBlue/10 to-nibGold/10"}),e.jsxs("div",{className:"p-6 pb-3",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-nibBlue/80",children:N==null?e.jsxs(e.Fragment,{children:["Step ",d+1," of ",E.length]}
1):t("calculatorPage.yourResult","Your Result")}),e.jsx("button",{onClick:_,className:"text-sm text-nibBlue underline decoration-nibGold/60 underline-offset-2 hover:text-nibBlueDark",children:t("calculatorPage.startOver")})]}),e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-nibBlue/10",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-nibGold to-nibBlue transition-all duration-300",style:{width:`${Math.min(100,Y)}%`},"aria-hidden":"true"})})]}),e.jsxs("div",{className:"p-6 pt-2",children:[e.jsx(D,{mode:"wait",children:N==null?e.jsxs(y.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"space-y-5",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-xl font-semibold text-nibBlue",children:w.title}),w.description&&e.jsx("p",{className:"mt-1 text-sm text-slate-700",children:w.description})]}),e.jsx("div",{className:"grid gap-4","data-tour":d===0?"calculator-select":void 0,children:w.fields.map(a=>e.jsx(ne,{field:a,value:b[a.name],onChange:q},a.name))}),R&&e.jsx(y.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"rounded-md bg-red-50 px-4 py-3 text-sm text-red-700 ring-1 ring-red-200",children:R})]},w.key):e.jsx(ie,{result:N,form:b})}),e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:H,className:"rounded-full border border-nibBlue/30 bg-white px-4 py-2 text-sm font-medium text-nibBlue shadow-sm hover:bg-nibLight hover:shadow disabled:opacity-50 transition-all duration-200",disabled:v||N==null&&d===0,children:N==null?t("common.back","Back"):t("calculatorPage.editDetails","Edit Details")}),N==null?e.jsx(y.button,{type:"button",onClick:G,whileTap:{scale:.98},className:`rounded-full px-5 py-2 text-sm font-semibold text-white shadow-sm transition-all duration-200 ${v?"bg-nibBlue/70 cursor-wait":"bg-nibBlue hover:bg-nibBlueDark hover:shadow"}`,disabled:v,children:d<E.length-1?t("common.next","Next"):v?t("calculatorPage.calculating"):t("calculatorPage.calculateBenefit","Calculate Benefit")}):e.jsx(y.button,{type:"button",onClick:_,whileTap:{scale:.98},className:"rounded-full bg-nibGold px-5 py-2 text-sm font-semibold text-white shadow-sm hover:bg-nibGoldDark hover:shadow transition-all duration-200",children:t("calculatorPage.newCalculation","New Calculation")})]})]})]}),e.jsx("div",{className:"lg:sticky lg:top-6 h-fit","data-tour":"calculator-results",children:e.jsx(le,{form:b})})]}),e.jsx("section",{"aria-labelledby":"calc-faqs",className:"mx-auto mt-8 max-w-3xl",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-white/80 shadow ring-1 ring-nibBlue/10",children:[e.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-nibGold to-nibBlue"}),e.jsxs("div",{className:"p-6 pt-8",children:[e.jsxs("header",{className:"mb-4",children:[e.jsx("h2",{id:"calc-faqs",className:"text-xl font-semibold text-nibBlue",children:"Calculator FAQs"}),e.jsx("p",{className:"mt-1 text-sm text-slate-700",children:"Common questions about using the calculator and understanding results."})]}),e.jsx("div",{className:"overflow-hidden rounded-xl bg-white/70 ring-1 ring-nibBlue/10",children:i.map((a,n)=>{const m=s===a.id;return e.jsxs("div",{className:n>0?"border-t border-nibBlue/10":"",children:[e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between px-4 py-3 text-left hover:bg-nibLight transition-colors","aria-expanded":m,"aria-controls":`faq-panel-${a.id}`,onClick:()=>c(m?null:a.id),children:[e.jsx("span",{className:"font-medium text-nibBlue",children:a.q}),e.jsx("svg",{className:`h-4 w-4 text-nibBlue transition-transform ${m?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z",clipRule:"evenodd"})})]}),e.jsx("div",{id:`faq-panel-${a.id}`,className:`grid transition-[grid-template-rows] duration-300 ease-in-out ${m?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsx("div",{className:"px-4 pb-4 text-sm text-slate-700",children:a.a})})})]},a.id)})})]})]})})]})})]})}function ie({result:t,form:i}){var o;const{t:s}=F(),c=parseFloat(i.weeklyWages)||0,r=c>=P;return e.jsxs(y.div,{initial:{opacity:0,scale:.98}
1,animate:{opacity:1,scale:1},transition:{duration:.3},className:"space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold text-nibBlue",children:s("calculatorPage.yourEstimate")}),e.jsxs("p",{className:"mt-2 text-sm text-slate-600",children:["Based on your ",(o=k[i.benefitType])==null?void 0:o.toLowerCase()," calculation"]})]}),r&&e.jsx(y.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},transition:{delay:.2},className:"rounded-lg bg-amber-50 px-4 py-3 text-sm text-amber-800 ring-1 ring-amber-200",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("svg",{className:"h-5 w-5 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})}),e.jsxs("div",{children:[e.jsx("strong",{className:"font-semibold",children:s("calculatorPage.wageCeilingApplied")})," ",s("calculatorPage.wageCeilingNote",{wages:c.toFixed(2),ceiling:P.toFixed(2)})]})]})}),e.jsxs("div",{className:"rounded-xl bg-gradient-to-br from-nibBlue to-nibBlueDark p-8 text-white shadow-lg",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-medium opacity-90 uppercase tracking-wide",children:t.monthlyAmount!=null?"Monthly Benefit Amount":t.weeklyAmount!=null?"Weekly Benefit Amount":"Total Benefit Amount"}),e.jsxs(y.p,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:200,damping:15,delay:.1},className:"mt-3 text-7xl font-extrabold tracking-tight",children:["$",t.monthlyAmount!=null?t.monthlyAmount.toFixed(2):t.weeklyAmount!=null?t.weeklyAmount.toFixed(2):t.totalAmount!=null?t.totalAmount.toFixed(2):"0.00"]})]}),e.jsxs("div",{className:"mt-6 space-y-3 border-t border-white/20 pt-4",children:[t.biweeklyAmount!=null&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm opacity-90",children:s("calculatorPage.biweeklyAmount")}),e.jsxs("span",{className:"text-lg font-semibold",children:["$",t.biweeklyAmount.toFixed(2)]})]}),t.totalAmount!=null&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm opacity-90",children:s("calculatorPage.totalBenefitAmount")}),e.jsxs("span",{className:"text-lg font-semibold",children:["$",t.totalAmount.toFixed(2)]})]}),t.maximumWeeks!=null&&e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm opacity-90",children:s("calculatorPage.maximumDuration")}),e.jsxs("span",{className:"text-lg font-semibold",children:[t.maximumWeeks," weeks"]})]}),t.reason&&e.jsx("div",{className:"mt-4 rounded-lg bg-white/10 p-3",children:e.jsx("p",{className:"text-xs opacity-90",children:t.reason})})]})]}),e.jsxs("div",{className:"rounded-xl bg-nibLight/50 p-4 ring-1 ring-nibBlue/10",children:[e.jsx("h3",{className:"text-sm font-semibold text-nibBlue mb-3",children:s("calculatorPage.calcDetails","Calculation Details")}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:s("calculatorPage.benefitTypeLabel")}),e.jsx("span",{className:"font-medium text-nibBlue",children:k[i.benefitType]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:s("calculatorPage.weeklyWagesLabel")}),e.jsxs("span",{className:"font-medium text-nibBlue",children:["$",parseFloat(i.weeklyWages).toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:s("calculatorPage.employmentTypeLabel")}),e.jsx("span",{className:"font-medium text-nibBlue",children:C[i.employmentType]})]})]})]}),e.jsx("div",{className:"rounded-lg bg-amber-50 p-4 ring-1 ring-amber-200",children:e.jsxs("p",{className:"text-xs text-amber-800 leading-relaxed",children:[e.jsx("strong",{children:"Important:"})," This is an estimate only and does not guarantee payment. Actual benefit amounts depend on your contribution history, eligibility verification, and NIB's assessment of your claim. Please contact NIB for official confirmation."]})})]},"result")}function ne({field:t,value:i,onChange:s}){const{name:c,label:r,type:o,options:p=[],min:g,max:j,required:h,placeholder:b}=t;if(o==="benefit-cards")return e.jsxs("fieldset",{children:[e.jsxs("legend",{className:"mb-3 block text-sm font-medium text-nibBlue",children:[r,h&&" *"]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:p.map(l=>{const d=i===l.value;return e.jsx(y.label,{whileHover:{scale:1.02},whileTap:{scale:.98},className:`flex cursor-pointer flex-col rounded-lg border-2 p-4 transition-all ${d?"border-nibGold bg-nibGold/10 shadow-md":"border-nibBlue/20 bg-white hover:border-nibBlue/40 hover:shadow"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"radio",name:c,value:l.value,checked:d,onChange:f=>s(c,f.target.value),className:"mt-0.5 accent-nibBlue"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-semibold text-nibBlue",children:l.label}),l.description&&e.jsx("div",{className:"mt-1 text-xs text-slate-600",children:l.description})]})]})},l.value)})})]});if(o==="employment-cards")return e.jsxs("fieldset",{children:[e.jsxs("legend",{className:"mb-3 block text-sm font-medium text-nibBlue",children:[r,h&&" *"]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:p.map(l=>{const d=i===l.value,f=!l.available;return e.jsx(y.label,{whileHover:f?{}:{scale:1.02},whileTap:f?{}:{scale:.98},className:`flex cursor-pointer flex-col rounded-lg border-2 p-4 transition-all ${f?"cursor-not-allowed border-slate-200 bg-slate-50 opacity-60":d?"border-nibGold bg-nibGold/10 shadow-md":"border-nibBlue/20 bg-white hover:border-nibBlue/40 hover:shadow"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"radio",name:c,value:l.value,checked:d,disabled:f,onChange:v=>s(c,v.target.value),className:"mt-0.5 accent-nibBlue disabled:opacity-40"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:`font-semibold ${f?"text-slate-500":"text-nibBlue"}`,children:l.label}),l.description&&e.jsx("div",{className:"mt-1 text-xs text-slate-600",children:l.description})]})]})},l.value)})})]});if(o==="currency"){const l=parseFloat(i)||0,d=l>=P;return e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-nibBlue",children:[r,h&&" *"]}),e.jsxs("div",{className:"relative mt-2",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:e.jsx("span",{className:"text-slate-500 sm:text-sm",children:"$"})}),e.jsx("input",{type:"number",inputMode:"decimal",step:"0.01",min:g,max:j,value:i??"",placeholder:b,onChange:f=>s(c,f.target.value),className:"block w-full rounded-lg border border-nibBlue/30 bg-white py-3 pl-7 pr-12 shadow-sm focus:border-nibBlue focus:ring-2 focus:ring-nibBlue/20"})]}),l>0&&e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsxs("p",{className:"text-xs text-slate-600",children:["Weekly wages: ",e.jsxs("span",{className:"font-medium text-nibBlue",children:["$",l.toFixed(2)]})]}),d&&e.jsxs("div",{className:"flex items-start gap-1.5 rounded-md bg-amber-50 px-2 py-1.5 text-xs text-amber-800",children:[e.jsx("svg",{className:"h-4 w-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})}),e.jsxs("span",{children:["At wage ceiling ($",P,"+) - special calculation applies"]})]})]})]})}return e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-nibBlue",children:[r,h&&" *"]}),e.jsx("input",{type:o,inputMode:o==="number"?"numeric":void 0,min:g,max:j,value:i??"",placeholder:b,onChange:l=>s(c,l.target.value),className:"mt-2 block w-full rounded-lg border border-nibBlue/30 bg-white px-3 py-2 shadow-sm focus:border-nibBlue focus:ring-2 focus:ring-nibBlue/20"})]})}
1export{fe 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.